Tag Archives: expected value

Luck(?) of the Draw

What is luck?  Is luck?  And, if you vote yea, is a belief in luck an obstacle to understanding probability?

This question came up on Twitter a couple of nights ago when Christopher Danielson and Michael Pershan were discussing Daniel Kahneman's recent book, Thinking, Fast and Slow.  Specifically, they were talking about the fact that Kahneman doesn't shy away from using the word luck when discussing probabilistic events.  This, of course, is the kind of thing that makes mathematically fastidious people cringe.  And Danielson and Pershan are nothing if not mathematically fastidious.  Spend like five minutes with their blogs.  So Danielson twittered this string of twitterings:

According to Danielson, luck a "perceived bias in a random event."  And, according to his interpretation of Kahneman, luck is composed of "happy outcomes that can be explained by probability."  Let me see if I can define luck for myself, and then examine its consequences.

What is luck?

I think, at its heart, luck is about whether we perceive the universe to be treating us fairly.  When someone is kind to us, we feel happy, but we can attribute our happiness to another's kindness.  When someone is mean, we feel sad, but we can attribute our sadness to another's meanness.  When we are made to feel either happy or sad by random events, however, there is no tangible other for us to thank or blame, and so we've developed this idea of being either lucky or unlucky as a substitute emotion.

But happy/sad and lucky/unlucky are relative feelings, and so there must be some sort of zero mark where we just feel...nothing.  Neutral.  With people, this might be tricky.  Certainly it's subjective.  Really, my zero mark with people is based on what I expect of them.  If a stranger walks through a door in front of me without looking back, that's roughly what I expect.  And, when that happens, I do almost no emoting whatsoever.  If, however, he holds the door for me, this stranger has exceeded my expectations, which makes me feel happy at this minor redemptive act.  If he sees me walking in behind him and slams the door in my face, he has fallen short of my expectations, which makes me sad and angry about him being an asshole.

And, in this regard, I think that feeling lucky is actually a much more rational response than being happy/sad at people, because with random events at least I can concretely define my expectation.  I have mathematical tools to tell me, with comforting accuracy, whether I should be disappointed with my lot in life; there is no need to rely on messy inductive inferences about human behavior.  So I feel lucky when I am exceeding mathematical expectations, unlucky when I'm falling short, and neutral when my experience roughly coincides with the expected value.  Furthermore, the degree of luck I feel is a function of how far I am above or below my expectation.  The more anomalous my current situation, the luckier/unluckier I perceive myself to be.

Let's look at a couple examples of my own personal luck.

  1. I have been struck by lightning zero times.  Since my expected number of lightning strikes is slightly more than zero, I'm doing better than I ought to be, on average.  I am lucky.  Then again, my expected number of strikes is very, very slightly more than zero, so I'm not doing better by a whole lot.  So yeah, I'm lucky in the lightning department, but I don't get particularly excited about it because my experience and expectation are very closely aligned.
  2. I have both my legs.  Since the expected number of legs in America is slightly less than two, I'm crushing it, appendage-wise.  Again, though, I'm extremely close to the expected value, so my luck is modest.  But, I am also a former Marine who spent seven months in Iraq during a period when Iraq was the explosion capital of the world.  My expected number of legs, conditioned on being a war veteran, is farther from two than the average U.S. citizen, so I am mathematically justified in feeling luckier at leg-having than most leg-having people in this country.

Which brings us back to this business of luck being a "perceived bias in a random event."  I'm not convinced.  In fact, I'm absolutely sure I can be lucky in a game I know to be unbiased (within reasonable physical limits).  Let's play a very simple fair game: we'll flip a coin.  I'll be heads, you'll be tails, and the loser of each flip pays the winner a dollar.  Let's say that, ten flips deep, I've won seven of them.  I'm up $4.00.  Of course, my expected profit after ten flips is $0, so I'm lucky.  And you, of course, are down $4.00, so you're unlucky.  Neither of us perceives the game to be biased, and we both understand that seven heads in ten flips is not particularly strange (it happens about 12% of the time), and yet I'm currently on the favorable side of randomness, and you are not.  That's not a perception; that's a fact.  And bias has nothing to do with it, not even an imaginary one.

Now, in the long run, our distribution of heads and tails will converge toward its theoretical shape, and we will come out of an extremely long and boring game with the same amount of money as when we started.  In the long run, whether we're talking about lightning strikes or lost limbs or tosses of a coin, nobody is lucky.  Of course, in the long run---as Keynes famously pointed out---we'll be dead.  And therein, really, is why luck creeps into our lives.  At any point, in any category, we have had only a finite number of trials, which means that our experiences are very likely to differ from expectation, for good or ill.  In fact, in many cases, it would be incredibly unlikely for any of us to be neither lucky nor unlucky.  That would be almost miraculous.  So...

