Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:code': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Source': 0.09; 'jan': 0.12; 'finite': 0.16; 'iterable': 0.16; 'pythonic': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:?)': 0.16; 'subject:user': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; '(or': 0.24; 'shown': 0.26; 'url:edu': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'subject: (': 0.35; "he's": 0.36; "didn't": 0.36; 'easily': 0.37; 'requiring': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'numbers': 0.61; 'received:173': 0.61; 'such': 0.63; 'sum': 0.64; 'received:fios.verizon.net': 0.84; 'carlos': 0.91; 'same,': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Jan Reedy Subject: Dijkstra (was Re: Source code to identify user through browser?) Date: Wed, 05 Jun 2013 20:07:19 -0400 References: , , <53e74d68-7bd0-4ee6-bb6c-f3f7724c9342@qz2g2000pbb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370477231 news.xs4all.nl 15891 [2001:888:2000:d::a6]:41424 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47164 On 6/5/2013 6:07 PM, Carlos Nepomuceno wrote: > Didn't know he was such a humorist! lol > > Although I prefer when he's serious: > > http://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD1094.html pythonic summary: Let S be an finite iterable of numbers (make it not an iterable if one interprets the conclusion as requiring reiteration) and let n = len(S) (or len(list(S)) if need be). The if n > 2 and len(set(S)) > 1, n * min(S) < sum(S) < max(S) # easily shown by induction on n If the n = 1 or the items in S are all the same, n*min == sum == n*max I might call this the 'Averages are not extreme' theorem. Corollary: if min(s) == 1 and sum(S) > n, then max(S) > 1 'Pigeonhole Principle' -- Terry Jan Reedy