Tuesday, October 21, 2008

Probability: Dice, Coin Flips, and Life

The six-sided die is one of the simplest, commonest, yet most perplexing devices created by human hands. How does something so tiny defy all but the most general predictions? Just consider the fact that it inspires such awe in our society that there are laws surrounding their use. (I should probably mention that even teaching about dice is frowned-upon in our country; some textbooks only refer to dice as "random event generators" -- but we know what they really mean.) Instead of fearing the die, though, let's empower ourselves by working to understand it.

[Note: This post is pretty long, so for those with short attention spans, I'll summarize it for you right here.
  1. Probability is given as the number of desired outcomes, compared with the number of possible outcomes. The probability of rolling a 3 on a die is 1:6, since there is only one face on the die with the number 3 and there are six possible faces that can land up.
  2. Past random events do not influence future random events. Just because you rolled a 3 doesn't mean you will roll all the other numbers before you roll 3 again. You can easily roll two 3's in a row.
  3. Probability can be thought of as our confidence level that a particular event will occur. If you flip a coin four times, it is not guaranteed that the coin will land heads up twice. But you can be 50% confident that it will.
If you have trouble understanding any of these or want to explore them more then check them out in the corresponding Parts 1, 2, and 3 below.]

Part 1: One Die
A regular die has six faces -- all labeled a different number, 1 through 6 -- and the weight of the die is evenly distributed. (Even distribution of weight means that no single side is heavier than the others. If one side were significantly heavier, it would tend to land face down more often than the other faces; this is what we call a "loaded" die.) Casinos go to great lengths (ie they spend a lot of money) to buy dice in which the weight is perfectly distributed.

So, for a perfectly fair die, what are the odds that I roll a 6? And is it any different from the odds that I roll a 2?

The second answer is: No, the odds of rolling a 2 and a 6 are identical. The numbers on a die are simply markings that label the sides -- it would be the same as if they were labeled by letters or different colors. The number on each face has no bearing on the odds it will be rolled, since all of the faces are equally likely (remember that the weight was evenly distributed in the die).

At this point, we say confidently that the probability of rolling a 6 is the same as a 2 (is the same as a 1, as a 3, etc), but what exactly is the probability that I roll a 6?

The way that we calculate the probability of an event's occurrence (in this case, the probability of rolling a 6) is we consider the total number of possible results and compare it with the number of results that we want. Considering a die, as it rolls in our hand, there are six possible sides that we may roll; it may land on the 1, the 2, the 3, the 4, the 5, or the 6 -- s0 6 possible outcomes, all of which are equally likely. Now, we ask what is the probability I roll a 6? Well, there is only one desired outcome out of six possible ones, so we say that the probability is 1:6 (which is read as "one-to-six" or "one-out-of-six" and which may also be written as "1/6").

As a side note, randomly producing numbers is one thing that computers are very good at, and there are many sites on the web that have Java and Flash applications to roll dice. I like this one, since it allows you to choose the number of dice you want, and if you set Results to "Session," then it will record the results of each roll you do. (The "Auto-Roll" button gives the results for however many rolls you type in the box, and setting Results to "Historical" shows the results for every roll that has been done on the website.) You can go there to test out all the stuff we're talking about here or just pick up some real dice of your own.

For contrast, let's say that you and I are playing a game where we roll a die to see who goes first (ie whoever rolls the higher number). I start and roll a 3. You have to roll higher than 3 to get the first turn, which means rolling either 4, 5, or 6. In this case, those are 3 desired outcomes out of 6 possible outcomes (I'm assuming here that you want to go first...). So, we say that the probability is 3:6.

Another way to come to this conclusion is figuring which are the desired outcomes (4, 5, and 6) and adding up their regular, old probabilities. The probability of a 4 is 1/6; the probability of a 5 is 1/6; the probability of a 6 is (once again) 1/6. So, summing them up:
  • 1/6 + 1/6 + 1/6 = 3/6
And like the fractions that you're used to, 3/6 can be reduced to 1/2.

But what does a 1:2 probability mean? Or for that matter...

Part 2: What does a probability mean, in general?
Well, in a very technical sense, a probability simply gives you two pieces of information: the number desired outcomes and the number of total outcomes (...which is exactly what we said before). But that doesn't really tell us anything, does it? Consider this: The probability of rolling a 6 is 1:6. But I might roll a 4 twice before I roll the 6 that I'm waiting for. If both faces of the die were equally likely: does that defy the logic of our discussion? Shouldn't I have rolled 4 only once before the 6?