Is luck?

As in, does it really exist, or is it just a perceptual trick?  Do I only perceive myself to be lucky, as I said above, or am I truly?  I submit that it's very real, provided that we define it roughly as I just have.  It's even measurable.  It doesn't have to be willful or anthropomorphic, just a deviation from expectation.  That shouldn't be especially mathematically controversial.  I think the reason mathy people cringe around the idea of luck is because it's so often used as an explanation, which is where everything starts to get a little shaky.  Because that's not a mathematical question.  It's a philosophical or---depending on your personal bent---a religious one.

If you like poker, you'd have a tough time finding a more entertaining read than Andy Bellin's book, Poker Nation.  The third chapter is called "Probability, Statistics, and Religion," which includes some gems like, "...if you engage in games of chance long enough, the experience is bound to affect the way you see God."  It also includes a few stories about the author's friend, Dave Enteles, about whom Bellin says, "Anecdotes and statistics  cannot do justice to the level of awfulness with which he conducts his play."  After (at the time) ten years of playing, the man still kept a cheat sheet next to him at the table with the hand rankings on them.  But all that didn't stop Dave from being the leading money winner at Bellin's weekly game during the entire 1999 calendar year.  "The only word to describe him at a card table during that time is lucky," says Bellin, "and I don't believe in luck."

But there's no choice, right, but to believe?  I mean, it happened.  Dave's expectation at the poker table, especially at a table full of semi-professional and otherwise extremely serious and skillful players, is certainly negative.  Yet he not only found himself in the black, he won more than anybody else!  That's lucky.  Very lucky.  And that's also the absolute limit of our mathematical interest in the matter.  We can describe Dave's luck, but we cannot explain it.  That way lies madness.

There are 2,598,960 distinct poker hands possible.  There are 3,744 ways to make a full house (three-of-a-kind plus a pair).  So, if you play 2,598,960 hands, your expected number of full houses during that period is 3,744.  Of course, after 2.6 million hands, the probability of being dealt precisely 3,744 full houses isn't particularly large.  Most people will have more and be lucky, or less and be unlucky.  That's inescapable.  Now, why you fall on one side and not the other is something you have to reconcile with your favorite Higher Power.

Bellin's final thoughts on luck:

I know in my heart that if Dave Enteles plays 2,598,960 hands of poker in his life, he's going to get way more than his fair share of 3,744 full houses.  Do you want to know why?  Well, so do I.

And, really, that's the question everybody who's ever considered his/her luck struggles to answer.  No one has any earthly reason to believe she will win the lottery next week.  But someone will.  Even with a negative expectation, someone will come out way, way ahead.  And because of that, we can safely conclude that that person has just been astronomically lucky.  But why Peggy McPherson?  Why not Reggie Ford?  Why not me?  Thereon we must remain silent.

Is a belief in luck an obstacle to understanding probability?

I don't see why it should be.  At least not if we're careful.  If you believe that you are lucky in the sense of "immune to the reality of randomness and probabilistic events," then that's certainly not good.  If you believe that you are lucky in the sense of "one of the many people on the favorably anomalous side of a distribution," then I don't think there is any harm in it.  In fact, acknowledging that random variables based on empirical measurements do not often converge toward their theoretical limits particularly rapidly is an important feature of very many random variables.  In other words, many random variables are structured in such a way as to admit luck.  That's worth knowing and thinking about.

Every day in Vegas, somebody walks up to a blackjack table with an anomalous number of face cards left in the shoe and makes a killing.  There is no mystery in it.  If you're willing to work with a bunch of people, spend hours and hours practicing keeping track of dozens of cards at a time, and hide from casino security, you can even do it with great regularity.  There are how-to books.  You could calculate the exact likelihood of any particular permutation of cards in the shoe.  I understand the probabilistic underpinnings of the game pretty well.  I can play flawless Basic Strategy without too much effort.  I know more about probability than most people in the world.  And yet, if I happen to sit at a table with a lot more face cards than there ought to be, I can't help but feel fortunate at this happy accident.  For some reason, or for no reason, I am in a good position rather than a bad one; I am here at a great table instead of the guy two cars behind me on the Atlantic City Expressway.  That's inexplicable.

And that's luck.


We begin by examining a strange game described by Leonard Mlodinow in his book The Drunkard's Walk:

"Suppose the state of California made its citizens the following offer: Of all those who pay the dollar or two to enter, most will receive nothing, one person will receive a fortune, and one person will be put to death in a violent manner."

