From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: master 792ba71: Add a new function 'buffer-line-statistics' Date: Tue, 12 Jan 2021 19:39:54 +0100 Message-ID: <87pn2ahudh.fsf@gnus.org> References: <20210112174748.18372.29339@vcs0.savannah.gnu.org> <20210112174750.5928220B2C@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15764"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 12 19:57:29 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzOr9-0003vN-Hw for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Jan 2021 19:57:27 +0100 Original-Received: from localhost ([::1]:44530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzOr8-00061W-Ie for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Jan 2021 13:57:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzOaK-0006NS-7g for emacs-devel@gnu.org; Tue, 12 Jan 2021 13:40:05 -0500 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:56564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzOaI-00007N-4B for emacs-devel@gnu.org; Tue, 12 Jan 2021 13:40:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ljNvxvIOT5F9HpYYcsOAqDKrgWUKlXrw2YMWW8y+gcI=; b=Tx+BdO4Y4Vvr1QpCLfx55E8cEM 7BnKaotSyEV44DTHjlyTJ6R5zlgIGCZe3G3aLNEOnoWMcmxl/BU06frQiXIFjzvSjfAOFqygplxRK q7sxgspJHfgds+aqYIUxm94OZhmaI8aHk3ALJ3amDO4QivyVKNJ/Lajy8lG0tYYdC2rk=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzOaB-0000k3-4z; Tue, 12 Jan 2021 19:39:57 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEX8+/uuqKFfWlKN hXPY0tAcFxb///+s7z54AAAAAWJLR0QGYWa4fQAAAAd0SU1FB+UBDBIlEBcNAQQAAAGhSURBVDjL zdO9lqsgEABgiNzeWU0fB+gTxV4i9nfRef9X2QFjTNzd4nZ3Cp3DJzP8HIX455DIoYPSXSm7lnOL XVcyFMQBoUZ9LRCJ0FJsrw+IEsoNdIUtbkAdDhYZONVejztEJxAvGRrfNnspJ0T7AO1G3EFkOGlu rBvon6Xi8ARdNZ19BZWhpzk42IGcGHrLgLwHE3AHvIjWmpPl1M4Qd4BFWIb0SeRdxsvW4z4roiWB 1p3dgSzJB8RQ8fMJNJ8SxLTz/g2WKUE+EvsG5pzgg7P6DXDIM7yNGBL83VZlywRFDZXjI9D7IVKZ Sr3f+dpj6H+BZQUYjjBnkNYdgWLP8Mep7zClGdfvYFS/SKEChxDhdQaopRjrsMYLUAhGnvEHKGEp CINL43nRCgDq/NFwokakcb/uhjPuyS+Gz9I/Z8g5LZUg3+BsPNeo1+Ve+nkie5stQ0Qeb02V/w/j 28ncHXxkGMSdYkzHLpfg7zA6AKfqtAa19fgMQ+W903V9+AejD+dQXdtgDkA3mDpQFpcjzLexaPjl jqXwxlcnsTnAfxlfdeid5hiGxPwAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMDEtMTJUMTg6Mzc6 MTYrMDA6MDDfGBaNAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTAxLTEyVDE4OjM3OjE2KzAwOjAw rkWuMQAAAABJRU5ErkJggg== X-Now-Playing: The Durutti Column's _From Brussels With Love (2)_: "For Belgian Friends" In-Reply-To: (Stefan Monnier's message of "Tue, 12 Jan 2021 13:15:25 -0500") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.999 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:263020 Archived-At: Stefan Monnier writes: > I must admit to not being fully cognizant of Knuth, but doesn't this > compute the average rather than the mean? Arithmetic mean, which is the meanest of 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, and that's what I also thought, but it turns out that you can approximate the median to the desired accuracy with much less than O(N) space: https://www.stat.cmu.edu/~ryantibs/papers/median.pdf Which we can consider if somebody wants it. :-) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no