From: Philipp Stephani <p.stephani2@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
Emacs developers <emacs-devel@gnu.org>
Subject: Re: master 792ba71: Add a new function 'buffer-line-statistics'
Date: Tue, 12 Jan 2021 19:29:39 +0100 [thread overview]
Message-ID: <CAArVCkSDW5n1VHhJX05Gf3BcgArm3KKqp69fk6EDPO9TRrrV8w@mail.gmail.com> (raw)
In-Reply-To: <jwveeiq2ffk.fsf-monnier+emacs@gnu.org>
Am Di., 12. Jan. 2021 um 19:22 Uhr schrieb Stefan Monnier
<monnier@iro.umontreal.ca>:
>
> > + double mean = 0;
> [...]
> > + /* Blame Knuth. */
> > + mean = mean + (this_line - mean) / lines;
>
> I must admit to not being fully cognizant of Knuth, but doesn't this
> compute the average rather than the mean?
>
> I thought computing the mean was necessarily O(N) in space (like
> keeping the full sequence of line lengths so you can sort it and then
> pick the middle point).
>
That's the median. "Mean" typically means "arithmetic mean."
next prev parent reply other threads:[~2021-01-12 18:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210112174748.18372.29339@vcs0.savannah.gnu.org>
[not found] ` <20210112174750.5928220B2C@vcs0.savannah.gnu.org>
2021-01-12 18:15 ` master 792ba71: Add a new function 'buffer-line-statistics' Stefan Monnier
2021-01-12 18:29 ` Philipp Stephani [this message]
2021-01-12 19:06 ` Stefan Monnier
2021-01-12 18:37 ` Eli Zaretskii
2021-01-12 18:43 ` Eli Zaretskii
2021-01-12 18:39 ` Lars Ingebrigtsen
2021-01-12 19:18 ` Eli Zaretskii
2021-01-12 19:54 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAArVCkSDW5n1VHhJX05Gf3BcgArm3KKqp69fk6EDPO9TRrrV8w@mail.gmail.com \
--to=p.stephani2@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.