Monday, November 13, 2006

Of Dice and Mooncakes (An Addendum)

I just realized something.

Does anyone remember the post I had about a month ago, where I discussed the Mooncake Dice Game? If so, you'll remember that I noted a particularly rare result with an interesting prize pot:

As with most dice games, this one also maintains the concept of an "ultimate throw" -- in other words, the best configuration possible. This is composed of either six fours, or six ones:



If you somehow manage to throw this configuration on your Mooncake festival dice, you get all the prizes in the game.

A few minutes after putting up the blog entry, I posited the scenario to a couple of the Mensa Philippines mailing lists. Afterwards, I asked a couple of questions that had been floating around my head for some time:

1. Given a single throw, what is the chance that it will come up as any of these two "ultimate" configurations?

2. As rare as these configurations may be, they're bound to come up sooner or later. How many throws will I most likely have to make before I can expect any of the two "ultimate" configurations to come up?

Yes, this is going to be a mathematical post. I only ask that you bear with me on this; I'm extremely prone to such eccentricities.

To probability freaks, the answer to the first question is actually pretty obvious. With six six-sided dice, one throw will get you any one result out of 66 (i.e. 6 raised to the 6th power, or 46,656) different combinations. Your chances of getting any of the two "ultimate" throws are therefore 2 in 46,656... or 1 in 23,328. Assuming that one gets around 50 such throws each year, this means that you'll need over four centuries before you can guarantee having thrown any of the given combinations at least once.

The second question, on the other hand, is quite a different story. Instead of asking you what you're likely to get in a single throw of the dice, it asks you to forecast the likelihood of throwing any of the two specific combinations. It's different from the first question in that it asks for a reasonable chance: Four centuries may enable me to guarantee being able to throw any of the two combinations, but I'm not asking for a guarantee here. Anything slightly greater than, say, a 50% chance will do.

Based on the responses I received from a Mensa Philippines-affiliated mailing list (okay, one response), the original assumption was that you'd only need half the total throwing opportunities of the first scenario. That is to say, you'd need 1/2 of 23,328 = 11,664 throws, which would still make for a good 200+ years.

At this point, however, I'm not quite so sure about that answer. The reason for this is because I've recently referenced an old math problem that goes as follows:

Let's say that you have a number of people gathered in a single room. You bet someone that at least two people in the room share the same birthday. How many people would you need to have in the room so that you have greater than a 50% chance of winning your bet?

The really interesting part here is that you'd only need a minimum of 23 people in the room to make for a good bet. (This doesn't consider leap years, mind you, but even with those in mind, the numbers should still fall around this figure.)

Why only 23 people? Because the probability calculations for this problem follow a choice pattern, you see. To start with, we must consider that the chances of finding two or more people with the same birthday (N) is equivalent to 100% minus the chances of everyone having different birthdays (Nnot):

N = 1 - Nnot

To illustrate this, let's say that there are only two people in the room: You, and somebody else. The chances of your acquaintance having the same birthday as you is obviously 1 out of 365. (It'll only happen if his birthday occurs on one day out of the 365 possibilities, that is.)

N = 1/365

On the other hand, your acquaintance doesn't have the same birthday as you if he was born on any of the other 364 days of the year. That is to say, the chances of you not sharing the same birthday is obviously 364 out of 365.

Nnot = 364/365

1/365 = 1 - 364/365

See how it fits neatly together in that latter equation?

What this means is that the chances of something occurring are obviously equivalent to 100% minus the chances of it not occurring. It doesn't take a genius to figure that one out, I suppose.

So now let's say that there are three people in the room: You, and two acquaintances. The chances of your first acquaintance not sharing the same birthday as you is 364/365. But the chances of your second acquaintance not sharing the same birthday as either of you is 363/365, as his birthday should be on a date other than yours or the first guy's.

This means that, for three people in the room:

N = 1 - Nnot
N = 1 - (364/365)x(363/365)

N = 1 - (0.99726)x(0.99452)

N = 1 - 0.9918
N = 0.0082


And the chances of any of you three sharing the same birthday is 0.0082, or less than one percent.

But if we extend this, we find that for 23 people, the calculations go as follows:

N = 1 - Nnot
N = 1 - (364/365)x(363/365)x(362/365)x...x(343/365)
...
N = 0.5073

And thus having 23 people in a room gives you better than a 50% chance of finding two or more of them with the same birthday. That's an odd development there.

By now, you're probably wondering what all this has to do with the Mooncake Dice Game. (Or you're probably asleep. In any case, I don't have much farther to go.)

Hypothetically, the Mooncake Dice Game can use a similar formula in answering its second question. We can, for example, note that the chances of throwing any of the "ultimate" combinations is simply 100% minus the chances of not throwing any of them at all:

N = 1 - Nnot
2/46656 = 1 - 46654/46656

Let's suppose that you have two throws, then. Your chances of getting any of the "ultimate" combinations at least once is therefore equivalent to 100% minus your chances of not getting any of them at all:

N = 1 - Nnot
N = 1 - (46654/46656)*(46654/46656)
N = 1 - 0.999914268
N = 0.000085732

We can extend this formula for any number of throws, I suppose. For every K times you throw the dice, your chances of getting any of the ultimate combinations should therefore be:

N = 1 - Nnot
N = 1 - (46654/46656)K

And with this in mind, we'd just need to find the smallest number K that would give us an N that is greater than 50%.

It is at this point that my computer breaks down with regards to the calculation. If my creative bookkeeping is correct, however, than K should be somewhere around 2,356 throws, give or take a few rolls. That's a far cry from the original estimate of 11,664 attempts.

What that also means is that, assuming that every game is comprised of 20 family members, each of whom makes about 20 throws each year, then we should see the combinations come up, say, every once in six years. And I don't know about you, but I think that that definitely accounts for the modern frequency of these occurrences. More experienced mathematicians and Mooncake Dice players are welcome to dispute the veracity of these hypotheses, though.

And now, it's time for me to give the matter a rest. The only thing that this entire exercise has brought me, after all, is yet another good-sized headache.

2 comments:

Der Fuhrer said...

err..not related to the entry..are you going to he PSF vol. 2 book launch?

Sean said...

Der Fuhrer: Let's see... it's on December 10, and...

Wait a minute... December 10? Argh... I'm attending a good friend's wedding on the exact same date. I'll be in Quezon City for about the entire afternoon and a good chunk of the evening, unfortunately.

On the other hand, that would probably be good news for everyone else who's going. They won't have to tolerate my otherwise unbearable presence on that date. :)