Not at all. You should make a mental note to yourself that past (random) events do not influence future (random) events. This is one of the hardest things to wrap your head around, and even the most brilliant mathematicians and scientists, poker players and craps shooters make mistakes all the time because they forget that simple rule. If we could use past throws to predict future ones, then you could figure out an easy system to win every time. Heck, the stock market would be a gold mine. What this all means is that the opening scene of Tom Stoppard's play "Rosencrantz and Guildenstern Are Dead" is perfectly possible (...however unlikely it may be).

In the scene, R. and G. are friends playing a game that they often do while out walking. Each is holding a bag of gold coins, and they bet Heads or Tails on coin flips, such that the winner of the bet keeps the coin that was just flipped. Rosencrantz has been betting only heads and has won 92 flips in a row, as they step onto the stage. They have played this game many times before, and it has always been about even. So, how is this possible? Guildenstern wonders aloud all the conceivable reasons why this would be happening:
Guil: It must be indicative of something, besides the redistribution of wealth. (He muses.) List of possible explanations. One: I'm willing it. Inside where nothing shows, I am the essence of a man spinning double headed coins, and betting against himself in a private atonement for an unremembered past. (He spins a coin at Ros.)

Ros: Heads.

Guil: Two: time has stopped dead, and the single experience of one coin being spun once has been repeated ninety times... (He flips a coin, looks at it, tosses it to Ros.) On the whole, doubtful. Three: divine intervention, that is to say, a good turn from above concerning him, cf. children of Israel, or retribution from above concerning me, cf. Lot's wife. Four: a spectacular vindication of the principle that each individual coin spun individually (he spins one) is as likely to come down heads as tails and therefore should cause no surprise each individual time it does.
We live in a universe of infinite possibilities -- and few of those possibilities are more likely than any others. Shortly after this mini-speech, G. goes on to observe: "The scientific approach to the examination of phenomena is a defense against the pure emotion of fear." In this case, phenomena refers to the unlikely number of heads -- the possibility of the improbable -- but there is a more general truth to what he is saying: Random events -- events that happen without any good reason at all -- scare us, as fragile human beings, and scientific or mathematical analysis is our way to face that fear, if not to conquer it. But I digress...

Part 3: Coin Flips
Flipping coins is even simpler than rolling dice, since there are only two possible outcomes. The probability the coin landing on heads is 1:2 and on tails is (surprise!) 1:2. Does this mean that a coin will land on each side 50% of the time?
  1. On the first throw, a coin lands on heads. At that point, the coin has landed heads 100% of the time. If we stopped now. That would be our final tally... far off from our prediction of 50% of the time.
  2. The second throw is heads again. Still 100%.
  3. A third throw lands tails. This now means that we have landed heads 66% of the time (getting closer to 50%!) and on tails 33%.
  4. A fourth toss lands heads, so now we have had heads 75% of the time.
Never once during this brief examination did we find that heads or tails had a 50% occurrence. The only way that you could get that result is if the coin could somehow land as both heads and tails (imagine something like the coin landing on its side) each throw. Since, however, the coin must land on either one side or the other (ie it is forced to be entirely in one of the two possible categories and not somehow both), we can think of a probability as our level of confidence that a particular event will happen. I can only ever be 50% confident that the coin will land heads; I can never believe that one side is more likely than the other to land face up.

Where we see to so 50% start to emerge again is not after a few flips, but when the number of coin flips grows larger and larger. Remember that dice rolling website I pointed out earlier? Well, there's a coin flipping page too. Set Results to Historical and take a look.

At this time I'm writing this, there had been 2,412,539,104 coin flips ever done on that page; 1,206,193,471 of them were Heads. That means Tails landed up over 152,000 times more often. (152,000 times that Guildenstern should have been winning!). But, overall, Heads won 49.99% of the time.

As the number of coin flips approaches infinity (which we will talk about later, I'm sure) the percentage of heads approaches 50% (See how close it was after 2 billion flips?). Likewise, with a 6-sided die, as the number of rolls approaches infinity, the number of 3's that you roll approaches 1/6 (which equals 16.67%).

Get it?

No comments: