Dear Dr. Math,
How many possible NCAA basketball tournament brackets are there? If I just guessed randomly, what are the odds I'd get it exactly right?
BYOBasketball
Ah yes. I love March Madness for many reasons:
1) the wide assortment of team names and mascots,
2) Dick Vitale, and
3) it's the one time of the year when people care about the number 2^63, because that's the number of possible ways of filling out a tournament bracket prediction.
Even then-future-President Barack Obama couldn't resist giving it a try! Let's see how it works, baby!
To begin with, the NCAA officials select 64 teams to play in the tournament (actually 65--there's a traditional preliminary game to determine the last team in the field, but we'll ignore that). They divide the teams up into 4 groups of 16 and then rank the teams within each group, from 1 to 16. Each group holds a single elimination tournament, with the high-ranking teams pairing off initially against the low-ranking teams, and the 4 winners (the Final Four) go on to play two more games to determine the national champion. At some point, the players cut down the nets with scissors for some reason. Predicting the way the entire tournament will unfold (that is, the "bracket") has become a popular office tradition; legend has it that no one has ever predicted the entire bracket exactly right, although some websites like Yahoo! have offered prizes of up to $1 million if anyone does it. But if they charged even a penny to play, I wouldn't take that bet. Here's why:
Each game played has 2 possibilities for a winner. Considering just the first round of games, of which there are 32, this means the number of possible ways of predicting the winners is 2^32, or 4,294,967,296. Assuming you had guessed the first round correctly, there would now be 16 games to determine the winner of, so the number of possible predictions for the second round would be 2^16 = 65,536. And so on. In the third round, there would be 2^8 = 256 possibilities; in the fourth round, 2^4 = 16; in the fifth round, 2^2 = 4, and in the final game, you'd still have to guess which of the 2 remaining teams would be the champion.
Altogether then, the number of possible ways to fill out a bracket is 2^32 * 2^16 * 2^8 * 2^4 * 2^2 * 2 = 2^(32+16+8+4+2+1) = 2^63. Another way to arrive at this number is to consider the fact that in total, 63 of the 64 teams have to lose a game over the course of the tournament, meaning there are 63 total games played. So, by the same reasoning as before, the number of outcomes of these games is 2^63 = 9,223,372,036,854,775,808, about 9.2 * 10^18. In words, that's 9.2 quintillion, a.k.a. 9.2 million trillion.
How big is that number?
Well, if you were to write out each bracket prediction on a sheet of standard paper (thickness = .1mm), you would have a stack of paper (9.2 * 10^18 * .1 * .001) = 9.2 * 10^14 meters tall, which is about 6200 times farther than the distance from the Earth to the Sun. If you stole 1 paperclip (mass approx. 1 gram) for each sheet, you'd end up with 9.2 * 10^18 * 1 * .001 = 9.2 * 10^14 kilograms of paperclips, which is the equivalent weight of 46 billion blue whales. Every person on Earth could have 7 blue whales' worth of paperclips. If, instead of working, you filled out 1 bracket per second, 24 hours a day, it would take you (9.2 * 10^18)/(60*60*24*365) = 29 million years. You'd be so busy filling out brackets that you wouldn't even notice that the tournament had ended millions of years ago, along with all of human civilization! (Probably.)
Now, does that mean your odds of picking a perfect bracket are 9.2 quintillion-to-1? Hold on just a second there, shooter. That would only be correct if you were assuming that all possible brackets were equally likely to occur. However, with a little thought, we can probably improve on that assumption considerably. For example, in the 24 years since the tournament was expanded to include 64 teams, a #1 ranked team has never lost in the first round to a #16 seed. So, even if we take the ranking as the only meaningful predictor, we can say that some brackets, namely those in which the high-ranked teams always win, are more likely than others.
Using data I found on www.hoopstournament.net, I was able to estimate the probabilities of the higher-ranked team winning each game in the tournament based on the results of past years (remind me sometime to talk about estimating bias, will you?), and my guess at the probability of the "no upsets" bracket is 1.64 * 10^-11, so the odds against the occurrence of this bracket are "only" 1.64*10^11 = 164 billion-to-1. Since we're assuming that it's always more likely for the higher ranked team to win any given game, this bracket is our best hope. Those odds are still pretty long, though. For comparison, let's say your ATM code were reset to a random 4 digit number; you'd be about as likely to win the bracket challenge as you would be to win the Powerball and then guess the new PIN on the first try (presumably to deposit your winnings).
Many of you sports fans out there are no doubt hurling expletives at the screen right about now, because, as you know, there are always some upsets. I mean, who could forget Coppin State over South Carolina in 1997, right? There's a bit of an odd paradox here: even though the "no upsets" tournament prediction is the most likely (based on our assumptions), the number of upsets is more likely to be greater than 0 than otherwise. In fact, the most likely number of upsets over the course of the tournament, according to my predictions, is about 18. (Note: I'm including "upsets" like the #9 seed beating the #8 seed--an event that has happened about as often as it hasn't over the years.)
So, the most likely scenario is that there are no upsets, and yet the most likely number of upsets is 18. How can both statements be true? The answer lies in the fact that we're not being asked to predict just the number of upsets, but the actual sequence of events:
Consider the simpler example of rolling a 6-sided die. Let's assume all faces are equally likely, but let's say we really don't want any sixes, and that's all we care about. We'll label the six-side as "L" and the other 5 sides as "W." So, the chance of winning any particular roll is 5/6. Not bad. Now let's imagine rolling this die 60 times. Since the most likely occurrence in each roll is that we'll win, the most likely sequence of 60 rolls is a sequence of 60 wins, with probability (5/6)^60, about 1.77 * 10^-5, roughly 1 in 57,000. If we put a loss in the sequence in any location (first, second, third, etc.), the probability would go down to (5/6)^59 * (1/6) = 3.54 * 10^-6, which is 5 times less likely. However, according to basic probability, the number of losses would follow what's called a binomial distribution, which has its peak (the most likely number) at the value equal to the number of rolls times the probability of losing each one. In our setup, that's 60*(1/6) = 10. If we repeated this experiment a bunch of times, the most common result would be that we'd lose 10 times out of 60.
What's going on here is that although the chance of any particular sequence of dice-rolls containing a loss is less than the perfect "all wins" sequence, there are so many more possible sequences with a loss--in fact, there are 60, versus only the 1 perfect sequence--that their probabilities accumulate to make the chance of having a loss somewhere greater than not having one anywhere. And continuing in this manner, you can see that the number of sequences containing 2 losses is even greater, despite the fact that each one is even less likely, and so on. Eventually, the two effects balance each other and the combined probability maxes out at 10 losses.
But that's not what we're being asked to predict! In order to win Yahoo!'s bracket tournament or just your office's measly little pool with a perfect bracket, you'd have to predict the precise sequence of wins and losses. People resist picking the most likely bracket because it doesn't "look random enough,"* but really they're just reducing their chances by several orders of magnitude.
In a related experiment, if a person is presented with a flashing light that can be either red or green but is red twice as often, and the subject is asked to predict the color of the next flash, most people will "mix it up," mostly guessing red but occasionally guessing green, because they feel that their predictions need to match the "pattern" of occasionally being green. They're correct to think that it's likely that the light will sometimes be green; their mistake is assuming that they can improve their odds by guessing any particular realization of that notion. As a result, they generally do worse in the experiment than lab rats, who will, reasonably enough, just keep betting on red and winning 2/3 of the time.
And that's why I'm going with the rat strategy: Louisville, Connecticut, Pittsburgh, and North Carolina in the Final Four, baby!**
-DrM
*Or perhaps they feel that they have more information about a given game than the rankings would indicate. For example, a star player could have been recently injured, or a particular team's playing style might be well-suited to beating an otherwise better team. That being said, I think it's more common for people to just pick the teams they want to win and find some way to justify that prediction.
**Personal note: Once, as a nerdy kid who knew nothing about basketball, I employed this strategy in a middle school bracket challenge, picking all four #1 seeds to advance. And as it happened, I got 3 out of 4 right, more than any of my classmates, because they were all clinging to their inferior human-brained approaches. Take that, millions of years of evolution!
Showing posts with label how big is that number. Show all posts
Showing posts with label how big is that number. Show all posts
Tuesday, March 17, 2009
Monday, February 23, 2009
The Infinite Monkey Strikes Back
I've gotten some very interesting responses to my post about the Infinite Monkey Theorem, concerning the likelihood of a monkey accidentally reproducing The Hobbit by randomly generating letters. So I thought I'd write a follow-up to address some of them; also it gives me another chance to imagine a monkey typing on a typewriter. (I tried letting a monkey type this up for me, but he wrote something much more interesting than I had planned.)
Dear Dr. Math,
I believe the monkey problem makes the simplifying assumption that all the letters in the text are independent, which they're not in real English (or any other language). How does this affect the results? Real texts are sampled very narrowly from the space of possible letter sequences.
CN
Excellent question, CN; I'm glad you brought it up. In fact, the distribution of the letters in the text is irrelevant to the problem. The important assumption is that the letters being output by the monkey are equally likely and probabilistically independent of each other. Under this assumption, it doesn't matter if the text the monkey's trying to match is The Hobbit or the phone book or a sequence of all "7"s--the probability of matching any sequence of 360,000 characters will be
. If you need convincing, consider the simpler example of flipping a fair coin 5 times. Any particular sequence of 5 flips, for example HHTHT, has the same probability,
, of coming up. So, if we were trying to match any flip sequence, we'd have the same chance. The same is true here, just on a much larger scale (and with monkeys).
Now, many people object to this idea, because they think that a letter sequence like "a;4atg 9hviidp" is somehow more "random" than a sequence like "i heart hanson". Therefore, they reason, the first sequence would be more likely to occur by chance. But actually the two sequences have exactly the same probability of occurrence, under our assumptions. Really, the only difference between the two is what we could infer about the message source (beyond musical tastes) based on receiving such an output. I hope to discuss this in detail someday in the context of elementary hypothesis testing, but if, say, there were some doubt in our minds as to whether the source of these characters was, in fact, uniformly random, the latter message would give us considerable evidence to help support that doubt. The reason is that we could provide an alternative hypothesis that would make the observed data much more likely. For the monkey problem, however, we were assuming that we knew how the characters were being generated, so there's no doubt.
Dear Dr. Math,
Along the lines of your previous questions on large numbers and randomly generating the book The Hobbit, I'd like to ask about randomly generating images. A low res PC display is normally 640 x 480 pixels. If you randomly generated every combination of color pixels, wouldn't you have created every image imaginable at that resolution? That is, one of the screens would be the Mona Lisa, one would be your Ask Doctor Math page, one would be a picture of the Andromeda galaxy from close up, one would be a picture of you!, etc. If you only wanted to look at black & white images, you'd have a much smaller collection, but once again wouldn't you generate every B&W screen image possible?
Therefore, our previous strategy of multiplying probabilities, which rested on the assumption of independence, won't work here. In order to explain how long it would take the monkey to produce The Hobbit with high probability under your scheme, I'd have to go into some fairly heavy-duty math involving Markov chains and their transition probabilities. The relevant probabilities can be found by raising a 360,000 x 360,000 matrix to the nth power--not generally an easy thing to do. But it turns out that the expected (i.e., average) number of characters the monkey would have to type before finishing would still be on the order of
, similar to the the previous setup.
Either way, you and J.R.R. would have probably given up by that point.
-DrM
Dear Dr. Math,
I believe the monkey problem makes the simplifying assumption that all the letters in the text are independent, which they're not in real English (or any other language). How does this affect the results? Real texts are sampled very narrowly from the space of possible letter sequences.
CN
Excellent question, CN; I'm glad you brought it up. In fact, the distribution of the letters in the text is irrelevant to the problem. The important assumption is that the letters being output by the monkey are equally likely and probabilistically independent of each other. Under this assumption, it doesn't matter if the text the monkey's trying to match is The Hobbit or the phone book or a sequence of all "7"s--the probability of matching any sequence of 360,000 characters will be
Now, many people object to this idea, because they think that a letter sequence like "a;4atg 9hviidp" is somehow more "random" than a sequence like "i heart hanson". Therefore, they reason, the first sequence would be more likely to occur by chance. But actually the two sequences have exactly the same probability of occurrence, under our assumptions. Really, the only difference between the two is what we could infer about the message source (beyond musical tastes) based on receiving such an output. I hope to discuss this in detail someday in the context of elementary hypothesis testing, but if, say, there were some doubt in our minds as to whether the source of these characters was, in fact, uniformly random, the latter message would give us considerable evidence to help support that doubt. The reason is that we could provide an alternative hypothesis that would make the observed data much more likely. For the monkey problem, however, we were assuming that we knew how the characters were being generated, so there's no doubt.
Dear Dr. Math,
Along the lines of your previous questions on large numbers and randomly generating the book The Hobbit, I'd like to ask about randomly generating images. A low res PC display is normally 640 x 480 pixels. If you randomly generated every combination of color pixels, wouldn't you have created every image imaginable at that resolution? That is, one of the screens would be the Mona Lisa, one would be your Ask Doctor Math page, one would be a picture of the Andromeda galaxy from close up, one would be a picture of you!, etc. If you only wanted to look at black & white images, you'd have a much smaller collection, but once again wouldn't you generate every B&W screen image possible?
With feature recognition software getting better all the time, one could "mine" these images for recognizable features. Similar to the way the pharmaceutical companies sequence through millions of plants to find new substances, one could sequence through these images to extract unknown info.
Mike
Dear Mike,
Absolutely, we could apply the same techniques to any form of information that can be reduced to a sequence of numbers or letters, like images, CDs, chess games, DNA sequences, etc. In fact, we needn't generate them randomly, either. As in The Library of Babel example, one could imagine a vast collection of all possible sequences, generated systematically one at a time with no repeats. Unfortunately, for any interesting form of information, the number of possibilities is simply too great to make it practical.
In your example of 640x480 pixel images, even assuming the images were 1-bit monochrome, there would still be 2 possibilities ("on" or "off") for each of the 640*480 = 307,200 pixels. Therefore, the number of possible images would be
, which is about
. Remember how big a googol is? Well, this number is about
. So, not even all the crappy low-res monitors in the universe could possibly display them, even at their lousy maximum refresh rate of 60 images/second. And even worse, we'd have no reason to believe any of the images we did see, because they'd be indistinguishable from all the many other conflicting images.
Your comparison to pharmaceutical companies is interesting, but remember those companies are starting with a large (but manageable) collection of plants that actually exist, not searching through the space of all possible arrangements of plant cells or something. It's OK to search for a needle in a haystack sometimes, but not when the haystack is larger than the known universe.
Dear Dr. Math,
Unless I misunderstand (and that's quite possible), I think you've introduced a major flaw here... The "second chunk" begins at character number 2, not character number 360,001. There is no reason why these should be considered discrete chunks and so just because the first character isn't "I" doesn't affect the fact that the second and subsequent characters may spell out the work. Thusly, your monkeys are producing over 17 million "blocks" a day, not just 48...
A. Nonymous
Well, A, that all depends on how we set up our assumptions. The way I had pictured things, the monkey was typing out a whole manuscript of 360,000 characters at a time and then having someone (perhaps J.R.R. Tolkien himself!) check it over and see if it was exactly the same as The Hobbit. If not, the monkey tries again and, with very high probability, fails.
However, your idea is more interesting and perhaps more "realistic". That is, we could have Prof. Tolkien just watch over the monkey's shoulder as it typed and see if any string of 360,000 consecutive characters were The Hobbit. So, if the monkey started by typing a preamble of gibberish and then typed the correct text in its entirety, we'd still count it as correct. As you say, this means that the possible "chunks" we'd need to consider have a lot of overlap to them--we might find the text in characters 1 through 360,000 or 2 through 360,001, etc. But unfortunately, it's not just the number of chunks being produced we need to reconsider; because of the way they overlap, we've now introduced relationships between the chunks that mean our assumption of independence no longer holds. For example, if we knew the first block of characters was incorrect, we could determine whether it was even possible for the second block to be correct based on the particular way the first block was wrong. In fact, we'd know it was impossible unless the first block was something like "xin a hole in the ground there lived a hobbit...".
Actually, if we thought about things in this way, then CN's question above would be relevant, because the codependency of the overlapping chunks would depend heavily on the particular text we were trying to match. Consider the example of coin-flipping again: assume we were flipping the coin until we got the string TH. There are 3 possible ways we could fail on the first pair of flips, all equally likely: TT, HT, and HH. If we got TT or HT, then we could succeed on the third try by flipping an H. If we started with HH, there's no way we could get TH on the third flip. The number of ways of succeeding would be 2, out of a possible 6. So the probability of succeeding in the second block given that we failed in the first would be
.
Now, if we were trying to match HH and we knew we failed on the first 2 flips, there would still be 3 equally likely possibilities. Either we flipped TT, TH, or HT. If we started off with TT or HT, we can't possibly win on the third flip. But if we got TH first, we'd have a
chance of flipping H on the third flip and matching. Thus, our probability of matching in the second block given that we failed in the first would only be
. Here's a chart showing all of the possibilities:

Mike
Dear Mike,
Absolutely, we could apply the same techniques to any form of information that can be reduced to a sequence of numbers or letters, like images, CDs, chess games, DNA sequences, etc. In fact, we needn't generate them randomly, either. As in The Library of Babel example, one could imagine a vast collection of all possible sequences, generated systematically one at a time with no repeats. Unfortunately, for any interesting form of information, the number of possibilities is simply too great to make it practical.
In your example of 640x480 pixel images, even assuming the images were 1-bit monochrome, there would still be 2 possibilities ("on" or "off") for each of the 640*480 = 307,200 pixels. Therefore, the number of possible images would be
Your comparison to pharmaceutical companies is interesting, but remember those companies are starting with a large (but manageable) collection of plants that actually exist, not searching through the space of all possible arrangements of plant cells or something. It's OK to search for a needle in a haystack sometimes, but not when the haystack is larger than the known universe.
Dear Dr. Math,
Unless I misunderstand (and that's quite possible), I think you've introduced a major flaw here... The "second chunk" begins at character number 2, not character number 360,001. There is no reason why these should be considered discrete chunks and so just because the first character isn't "I" doesn't affect the fact that the second and subsequent characters may spell out the work. Thusly, your monkeys are producing over 17 million "blocks" a day, not just 48...
A. Nonymous
Well, A, that all depends on how we set up our assumptions. The way I had pictured things, the monkey was typing out a whole manuscript of 360,000 characters at a time and then having someone (perhaps J.R.R. Tolkien himself!) check it over and see if it was exactly the same as The Hobbit. If not, the monkey tries again and, with very high probability, fails.
However, your idea is more interesting and perhaps more "realistic". That is, we could have Prof. Tolkien just watch over the monkey's shoulder as it typed and see if any string of 360,000 consecutive characters were The Hobbit. So, if the monkey started by typing a preamble of gibberish and then typed the correct text in its entirety, we'd still count it as correct. As you say, this means that the possible "chunks" we'd need to consider have a lot of overlap to them--we might find the text in characters 1 through 360,000 or 2 through 360,001, etc. But unfortunately, it's not just the number of chunks being produced we need to reconsider; because of the way they overlap, we've now introduced relationships between the chunks that mean our assumption of independence no longer holds. For example, if we knew the first block of characters was incorrect, we could determine whether it was even possible for the second block to be correct based on the particular way the first block was wrong. In fact, we'd know it was impossible unless the first block was something like "xin a hole in the ground there lived a hobbit...".
Actually, if we thought about things in this way, then CN's question above would be relevant, because the codependency of the overlapping chunks would depend heavily on the particular text we were trying to match. Consider the example of coin-flipping again: assume we were flipping the coin until we got the string TH. There are 3 possible ways we could fail on the first pair of flips, all equally likely: TT, HT, and HH. If we got TT or HT, then we could succeed on the third try by flipping an H. If we started with HH, there's no way we could get TH on the third flip. The number of ways of succeeding would be 2, out of a possible 6. So the probability of succeeding in the second block given that we failed in the first would be
Now, if we were trying to match HH and we knew we failed on the first 2 flips, there would still be 3 equally likely possibilities. Either we flipped TT, TH, or HT. If we started off with TT or HT, we can't possibly win on the third flip. But if we got TH first, we'd have a
The two probabilities are different because TH can overlap in more ways with the wrong texts, whereas HH can only overlap with TH.
Therefore, our previous strategy of multiplying probabilities, which rested on the assumption of independence, won't work here. In order to explain how long it would take the monkey to produce The Hobbit with high probability under your scheme, I'd have to go into some fairly heavy-duty math involving Markov chains and their transition probabilities. The relevant probabilities can be found by raising a 360,000 x 360,000 matrix to the nth power--not generally an easy thing to do. But it turns out that the expected (i.e., average) number of characters the monkey would have to type before finishing would still be on the order of
Either way, you and J.R.R. would have probably given up by that point.
-DrM
Tuesday, February 17, 2009
How Big is That Number? Episode 1
This will be the first installment of a new feature I call "How Big is That Number?" in which I try to explain exactly how big that number is.
Dear Dr. Math,
How much space would a googol grains of sand take up?
xoxo,
Frequent Googol Searcher
Dear FreGooSear,
Let me begin by thanking you for reminding us all of the correct spelling of "googol". A lot of people forget that before it inspired the name of an obscure website, the word "googol", as coined by a man named Milton Sirotta back in 1938, referred to the number
. I don't know the whole story here, but I'm guessing that as an infant, he somehow wrote a 1 followed by 100 zeroes (I'm guessing in blue crayon), and when asked by his parents what that was, all he could make were baby sounds. Hence the name. Any other explanation seems highly improbable.
So, how big is this number with the silly name? Well, first off, if we wanted to address it in the nomenclature of billions and trillions, it would be known as ten thousand trillion trillion trillion trillion trillion trillion trillion trillion. That's a ten-thousand followed by 8 trillions. Or, if you prefer to think of it in terms of current financial events, $1 googol would be about 12,706 trillion trillion trillion trillion trillion trillion trillion economic stimulus packages.
Now, to answer your question about grains of sand: let's approximate a grain of sand as a cube 1 millimeter across. That would mean that 1000 grains of sand in a row would be 1 meter long. So, one cubic meter would contain 1000*1000*1000, or
, grains. A googol grains, therefore, would take up
cubic meters of space. And it would really be "space", because this is way bigger than our tiny little planet could accommodate. For comparison, a sphere the size of the Earth (which has a radius of about 6,371 kilometers, or 6,371,000 meters) has, according to the formula for the volume of a sphere, a volume equal to
cubic meters, about
grains of sand, so it would take about
Earth-sized balls of sand to get a googol grains. Alternatively, if you lumped all the sand together into one giant ball, you'd need
cubic meters, and solving for R gives us a radius of approximately
meters, which is about 140 trillion light years, or 10,000 times bigger than the size of the observable universe. So maybe space itself wouldn't even be big enough to handle such a massive sand ball.
Carrying the sand idea a little further, imagine there was a huge interstellar alien for whom the Earth appeared to be as small as a grain of sand is to us. Now, suppose this being lived on a giant planet, the planet Gigantica, as big, relative to the alien, as the Earth is to us. This would imply that the volume of Gigantica was in proportion to the Earth as the Earth is to a grain of sand, about
times as big; so Gigantica itself would be about
cubic meters in volume. If, in turn, there were a still larger alien for whom Gigantica looked like a grain of sand and who lived on an even larger planet, the planet Humonga, say, then Humonga would have to be
times as big as Gigantica, for a volume of
cubic meters. Now, if yet an even larger alien, from the planet Ginormica, looked down on Humonga as a tiny grain of sand, it would require
Humonga-balls to comprise a volume of
cubic meters, which you'll recall was the volume of space taken up by a googol grains of our puny Earth-sand. Back here on Earth,
grains of sand is 10 cubic meters, about the volume of a nice 10 meter by 10 meter patch of beach (assuming a depth of 10 centimeters). So on Ginormica, this giant giant giant alien could kick back in a beach chair, sip a giant giant giant beer and build a giant giant giant sand castle out of those googol grains with plenty of sand left over to get in its megashoes.
-DrM
Dear Dr. Math,
How much space would a googol grains of sand take up?
xoxo,
Frequent Googol Searcher
Dear FreGooSear,
Let me begin by thanking you for reminding us all of the correct spelling of "googol". A lot of people forget that before it inspired the name of an obscure website, the word "googol", as coined by a man named Milton Sirotta back in 1938, referred to the number
So, how big is this number with the silly name? Well, first off, if we wanted to address it in the nomenclature of billions and trillions, it would be known as ten thousand trillion trillion trillion trillion trillion trillion trillion trillion. That's a ten-thousand followed by 8 trillions. Or, if you prefer to think of it in terms of current financial events, $1 googol would be about 12,706 trillion trillion trillion trillion trillion trillion trillion economic stimulus packages.
Now, to answer your question about grains of sand: let's approximate a grain of sand as a cube 1 millimeter across. That would mean that 1000 grains of sand in a row would be 1 meter long. So, one cubic meter would contain 1000*1000*1000, or
Carrying the sand idea a little further, imagine there was a huge interstellar alien for whom the Earth appeared to be as small as a grain of sand is to us. Now, suppose this being lived on a giant planet, the planet Gigantica, as big, relative to the alien, as the Earth is to us. This would imply that the volume of Gigantica was in proportion to the Earth as the Earth is to a grain of sand, about
-DrM
Labels:
googol,
how big is that number,
humonga-balls,
megashoes
Friday, February 13, 2009
Unexpected Values, part 2
Dear Dr. Math,
Is it ever a good idea to play the lottery? My dad says he only buys a ticket when the jackpot is bigger than the odds against winning, but we're still broke.
Angelica
Dear Angelica,
NO!!
-DrM
P.S.--Here's why:
Hopefully, by now you've read my previous post all about expected values. (If not, go read it now; I'll wait here. OK? OK.) Now, the thing your dad is referring to is the fact, which is a fact, that the expected value of the lottery is occasionally greater than $1, the cost of the ticket. Assuming you play the Powerball, which is the most popular lottery in the U.S., your odds of winning the jackpot are 1 in 195,249,054. (If you'd like, I'll show you how to compute that sometime.) So, considering only the jackpot, if the payoff is higher than $195,249,054, the expected value of the lottery, i.e., the jackpot times the probability of winning, would actually be greater than the cost, so it would seem that math is telling us to play. However, this is still not a convincing argument, even putting aside other practical concerns involved in winning the lottery.*
The reason comes back to the idea of variance, which I also talked about last time. Just so you can follow along at home, the variance of a simple game like this is computed like so: you take the payoff squared times the probability of winning and subtract the expected value squared. So let's say, for example, that the jackpot was $200 million one week. Then the expected value would be the probability of winning times the jackpot, which is
, about $1.02. The variance, therefore, is
. Mamma mia! That's a lot of variance!
If you remember from last time, the problem with having too high a variance in a bet is that you typically run out of money before you get to win--the distribution of your winnings/losses is too spread out. So, in effect, if you had unlimited funds (which I know for a fact you don't, Angelica) and you could play the lottery with the same odds every week for several billion years, it might actually be a good investment, because on average you would win back $1.02 for every $1 you gambled, a nice healthy 2% return. However, since you're only going to play it at most a few hundred more times (and hopefully no more after today!), the variance is just too high for you to handle. It's kind of a paradox, really, that the decision to place a particular bet once depends on your ability/plans to bet many times. What we see here is an interesting example of the tradeoff between expected value and variance. Sometimes, depending on your circumstances, it's worth sacrificing a little of one to improve the other. If someone offered you $0.99 for your $1 lottery ticket, for example, I'd recommend you sell, no matter how high the jackpot is.
Incidentally, in my opinion, this is how the banking industries and insurance industries make money (or, at least, used to back when they existed). Let's say you're deciding whether to insure your $100,000 house at a cost to you of $1,500. For argument's sake, let's say you have an extra $100,000 in savings that you could use to replace the house if need be, so the only cost is monetary. And let's assume that the chance of your house being completely destroyed is
; you know it, and the insurance company knows it. So, you're trading a bet (no insurance) with an expected loss of
but a fairly high variance for a sure-thing loss of $1,500 (if your house burns down, you don't lose anything except the time it takes to file an insurance claim and replace your stuff) and no variance at all. But the extra peace of mind is worth something to you, so maybe you're willing to pay the $500 premium for it. Meanwhile, the insurance company (and the bank that underwrites your policy) is buying millions of these bets, and so their distribution of income is turning into a bell curve, narrowing down pretty much to a fine point centered around a $500 profit per policy. VoilĂ , everyone wins, but they win more simply by virtue of already being large. (The problem occurs when they start taking that money and doubling down on risky investments, unless they get bail... oh wait, never mind.)
-DrM
*The diminishing marginal utility of money, the chance of having to split winnings with another person, the amount lost to income tax, and the failure to adjust for inflation, to name a few.
Is it ever a good idea to play the lottery? My dad says he only buys a ticket when the jackpot is bigger than the odds against winning, but we're still broke.
Angelica
Dear Angelica,
NO!!
-DrM
P.S.--Here's why:
Hopefully, by now you've read my previous post all about expected values. (If not, go read it now; I'll wait here. OK? OK.) Now, the thing your dad is referring to is the fact, which is a fact, that the expected value of the lottery is occasionally greater than $1, the cost of the ticket. Assuming you play the Powerball, which is the most popular lottery in the U.S., your odds of winning the jackpot are 1 in 195,249,054. (If you'd like, I'll show you how to compute that sometime.) So, considering only the jackpot, if the payoff is higher than $195,249,054, the expected value of the lottery, i.e., the jackpot times the probability of winning, would actually be greater than the cost, so it would seem that math is telling us to play. However, this is still not a convincing argument, even putting aside other practical concerns involved in winning the lottery.*
The reason comes back to the idea of variance, which I also talked about last time. Just so you can follow along at home, the variance of a simple game like this is computed like so: you take the payoff squared times the probability of winning and subtract the expected value squared. So let's say, for example, that the jackpot was $200 million one week. Then the expected value would be the probability of winning times the jackpot, which is
If you remember from last time, the problem with having too high a variance in a bet is that you typically run out of money before you get to win--the distribution of your winnings/losses is too spread out. So, in effect, if you had unlimited funds (which I know for a fact you don't, Angelica) and you could play the lottery with the same odds every week for several billion years, it might actually be a good investment, because on average you would win back $1.02 for every $1 you gambled, a nice healthy 2% return. However, since you're only going to play it at most a few hundred more times (and hopefully no more after today!), the variance is just too high for you to handle. It's kind of a paradox, really, that the decision to place a particular bet once depends on your ability/plans to bet many times. What we see here is an interesting example of the tradeoff between expected value and variance. Sometimes, depending on your circumstances, it's worth sacrificing a little of one to improve the other. If someone offered you $0.99 for your $1 lottery ticket, for example, I'd recommend you sell, no matter how high the jackpot is.
Incidentally, in my opinion, this is how the banking industries and insurance industries make money (or, at least, used to back when they existed). Let's say you're deciding whether to insure your $100,000 house at a cost to you of $1,500. For argument's sake, let's say you have an extra $100,000 in savings that you could use to replace the house if need be, so the only cost is monetary. And let's assume that the chance of your house being completely destroyed is
-DrM
*The diminishing marginal utility of money, the chance of having to split winnings with another person, the amount lost to income tax, and the failure to adjust for inflation, to name a few.
Labels:
expected value,
gambling,
how big is that number,
lottery,
probability
Wednesday, February 11, 2009
"in a hole in the grou31;aadn,m vnatoh424..."
Dear Dr. Math,
Suppose you have a computer randomly generating all the characters making up the text of The Hobbit. Suppose the computer generates 200 characters per second. Is there a time period after which it becomes probable that the computer has produced the text of The Hobbit? My gut tells me, "No, it would never happen."
Consider this. If a sufficiently powerful being wanted to write a 20,000 page history of tea-drinking, it could either
(a) produce the book
(b) produce all possible 20,000 page long sequences of keyboard characters
TolkienFan
Dear TolkienFan,
Your question is related to the famous Infinite Monkey Theorem, about a room full of monkeys randomly banging on typewriters for all eternity eventually producing the complete works of Shakespeare. (Digression #1: an English major I knew once joked that the monkeys could reproduce the complete works of D.H. Lawrence in a surprisingly short time.) It turns out that the answer is "yes" in some abstract sense, as long as we're careful about what we mean, but the amount of time it would take is far beyond our comprehension--many many orders of magnitude more than the estimated age of the universe. Here's a quick back-of-the-envelope calculation:
1.) Let's only consider the characters on a standard typewriter. Let's say there are 50 possible characters (including numbers and punctuation, but ignoring capitalization, say), although it turns out not to matter very much whether there are 50 keys or 50,000.
2.) Approximate the length of The Hobbit as 360,000 characters--it's a 320 page book, times a standard 250 words per page, times an average 4.5 letters per word in English.
3.) Assume all characters are equally likely to be output by the random generator, be it computer or monkey. (Digression #2: someone actually did this experiment once with real live monkeys and found that the monkeys were extremely overly fond of the letter "s" for some reason. Also, they [the monkeys] really enjoyed urinating on the keyboard.) Assume the characters are probabilistically independent of each other, i.e., knowing what one character is doesn't inform our knowledge of any other one.
4.) Now, break up the output of the generator into chunks of length 360,000. For each chunk, the chance of the first character being equal to the first character of The Hobbit, which is "i", is
. By the assumption of independence, the chance of the first two characters being correct, "in", is
, or
, and so on. So the chance of the whole block of 360,000 characters reproducing the entire book is
, which is about
, an astronomically small number. Let's call that number p. The probability of failing to produce The Hobbit in each chunk is (1-p).
5.) If we imagine doing this process a second time, the probability that we'd fail both times is
, because of the independence property again. In general if we repeat it n times, the probability of failing all n times is
. Now, and this is the key, (1-p) is extremely close to 1 but isn't actually equal to 1. So if we take n large enough, the probability of failure will eventually converge to 0; meaning that with high probability we will have at some point succeeded in producing The Hobbit. It's not clear what's meant by an event being "probable," but if, say, we wanted there to be a 95% probability of success, meaning a 5% chance of failure, we would need
. So to solve for n, we can take logarithms of both sides and divide by
, to get that
, which is on the order of
, or about
blocks of characters.
6.) To give you a sense of how incredibly large this number is, if we generated 200 characters per second, as you say, then 360,000 characters would take 30 minutes, so we could produce about 48 new blocks every day, or 17650 per year, on the order of
. This would mean that our
blocks would take about
years. For comparison, the universe is estimated to be around 13 billion years old, approximately
, so you would need
ages of the universe to have completed the task with 95% probability. Even if you had every atom in the universe working in parallel for the lifetime of the universe, you'd barely make a dent. Surely all our protons would have decayed into nothingness long before you even got to the part in the book where the trolls get turned to stone.
I suppose the moral of all of this, if you believe in that sort of thing, is that sometimes the mathematical consequences of our assumptions can far outstrip our intuition, especially when it comes to events that are exceedingly rare or numbers that are exceedingly large. So in a sense your "gut feeling" is right as far as any practical considerations go. Jorge Luis Borges wrote a story about this called The Library of Babel, which deals exactly with your scenario of a powerful being producing every possible book of a certain length. It's true that among such a vast library, there would be a comprehensive volume of the history of tea-drinking. However, there would also by necessity be an incredible number of false histories, every possible one in fact, as well as fraudulent cures for cancer and incorrect predictions for the next 100 World Series winners, and, importantly, there would be no way to distinguish the fake from the genuine. So it's back to option (a) I'm afraid--just write the book.
-DrM
Suppose you have a computer randomly generating all the characters making up the text of The Hobbit. Suppose the computer generates 200 characters per second. Is there a time period after which it becomes probable that the computer has produced the text of The Hobbit? My gut tells me, "No, it would never happen."
Consider this. If a sufficiently powerful being wanted to write a 20,000 page history of tea-drinking, it could either
(a) produce the book
(b) produce all possible 20,000 page long sequences of keyboard characters
TolkienFan
Dear TolkienFan,
Your question is related to the famous Infinite Monkey Theorem, about a room full of monkeys randomly banging on typewriters for all eternity eventually producing the complete works of Shakespeare. (Digression #1: an English major I knew once joked that the monkeys could reproduce the complete works of D.H. Lawrence in a surprisingly short time.) It turns out that the answer is "yes" in some abstract sense, as long as we're careful about what we mean, but the amount of time it would take is far beyond our comprehension--many many orders of magnitude more than the estimated age of the universe. Here's a quick back-of-the-envelope calculation:
1.) Let's only consider the characters on a standard typewriter. Let's say there are 50 possible characters (including numbers and punctuation, but ignoring capitalization, say), although it turns out not to matter very much whether there are 50 keys or 50,000.
2.) Approximate the length of The Hobbit as 360,000 characters--it's a 320 page book, times a standard 250 words per page, times an average 4.5 letters per word in English.
3.) Assume all characters are equally likely to be output by the random generator, be it computer or monkey. (Digression #2: someone actually did this experiment once with real live monkeys and found that the monkeys were extremely overly fond of the letter "s" for some reason. Also, they [the monkeys] really enjoyed urinating on the keyboard.) Assume the characters are probabilistically independent of each other, i.e., knowing what one character is doesn't inform our knowledge of any other one.
4.) Now, break up the output of the generator into chunks of length 360,000. For each chunk, the chance of the first character being equal to the first character of The Hobbit, which is "i", is
5.) If we imagine doing this process a second time, the probability that we'd fail both times is
6.) To give you a sense of how incredibly large this number is, if we generated 200 characters per second, as you say, then 360,000 characters would take 30 minutes, so we could produce about 48 new blocks every day, or 17650 per year, on the order of
I suppose the moral of all of this, if you believe in that sort of thing, is that sometimes the mathematical consequences of our assumptions can far outstrip our intuition, especially when it comes to events that are exceedingly rare or numbers that are exceedingly large. So in a sense your "gut feeling" is right as far as any practical considerations go. Jorge Luis Borges wrote a story about this called The Library of Babel, which deals exactly with your scenario of a powerful being producing every possible book of a certain length. It's true that among such a vast library, there would be a comprehensive volume of the history of tea-drinking. However, there would also by necessity be an incredible number of false histories, every possible one in fact, as well as fraudulent cures for cancer and incorrect predictions for the next 100 World Series winners, and, importantly, there would be no way to distinguish the fake from the genuine. So it's back to option (a) I'm afraid--just write the book.
-DrM
Subscribe to:
Posts (Atom)