Couched in such language, the game sounds like it comes from a post-apocalyptic American dystopia.  Or a reality show on Fox.  But actually, Mlodinow is just talking about the California state lottery.  Most people simply cough up a buck; one (usually) person eventually hits the jackpot, and the increased traffic---on average, after factoring in some reasonable assumptions and stats from the NHTSA---causes about one extra motor vehicle fatality per game (p.78).  This doesn't exactly sound like a game you'd want to play.  And, as a math teacher, I'm nigh on required to agree with that sentiment.  But I don't.

Even though it's always smoldering in the background, the recently ginormous Mega Millions jackpot has fanned the flames of lottery hatred, particularly among the mathosphere.  But I'm here to present the minority opinion.  The lottery isn't such a bad bet for the average citizen.  At least it's not as bad a bet as it's often made out to be.

Let's look at some of the common anti-lottery arguments, and why they're not particularly strong.  Oh, and before my credibility dips all the way down to zero, I should say that I am in no way employed by any lottery organization, and actually I've never even purchased a ticket.  Feel better?  Moving on.

The lottery is a tax on ignorance.

This is trotted out pretty frequently, I suspect, because (a) it's pithy and quotable, and (b) it pretty much ends any meaningful discussion on the matter.  It's like calling religion "the opiate of the masses."  It seeks to make the opposing position seem automatically ridiculous.  How can you have a reasoned debate after that?  You can't, really, which is one good reason to dismiss this kind of argumentation out-of-hand.  But besides belonging to a class of bad arguments, this particular one is awfully thin.  Maybe it wasn't always, but it is now.

Calling the lottery a "tax on ignorance" is like putting warning labels on cigarettes.  There was a time when the public was legitimately unaware of the dangers of smoking.  Hell, doctors even sponsored cigarette brands.  And when the damaging effects of tobacco came to light, people needed to be warned that it was, in fact, not such a wonderful idea to use it.  Hence, warning labels.  But in 2012, they're redundant.  I just can't believe that there is one person in this country who has been to even a single day of public school who thinks that cigarettes are safe.  Ever surprise a smoker by telling him that cigarettes will kill him?  Didn't think so.

Ever surprise a lotto player by telling him he'll never win?  Didn't think so.  No one is ignorant of the astronomical odds against hitting the jackpot.  Maybe there was a time when people were being duped, but that time has long passed.  We can certainly talk about whether it's okay for the government to make money off of people's hopes and dreams of a fantasy life, but let's not pretend that people are unaware of the fantasy.

You can take the money you would have spent on lottery tickets and invest it instead.

Let's ignore, for a moment, that a savings account is currently losing you about 2% per year (in real dollars), and that an index fund over the past five years has lost you something like 8% per year.  I mean, those quote investments are certainly still better than the lottery, which loses you just shy of 100% per year.  But why are we mentioning the lottery in the same breath as investments, anyway?

Let's reformulate the above heading: "You can take the money you would have spent on X and invest it instead."  And that sentence is true for anything you happen to spend your money on.  Why are lotto tickets so special?  In what sense is buying a lottery ticket more a waste of money than buying a King Size Snickers?  Neither one of those things gives you a monetary return on your investment.  But of course that's not what we expect out of a Snickers.  And, I submit, it's not really what we expect out of a lottery ticket, either.  What we expect out of both of those purchases is utility.  And obviously there is some utility to be had in both cases (about a dollar's worth), since people are willing to pay it.  Why pay a dollar to make you fatter and increase your risk of diabetes?  I don't know.  Why pay a dollar to spend a few days wistfully imagining a life that includes indoor hot tubs?  I don't know.  They're equally silly, and offer roughly equivalent utility to a great many people.

Purchasing a lottery ticket has a negative expectation.

This is my favorite mathematical argument, because it's terrible.  I will grant you that this is almost always (but not quite) true.  A $1 lottery purchase normally has an expected value of very nearly -$1.  When the jackpot gets very large, the expectation becomes slightly less negative, and when the jackpot gets hugely large, the expectation might even creep into the  black.  But all of that is really beside the point.

First of all, the negative expected value is very tiny.  For most people who buy lottery tickets, that expenditure is trivial.  I certainly waste way, way more money per week in buying "sure things" than most of the lotto faithful do in gambles.  But that's not really the point, either.

The point is this.  Saying you shouldn't make any gambles with negative expected value is to tacitly imply that you should also be in favor of gambles with positive expectation and be indifferent to gambles with zero expectation.  This would make you a completely rational actor.  It would also make you a complete idiot.

