Someone told me recently that over a third of numbers start with the digit one - which of course is untrue - it's 10% of numbers (if you allow for zero starts), or 11.11111% if you don't.
Except ...
If you take all the numbers that are
used in a typical report, you won't find the even balance. Ever one to explore, and while unable to get into a serious project today as I'm on call to wait, front of house ('can we have some more water', 'can we use a room for a breakout meeting', 'did you make these yummy pastries'), I thought I would test it out - I evaluated the size of all of yesterday's accesses to our web site:
-bash-3.2$ ./sn ac_20090618
1 - 54658 of 127322 (42%)
2 - 21778 of 127322 (17%)
3 - 7256 of 127322 (5%)
4 - 5988 of 127322 (4%)
5 - 5320 of 127322 (4%)
6 - 15472 of 127322 (12%)
7 - 4985 of 127322 (3%)
8 - 6271 of 127322 (4%)
9 - 5594 of 127322 (4%)
-bash-3.2$
Yup ... in our case, over 40% of numbers start with a 1.
Code:
#!/usr/bin/perl -na
$c1 = substr($F[9],0,1);
if ($c1 ne "-" and $c1 ne '"') {
$c++;
$co{$c1}++; }
END {
foreach $p (sort(keys %co)) {
$pc = sprintf("%d",$co{$p}*100/$c);
print "$p - $co{$p} of $c ($pc%)\n";
}
}
(Note use of command line options for autosplit mode, and for looping through all lines of an incoming file. Also note use of sprintf to do the awkward bit of the formatting, while leaving print to do the easy stuff.)
(written 2009-06-19, updated 2010-06-03)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Z800 - Whimsy [24] Impossible terms - (2004-08-22)
[39] A Change is as good as a rest - (2004-09-05)
[44] Serious subject - (2004-09-10)
[69] John Toner - (2004-10-01)
[94] Special change - (2004-10-20)
[151] Coffee Standards - (2004-12-14)
[156] Signage - (2004-12-18)
[300] Dentist's Waiting Room Syndrome - (2005-05-04)
[331] 08:45 is a difficult time - (2005-05-31)
[346] No Smoking Pubs - (2005-06-13)
[395] Making Orangutangs - (2005-07-28)
[520] Three life changing comments - (2005-12-07)
[547] Taking the dog for a walk - (2005-12-29)
[568] NB ''Aspiration'' - (2006-01-18)
[610] Need a hankie - (2006-02-16)
[661] Dressed up for a phone call - (2006-03-29)
[689] The call of nature - (2006-04-18)
[701] Minature Cyclists only - limited headroom - (2006-04-27)
[758] Very good for woodlice - (2006-06-12)
[761] Great new inventions - (2006-06-14)
[784] Which way to turn? - (2006-06-28)
[807] Telling large from small - (2006-07-18)
[850] Lighter moments - (2006-08-31)
[892] A pattern in change - (2006-10-12)
[973] Too much used to Skype - (2006-12-08)
[1075] I'm not the father - (2007-02-11)
[1167] Leaning tower of Cheeser - (2007-04-28)
[1171] Traffic light control for horses - (2007-05-01)
[1241] If I say 'I am fine', what do I mean? - (2007-06-23)
[1440] Useful command or messy screen? - (2007-11-21)
[1604] M25 / South Mimms Service Area - (2008-04-07)
[1662] Westonbirt Arboretum Postcode - (2008-05-31)
[1886] Keys to friendless churches - (2008-11-15)
[1952] Small Print - (2008-12-19)
[1977] Going round the block - (2009-01-04)
[1980] Michelle - (2009-01-06)
[1988] Melksham, Wiltshire. Town Crier Competition, 2009 - (2009-01-11)
[2009] The Royal Mail Receipt - (2009-01-26)
[2028] Things people say on the phone - (2009-02-06)
[2050] Why the Pony Tail? - (2009-02-21)
[2089] The Longest Day - Wednesday, 28th September - (2009-03-18)
[2108] Funny Amusing, Funny Amazing and The Smarts - (2009-03-29)
[2127] Call in the professionals! - (2009-04-12)
[2131] Patterns in street names - (2009-04-17)
[2138] Ski bore ... train bore ... dog bore - (2009-04-24)
[2143] Throughout the year, around the world - (2009-04-27)
[2152] My four feet! - (2009-05-01)
[2157] From the 51773 family - (2009-05-04)
[2180] Patterns in numbers - room occupancy - (2009-05-13)
[2250] Bluegrass comes to Melksham - (2009-06-19)
[2256] Is it Python past cheetah already? - (2009-06-24)
[2397] Signwriting is dead. Long live the sign. - (2009-09-06)
[2496] A better design of mouth - (2009-11-07)
[2542] My armpit was like a zebra crossing - (2009-12-19)
[2626] On Malachite Green - (2010-02-06)
[2676] Changing Times - (2010-03-13)
[2945] Last, final, etc - (2010-09-04)
[3030] Liquorice allsorts and Dolly Mixtures - (2010-11-05)
[3203] Melksham Town Council announces ... - (2011-03-16)
[3215] Solution looking for problem - (2011-03-27)
[3223] Answering at my earliest convenience - (2011-03-29)
[3226] A busy morning for railway announcements - (2011-04-01)
[3288] Random Questions ... - (2011-05-14)
[3369] Local Council leads bans on many activities - (2011-07-24)
[3462] Hangers, luggage and possessions - (2011-10-01)
[3738] Adoptive homes sought for abandoned babies - (2012-05-20)
[3851] Who is this? Picture Puzzle - (2012-08-28)
[3868] How to make an ohno cake - (2012-09-23)
[3912] Sand to Arabia, Coals to Newcastle or Woodburners to Russia - (2012-11-04)
[3922] Twerp - A person regarded as insignificant and contemptible - (2012-11-12)
[4067] The woman, the television, the bullock and Darlington - (2013-04-23)
[4329] Does Santa Claus need a CRB check? - (2014-11-25)
[4392] Interview conditions,and other instructions to staff - (2015-01-12)
Some other Articles
Past PHP delegates / others - coding help needed for next 3 monthsForum membership - a privilege not a rightWalks in and around Melksham, WiltshireLeaping dog, Leaping horse, copyright of old mastersOver a third of numbers start with the digit 1Public Transport from London to Melksham, WiltshireGetting home from MelkshamA day in the life of a hotelierWhat difference does using the XHTML standard really make?