Dice fascinate me. I even collect them. (Geek alert #1.) Some of my earliest memories of programming involved dice simulations and usually included lines that looked something like this:
roll = INT(1+RAND()*6)
That little line of code generates an integer number from 1 to 6. I know, I know. Geek alert #2.
Some interesting facts about normal 6-sided dice. A die is a cube consisting of six faces that are perfect squares of identical size. The numbers displayed on the six faces range from 1 to 6. Additionally, the sum of two opposite sides of the die always add up to 7.
In our office last week the cutesy “Days Until Christmas” display showed up on the wall above the fax machine. It is powered by dice! How exciting. Make the jump to roll them bones.
This morning it said “59 days” so I went to decrement the number. As I did this, I realized that two dice were used to display the number of days remaining. The first die said “5” and the second die said “9.” Placed in the display the two dice together read “59.”
Interesting, I thought to myself, since it is impossible for a dice to have all ten digits required, 0 through 9. How did they do that, I wondered? Rather than simply study their dice (which would be cheating) I decided to work it out myself.
The first thing I realized is that only one symbol is used for the “6” and the “9.” Simply orient the dice 180 degrees when the other number is required.
So that leaves us with two six-sided dice to represent the remaining nine numerical characters. This is now a puzzle. The question: How to represent all possible two-digit numbers in sequence down to the blessed day of gifts and consumerism? And what is the upper limit of this solution?
The second thing that dawned on me is that the upper counting range is limited by how many day values contain the same digits. 11, 22, 33, 44, etc. because each die must contain both numbers (or else that day value can’t be displayed). If our upper range is 44, that obviously won’t work because that only leaves two spaces (per die) for all other values.
Next I try 33 as an upper limit. That leaves three spaces per die. Four if we demand “00” for Christmas morning. That doesn’t work, either, because that leaves a total of four faces to display all these digits: 4, 5, 6/9, 7, 8.
I then make an intuitive leap and guess that the answer must be an upper limit of 30. This lets eager seasonal counters begin their countdown late in November. Perhaps even the day after Thanksgiving if they aren’t too busy shopping?
We know that only one die needs the “3” character. Both must contain: 2, 1 and 0. So what’s next? Since both dice contain 0, 1 and 2, the first digit is taken care of no matter what. And since we only need a 0 to go with the 3 that’s taken care of, too. It doesn’t matter which die has the “3.” We still need: 4, 5, 6/9, 7 and 8. Which is perfect since we have exactly five spaces left. And since those digits will only ever be used with 0, 1 or 2, it doesn’t matter where they are located since the other die can always provide the first digit.
I checked the dice and this is what I found.
Die #1: 0, 1, 2, 3, 4, 5
Die #2: 0, 1, 2, 6, 7, 8
It should be obvious by now that the upper limit is actually 32 days, too. We’ll just consider that a bonus.
So even though someone thought it was a good idea to start counting two months out, their efforts are doomed to fail on some days, at least using these dice. Mwuhahahaha!
Tip: Don’t want to resort to dirtying your hands on actual dice to keep track of this all-important data? Here is a web site that does it for you.
Geek Alert #3
Here’s a gift idea for the uber nerd in your life. Electronic dice. The image can be clicked to visit the actual shopping page if you want to order these.
Again if find myself asking the question: Oh Lord, why?! 🙂 Just because you can do a thing doesn’t mean you should.
Maybe it’s just me, but I prefer my bones to be the kind that can actually be rolled.