Main Content
Patterns in numbers - room occupancy Archive - Originally posted on "The Horse's Mouth" - 2009-05-13 06:31:10 - Graham Ellis
I have often spotted patterns in the room numbers we have occupied - describing a night where 1, 3 and 5 are occupied but 2 and 4 are not as "odd" for example, and I have been surprised at how often the let combination allows me to come up with some such form of wording. I woke ... dawn is early at the moment ... and wondered just how many of the occupancy patterns could be met be a short description. And what better way to generate the pattern than a Python program ;-)
nrooms = 5
for room in range (2 ** nrooms):
print "occupied:",
for df in range(nrooms):
pw = 2 ** df
if room / pw % 2 == 1:
print df+1,
print
And the results?
occupied: "empty"
occupied: 1 "singular"
occupied: 2
occupied: 1 2 "bottoms"
occupied: 3 "one in the middle"
occupied: 1 3
occupied: 2 3
occupied: 1 2 3 "lowers"
occupied: 4 "factosisable"
occupied: 1 4 "squares"
occupied: 2 4 "even"
occupied: 1 2 4 "powers of 2"
occupied: 3 4
occupied: 1 3 4
occupied: 2 3 4 "middles"
occupied: 1 2 3 4 "top missing"
occupied: 5 "just the top"
occupied: 1 5 "extreme"
occupied: 2 5
occupied: 1 2 5
occupied: 3 5
occupied: 1 3 5 "odd"
occupied: 2 3 5 "prime"
occupied: 1 2 3 5 "Fibonacci"
occupied: 4 5 "tops"
occupied: 1 4 5
occupied: 2 4 5
occupied: 1 2 4 5 "hole in th middle"
occupied: 3 4 5 "uppers"
occupied: 1 3 4 5
occupied: 2 3 4 5 "non-singular"
occupied: 1 2 3 4 5 "full"
Hmm .. the majority (but not all) do describe to a pattern!
Some other articles
Z800 - Whimsy Interview conditions,and other instructions to staff Does Santa Claus need a CRB check? The woman, the television, the bullock and Darlington Twerp - A person regarded as insignificant and contemptible Sand to Arabia, Coals to Newcastle or Woodburners to Russia How to make an ohno cake Who is this? Picture Puzzle Adoptive homes sought for abandoned babies Hangers, luggage and possessions Local Council leads bans on many activities Random Questions ... A busy morning for railway announcements Answering at my earliest convenience Solution looking for problem Melksham Town Council announces ... Liquorice allsorts and Dolly Mixtures Last, final, etc Changing Times On Malachite Green My armpit was like a zebra crossing A better design of mouth Signwriting is dead. Long live the sign. Is it Python past cheetah already? Over a third of numbers start with the digit 1 Bluegrass comes to Melksham This article From the 51773 family My four feet! Throughout the year, around the world Ski bore ... train bore ... dog bore Patterns in street names Call in the professionals! Funny Amusing, Funny Amazing and The Smarts The Longest Day - Wednesday, 28th September Why the Pony Tail? Things people say on the phone The Royal Mail Receipt Melksham, Wiltshire. Town Crier Competition, 2009 Michelle Going round the block Small Print Keys to friendless churches Westonbirt Arboretum Postcode M25 / South Mimms Service Area Useful command or messy screen? If I say 'I am fine', what do I mean? Traffic light control for horses Leaning tower of Cheeser I'm not the father Too much used to Skype A pattern in change Lighter moments Telling large from small Which way to turn? Great new inventions Very good for woodlice Minature Cyclists only - limited headroom The call of nature Dressed up for a phone call Need a hankie NB ''Aspiration'' Taking the dog for a walk Three life changing comments Making Orangutangs No Smoking Pubs 08:45 is a difficult time Dentist's Waiting Room Syndrome Signage Coffee Standards Special change John Toner Serious subject A Change is as good as a rest Impossible terms