Are you indifferent to betting $100,000 with me on the flip of a fair coin?  I'm sure as hell not!  I'll do you one better: I'll pay you $1.3 million dollars if it comes up heads, and you pay me $1 million even if it comes up tails.  Now that bet has a positive expected value for you...wanna gamble?  Of course you don't.  Monetary expectation has almost nothing to do with your willingness to engage in risk.  It's your expected utility that you're worried about, and utility is not linear with money.  Over small intervals of the domain, it might be approximately linear, and so it's tempting to equate the two, but they're very different globally, as our coin-flipping gambles show.  A dollar's worth of utility lost is absolutely trivial (to me), but the potential utility that comes with hundred of millions of dollars, even with very small probability, more than counters that loss.  I'm basically free-rolling: paying nothing for the chance at something.  In other words it's possible (even normal) for me to have a negative expectation in money, but a positive expectation in utility.  And that's the only expectation that really matters.


Of course for some people the lottery is terrible.  People have gambling problems.  People spend way too much money on all kinds of things they probably shouldn't.  But that doesn't mean that everyone---or even most people---that play are suckers.  Eating the occasional King Size Snickers probably won't get your foot chopped off; smoking the occasional cigarette probably won't kill you (sorry, kids), and buying the occasional lottery ticket will likely have about zero net impact on your finances.  Besides, isn't it worth it to dream, for even a day, of having indoor hot tubs?  They're so bubbly.

Cereal Boxes Redux

In my last post, my students were wrestling with a question about cereal prizes.  Namely, if there is one of three (uniformly distributed) prizes in every box, what's the probability that buying three boxes will result in my ending up with all three different prizes?  Not so great, turns out.  It's only 2/9.  Of course this raises another natural question: How many stupid freaking boxes do I have to buy in order to get all three prizes?

There's no answer, really.  No number of boxes will mathematically guarantee my success.  Just as I can theoretically flip a coin for as long as I'd like without ever getting tails, it's within the realm of possibility that no number of purchases will garner me all three prizes.  But, just like the coin, students get the sense that it's extremely unlikely that you'd buy lots and lots of boxes without getting at least one of each prize.  And they're right.  So let's tweak the question a little: How many boxes do I have to buy on average in order to get all three prizes?  That's more doable, at least experimentally.

I have three sections of Advanced Algebra with 25 - 30 students apiece.  I gave them all dice to simulate purchases and turned my classroom---for about ten minutes at least---into a mathematical sweatshop churning out Monte Carlo shopping sprees.  The average numbers of purchases needed to acquire all prizes were 5.12, 5.00, and 5.42.  How good are those estimates?

Simulating cereal purchases with dice

Here's my own simulation of 15,000 trials, generated in Python and plotted in R:

I ended up with a mean of 5.498 purchases, which is impressively close to the theoretical expected value of 5.5.  So our little experiment wasn't too bad, especially since I'm positive there was a fair amount of miscounting, and precisely one die that's still MIA from excessively enthusiastic randomization.

And now here's where I'm stuck.  I can show my kids the simulation results.  They have faith---even though we haven't formally talked about it yet---in the Law of Large Numbers, and this will thoroughly convince them the answer is about 5.5.  I can even tell them that the theoretical expected value is exactly 5.5.  I can even have them articulate that it will take them precisely one box to get the first new toy, and three boxes, on average, to get the last new toy (since the probability of getting it is 1/3, they feel in their bones that they should have to buy an average of 3 boxes to get it).  But I feel like we're still nowhere near justifying that the expected number of boxes for the second toy is 3/2.

For starters, a fair number of kids are still struggling with the idea that the expected value of a random variable doesn't have to be a value that the variable can actually attain.  I'm also not sure how to get at this next bit.  The absolute certainty of getting a new prize in the first box is self-evident.  The idea that, with a probability of success of 1/3, it ought "normally" to take 3 tries to succeed is intuitive.  But those just aren't enough data points to lead to the general conjecture (and truth) that, if the probability of success for a Bernoulli trial is p, then the expected number of trials to succeed is 1/p.  And that's exactly the fact we need to prove the theoretical solution.  Really, that's what we need basically to solve the problem completely for any number of prizes.  After that, it's straightforward:

The probability of getting the first new prize is n/n.  The probability of getting the second new prize is (n-1)/n ... all the way down until we get the last new prize with probability 1/n.  The expected numbers of boxes we need to get all those prizes are just the reciprocals of the probabilities, so we can add them all together...

If X is the number of boxes needed to get all n prizes, then

$latex E(X) = frac{n}{n} + frac{n}{n-1} + cdots + frac{n}{1} = n(frac{1}{n} + frac{1}{n-1} + cdots + frac{1}{1}) = n cdot H_n&s=2$

where Hn is the nth harmonic number.  Boom.

Oh, but yeah, I'm stuck.