Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.099 X-Spam-Evidence: '*H*': 0.80; '*S*': 0.00; 'programmer': 0.03; 'package,': 0.03; 'algorithm': 0.04; 'correct.': 0.07; 'intel': 0.07; 'see:': 0.07; 'test,': 0.07; 'overflow': 0.09; 'run,': 0.09; 'runs': 0.10; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'times,': 0.14; 'costing': 0.16; 'determining': 0.16; 'door,': 0.16; 'equation': 0.16; 'isnt': 0.16; 'package).': 0.16; 'reminded': 0.16; 'rings': 0.16; 'roy': 0.16; 'sorting': 0.16; 'sorts': 0.16; 'sports.': 0.16; 'stolen': 0.16; 'throw': 0.16; 'time).': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'producing': 0.19; 'examples': 0.20; 'machine': 0.22; 'example': 0.22; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'tend': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; "i've": 0.25; 'hall': 0.26; 'meeting': 0.26; 'second': 0.26; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'correct': 0.29; 'fixed': 0.29; 'am,': 0.29; 'words': 0.29; "doesn't": 0.30; 'door': 0.30; 'heading': 0.30; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'towards': 0.31; 'ball': 0.31; 'context,': 0.31; "d'aprano": 0.31; 'delivery.': 0.31; 'explained': 0.31; 'minor': 0.31; 'silicon': 0.31; 'steven': 0.31; 'ups': 0.31; 'front': 0.32; 'another': 0.32; '(including': 0.33; '(i.e.': 0.33; 'problem': 0.35; 'something': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'building': 0.35; 'there': 0.35; 'executing': 0.36; 'done': 0.36; 'doing': 0.36; 'thanks': 0.36; 'should': 0.36; 'seconds': 0.37; 'wrong': 0.37; 'sometimes': 0.38; 'checks': 0.38; 'ends': 0.38; 'follows:': 0.38; 'saves': 0.38; 'somebody': 0.38; 'fact': 0.38; 'bad': 0.39; 'realize': 0.39; 'sure': 0.39; 'house.': 0.60; 'is.': 0.60; 'subject:"': 0.60; 'ago.': 0.61; 'hardware': 0.61; 'lost': 0.61; 'new': 0.61; 'numbers': 0.61; 'entire': 0.61; 'matter': 0.61; "you're": 0.61; 'companies': 0.62; 'back': 0.62; 'times': 0.62; 'making': 0.63; 'high': 0.63; 'day.': 0.63; 'more': 0.64; 'different': 0.65; 'taking': 0.65; 'holding': 0.65; 'investment': 0.66; 'direct': 0.67; 'close': 0.67; 'beat': 0.68; 'smith': 0.68; 'home': 0.69; '500': 0.70; 'cut': 0.74; 'increase': 0.74; 'million': 0.74; 'guaranteed': 0.75; 'day': 0.76; 'article': 0.77; '100': 0.79; 'discovered': 0.83; '$0.10': 0.84; 'balanced': 0.84; 'darn': 0.84; 'domain,': 0.84; 'factoring': 0.84; 'faster.': 0.84; 'moderately': 0.84; 'plate': 0.84; 'standing': 0.84; 'story:': 0.84; 'absolutely': 0.87; 'analyses': 0.91; 'discipline': 0.91; 'glove': 0.91; 'mistake': 0.91; 'promised': 0.91; 'feet': 0.93; 'imagine': 0.93; 'mistakes': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=tDn0G9lSXnmJ+VtN6px7+xRWKXO9AAA1O7ntFiI55So=; b=wNkN3Z5ISr9R18wyNdIeQryj2Lo9/H4CwHBfNr2WarmsJwnYqFYFQSmPQFPJEIU7i2 aLcz/wMViBDKSQMwDdAEgReG1ry/u0HNlOc7UiuCsThyuhPyAhKK4G7jvdOmWuBAoS0k DmsyzXfs9QEONugF9pCgWxHvg+EdCaXkXkSra/lYdc7ueimonoBZihSrdf4dkwnsTu8J oikUHEiXC9inHNS3R/GXiG7mbtRgvwdIK5MufaQBoCRsiJgLdOmuRBJGGyYbFAIByJfv WI/lNVit0IjQy3X9ekjldb6ivBxdRvbXKouBYHMbF6tFwHaxwkNB1RzaPTP4qNkVyV5Y xDVg== X-Received: by 10.69.31.170 with SMTP id kn10mr109655133pbd.106.1388896988040; Sat, 04 Jan 2014 20:43:08 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <52c1dc4c$0$2877$c3e8da3$76491128@news.astraweb.com> <52C1F5EC.3020808@stoneleaf.us> <52c29416$0$29987$c3e8da3$5496439d@news.astraweb.com> <52c6415c$0$29972$c3e8da3$5496439d@news.astraweb.com> <52C6AD00.5050000@chamonix.reportlab.co.uk> <52c8c301$0$29998$c3e8da3$5496439d@news.astraweb.com> From: Rustom Mody Date: Sun, 5 Jan 2014 10:12:47 +0530 Subject: Re: Blog "about python 3" To: Roy Smith Content-Type: text/plain; charset=ISO-8859-1 Cc: "python-list@python.org" 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: 85 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1388896998 news.xs4all.nl 2846 [2001:888:2000:d::a6]:43516 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63168 On Sun, Jan 5, 2014 at 8:50 AM, Roy Smith wrote: > I wrote: >> > I realize I'm taking this statement out of context, but yes, sometimes >> > fast is more important than correct. > > In article <52c8c301$0$29998$c3e8da3$5496439d@news.astraweb.com>, > Steven D'Aprano wrote: >> Fast is never more important than correct. > > Sure it is. > > Let's imagine you're building a system which sorts packages for > delivery. You sort 1 million packages every night and put them on > trucks going out for final delivery. > > Some assumptions: > > Every second I can cut from the sort time saves me $0.01. > > If I mis-sort a package, it goes out on the wrong truck, doesn't get > discovered until the end of the day, and ends up costing me $5 > (including not just the direct cost of redelivering it, but also > factoring in ill will and having to make the occasional refund for not > meeting the promised delivery time). > > I've got a new sorting algorithm which is guaranteed to cut 10 seconds > off the sorting time (i.e. $0.10 per package). The problem is, it makes > a mistake 1% of the time. > > Let's see: > > 1 million packages x $0.10 = $100,000 saved per day because I sort them > faster. 10,000 of them will go to the wrong place, and that will cost > me $50,000 per day. By going fast and making mistakes once in a while, > I increase my profit by $50,000 per day. > > The numbers above are fabricated, but I'm sure UPS, FexEx, and all the > other package delivery companies are doing these sorts of analyses every > day. I watch the UPS guy come to my house. He gets out of his truck, > walks to my front door, rings the bell, waits approximately 5 > microseconds, leaves the package on the porch, and goes back to his > truck. I'm sure UPS has figured out that the amortized cost of the > occasional stolen or lost package is less than the cost for the delivery > guy to wait for me to come to the front door and sign for the delivery. > > Looking at another problem domain, let's say you're a contestant on > Jeopardy. If you listen to the entire clue and spend 3 seconds making > sure you know the correct answer before hitting the buzzer, it doesn't > matter if you're right or wrong. Somebody else beat you to the buzzer, > 2.5 seconds ago. > > Or, let's take an example from sports. I'm standing at home plate > holding a bat. 60 feet away from me, the pitcher is about to throw a > baseball towards me at darn close to 100 MPH (insert words like "bowl" > and "wicket" as geographically appropriate). 400 ms later, the ball is > going to be in the catcher's glove if you don't hit it. If you have an > absolutely perfect algorithm to determining if it's a ball or a strike, > which takes 500 ms to run, you're going back to the minor leagues. If > you have a 300 ms algorithm which is right 75% of the time, you're > heading to the hall of fame. Neat examples -- thanks Only minor quibble isnt $5 cost of mis-sorting a gross underestimate? I am reminded of a passage of Dijkstra in Discipline of Programming -- something to this effect He laments the fact that hardware engineers were not including overflow checks in machine ALUs. He explained as follows: If a test is moderately balanced (statistically speaking) a programmer will not mind writing an if statement If however the test is very skew -- say if 99% times, else 1% -- he will tend to skimp on the test, producing 'buggy' code [EWD would never use the bad b word or course] The cost equation for hardware is very different -- once the investment in the silicon is done with -- fixed cost albeit high -- there is no variable cost to executing that circuitry once or a zillion times Moral of Story: Intel should take up FSR [Ducks and runs for cover]