Incredibly depressing Mega Millions Lottery simulator

Rob Cockerham of created the "incredibly depressing Mega Millions Lottery simulator." He says, "You'll be able to try the same numbers over and over, simulating playing twice a week for a year or 10. You'll never win."
In the 191,904 times this simulation has run, players have won $19,126. And by won I mean they have won back $19,126 of the $191,904 they spent (9%).

I played 1040 games of Mega Millions. I spent $1040. I won $117.


  1. People who play lotteries don’t think like this. Wins come from magic and karma and dream prophecy and your pathetic “simulation” doesn’t take those factors into account.

  2. The only people depressed by this are semi-numerate mathphobics (present company excluded). Read the published odds, play accordingly.

    Best odds in Vegas? The change machine. (I get a little thrill remembering this every laundry day!)

  3. Once I realized that playing the numbers 1, 2, 3, 4, 5, 6 have the same odds of any number combination, it finally sank in how unlikely winning a lottery really is.

  4. Gambling is a tax on those who can’t do math.

    Now I suspect someone might reply that the rush they get playing a game for money is worth the cost even though they know the odds and understand statistics. To them, the marginal value of a lottery ticket is worth it. If your life is so boring that you find loosing money exciting, I pity you.

    A charity raffle is about the only gambling that makes sense. You want to give to an organization and the chance to win something just sweetens the deal.

    Some may say that a state lottery is a sort of charity raffle because the public school system is often the beneficiary, but I doubt most lottery players would voluntarily donate the same amount of cash to education.

  5. This isn’t depressing, it’s just foolish. If you want depressing, then read the stories of people who have won millions in the lottery. Their lives, and the lives of their friends and family, turn to complete crap.

  6. In the UK, the lottery has become a very important source of funding for arts, sports and heritage. So you might get back more than just money.

    1. “In the UK, the lottery has become a very important source of funding for arts, sports and heritage. So you might get back more than just money.”

      Hahahhhhhhahahahaaahh yeah right, it becomes a DISPLACED source of funding, better to keep it funded through taxes elsewhere and not semi-privatize the goals through a lottery.

  7. But the lottery is an opportunity to hack your brain and leverage it’s problems with statistics and large numbers. It makes it easy to imagine what you’d do with a fortune and be entertained by the possibility no matter how slim. I like the opportunity to envision my own little island every once and a while, as well as the ego boost I get reminding myself how much of it I’d donate to charities.

    Sure I could do this without spending the buck, but somehow the passing of the paper breaks down the cynicism so much more.

    The problem is that it is a known exploit that too easily goes beyond playing it like a “what if” game for fun into preying on those who really believe in Yana’s magic.

  8. I know the odds, and I choose to ignore them. Winning the lottery is my only hope for retirement…plus I help fund college scholarships with my “donations” (as well as provide lottery executives substantial salaries and bonuses).

  9. The lottery preys not only on the superstitious, but also on the desperate.

    That’s because we don’t always bet on the expected payoff (the average you would net from a transaction), but on the possibilities. Judged purely by exepcted payoff, it would be stupid to buy insurance, for instance; any sound insurance plan necessarily takes in more than it pays out, so in an ideal insurance market the expected payoff for customers is always negative. But we buy it anyway, and for quite rational reasons: we want to close off the possibility of a catastrophic financial outcome.

    The desperate person buying a lottery ticket is facing a similar situation in reverse: they’re trying to *open up* the possibility of a non-catastrophic financial outcome. It may make a perverse sort of sense to try this in desperate situations, even if the expected payoff is negative.

  10. Near the end of my last job I was so utterly miserable that I played power ball for the first time just to feel some glimmer of hope again. I knew the probability of winning was infinitesimally small and that it was a complete waste of my dollar in respect to it being an investment. That said, the good feeling I got from that one dollar was a solid investment, and realizing that I had become so desperate for hope gave me the extra push to find a new job.

  11. You played 1040 games of Mega Millions. It cost $1040. You won $10058.

    Woo! Science has proven that I should be playing the lottery!

    (ok, that may have been on my 4th 10-year attempt…)

    1. After winning big ($10,000, 4 balls + bonus ball) in the 4th decade of playing the lottery I decided to continue playing twice a week for 500 more years. I never won big again. :( Aside from the single 10k, I had a high/low of $500/$34 per decade.

  12. I only play the lottery when my life has gone utterly to shit. I figure if there is a such thing as luck, that’s when it will be most in effect.

  13. I recall a friend in college who did a statistics project/simulation to demonstrate that your odds of winning the lottery are effectively the same whether you buy a ticket or not. i.e. the odds of finding a winning ticket, or receiving a winning ticket as a gift or other means is effectively the same as playing the lottery.. it was a good object lesson on big numbers and odds.

  14. “In the 3654533 times this simulation has run, players have won $1501057
    And by won I mean they have won back $1501057 of the $3654533 they spent (41%).”

    This sim has run over 3 million times sent it hit boingboing…

    1. It would appear that the biggest loser is the lottery itself:

      In the 1527690 times this simulation has run, players have won $2662401
      And by won I mean they have won back $2662401 of the $1527690 they spent (174%).

  15. Pfft, speak for yourselves losers! The page told me I’d win $244,000. I’ve already put my old car up on eBay.

  16. “In the 1202438 times this simulation has run, players have won $2630494
    And by won I mean they have won back $2630494 of the $1202438 they spent (218%).”

    Hey, sounds like that lottery is about to go bankrupt!!

  17. Lighten up people. It only costs a buck.

    The people I feel bad for are the ones who throw down a twenty and rattle off a bunch of patterned numbers based on some system they’ve developed.

    Thought number three: When I read this headline, I thought it was a “simulator” like I made one time when there was a gigantic jackpot. I captured the web page and modified the HTML so my numbers were shown as the winners. Just to see what it feels like. But in the end, I didn’t feel like I had really felt like what it really feels like.

    In conclusion, one of my co-workers won in the $5-10 million range a few years ago. He still works here with me.

  18. When I ran this I got to wondering just what randomization algorithm they’re using, because the numbers I chose (specifically 11) hit what seemed like an inordinate number of times.

    But then again, it is impossible to really be sure if a randomization algorithm is producing truly random numbers. It seems like I saw an dilbert comic on that once…

    1. Is that exactly the problem.

      The lottery (or Mega Millions) doesn’t use a computer. It’s not a simulation on a computer. And computers don’t truly create random numbers, so hence this simulation isn’t really simulating anything realistic.

      1. I’m not sure what the point is… that ping pong balls bouncing around in a glass jar are more random than a computerized RNG? Less? What difference does it make?

        Also, saying that a computer cannot generate random numbers is pretty absurd. You sound like the people I used to play WoW with complaining that the loot in Molten Core wasn’t random. I’m sure we would notice the difference between 100% random and 99.9999999999999999999999999999999999999999%

  19. Sounds like someone hit the big score. That’s the problem with the lottery. Due to the sheer size of the numbers, you won’t win, but *somebody* will.

    But now it’s back down to 90%. Me personally, I “won” just under $500 after playing for 50 years.

    I only ever personally knew one person who won at the lottery. He bought his first scratch ticket, won $50, then never bought one again.


  20. Oop. Looks like someone won again:
    “In the 9676679 times this simulation has run, players have won $27594719. And by won I mean they have won back $27594719 of the $9676679 they spent (285%).”

  21. In the 381503 times this simulation has run, players have won $27684061
    And by won I mean they have won back $27684061 of the $381503 they spent (7256%).

    Glitch much?

  22. Hey, I just registered to say the same thing (the +100% money back glitch).
    Damn you all, my witty comment is now useless.

    Oh well, hi everybody. :)

  23. So if winning the lottery is mathematically impossible (or, rather, improbable) how do the winners win? I’ve seen lots of math saying that you can’t win playing the lottery yet people do win. So where’s the math on that?

  24. Someone break the code?
    In the 1023953 times this simulation has run, players have won $27749099
    And by won I mean they have won back $27749099 of the $1023953 they spent (2709%).

  25. There used to be a website that would tell you how much you had saved (or spent) on the UK’s National Lottery, given a specific set of numbers.

    Sadly, I can’t find it any more :( But it was cool – I’d occasionally look at the amount I’d saved and think “whoo, I earned enough for a pizza!”

    Though I did tell myself that if the numbers ever DID come up, I’d throw a huge party anyway, even though I hadn’t bought the ticket.

  26. I was all of 8 years old when Michigan introduced their lottery (1972). At the time they were making a big deal about how all the proceeds were going to go towards education.

    At the time I made a prediction which unfortunately (but inevitably) came true; for every dollar put towards education from the lottery, one dollar less went there from the general fund. Education gained $0, it all actually went to the general fund, just laundered through the educational system.

    Yeah, I was a bit precocious. And a cynical little bastard. I’ve only gotten worse with age.

    And yes, insert standard verbage here, the lottery is a tax on the innumerate, and vastly disproportionately taxes the poor (partially as a result).

  27. the algorithm is incorrect,if the correct algorithm was given the game would be shot thus showing that the Lottery is mathematically based and someone should be able to predict the numbers put using a similar formula. You gotta admit somebody wins sometimes, it’s not impossible. growing wings and flying or finding a pot of gold at the end of a rainbow, yes impossible.

  28. This game tells me two things about humans.

    1) Even if they have no chance at winning, they will still pay to play.

    2) Even if they have nothing to gain, they will still cheat.

  29. This reminds me of a depressing conversation I had in college back in the early 90s. I was doing a boring data entry job over the summer (for about $15/hour, which was great back then) and the woman next to me ate a McDonald’s every day. The reason? She was playing their Monopoly game, and she had gotten all the stickers on each set of properties except one in each case. She showed it to me one day and said “I just have to win something – I’m so close.” Without thinking I told her they only made a very limited number of the final (“winner”) stickers, so she really wasn’t any closer. I immediately felt bad for pointing that out. But also, she didn’t believe me.

  30. For me, the daydream fodder is worth $1 a week. The thing that scares me are the people I see buying $100 worth of scratch tickets at a time, or people who buy multiple powerball tickets to “increase their chances”- There’s a big difference between someone who plays for fun and someone who actually thinks they’re going to win.

    And yet, the odds of winning are still better than the odds of being killed by a terrorist. Maybe we should take that 55% of our national budget and buy lottery tickets with it instead.

  31. Looks like someone wasn’t expecting the huge response. The first time I ran it there were 3.5 million runs of the sim and the second time (an hour or so later) it was saying 450,000. Might need to use an unsigned type or a type with a larger number of bits next time. :)

  32. I said this in the last “If only they knew the maths” anti-lottery screed in BB…
    Lottery players know full-well that their odds of winning is near zero. Really. They do. The minimum-wage couple know the odds, but they play because it represents a real form of economic hope, however transparently slim. And the MBA plays because, hell, it’s just a buck.

  33. HEY!!!! I need Boing Boing to create a premium membership level where a select few get access to these links so they don’t get “Boinged”. Everyone else can *read* about the awesome things us premiums get to do – play cool games, fiddle with online crap, etc. But only WE will actually experience it.

    Someone get on that, posthaste!

    1. Typical time traveller. With them, it’s always “Look at me! Look at me! I know what numbers to pick for the Lotto! I know who will win the next SuperBowl! I know what startup is going to be the next Google!”. Yeah, yeah. It’s all fun and games until they cause a collapse of the space-time continuum.

  34. My uncle profited about $500 a month for decades in the Massachusetts lottery. It was a significant chunk of his income when he retired.

  35. If your expectation in the lottery is 1/X times the amount you spend, you need to be X times as lucky as the other players to break even. In regular lotteries, you aren’t. But in the kinds of progressive lotto games where the jackpot goes up every week, you can be, because the jackpot includes money from players who’ve already lost. So you could very well have a 1 in a million chance of winning 10 million dollars – it’s a positive expectation, but still a waste of money. On the other hand, most of those lotteries split the jackpot if there are multiple winners, which becomes more likely since there are more suckers playing if the jackpot’s big.

    Last time I played a government lottery, I didn’t win the green suit or the two-year vacation in exciting tropical Vietnam, and I haven’t played again. On the other hand, I once bought a $5 charity raffle ticket from the rainforest people at a Dead show, and won a poster signed by the band, but that was expected to be a gift, not an investment.

  36. In America we have a game called PowerBall. The number “35” has not come up as the powerball since July of 2007. If you’re going to play that game, that’s a number that is waaaaaaaaaaaaayy overdue.

    Just sayin’

    1. Not everyone likes that dumb show. Liking it doesn’t make you a nerd, just someone who likes crappy writing.

      A real nerd would’ve tried 3, 14, 15, 9, 26 AND 42.

  37. It’s actually surprisingly difficult to calculate the expected value of a MegaMillions ticket. It depends on the interest rates of Treasury bonds, the current jackpot, the response of sales to jackpot level (higher chance of having to split the prize) and your state tax level. Figuring a combined 31% tax rate, a 3.7% bond rate, and a $100M nominal jackpot: the defined prizes are worth $0.15 per ticket and the jackpot is worth $0.25 per ticket. The expectation value becomes greater than the cost of the ticket at around a $350M jackpot (not adjusting for increased prize-splitting odds.

    With bond yields low compared to long-term inflation, the cash option is better. Choosing your own numbers rather than using the random numbers generally greatly increases your chance of having to split the prize. There are some indications that the winning numbers drawn aren’t really random, so there may be an exploitable effect – though not likely to be big enough to make a positive expectation value.

  38. I play Mega Millions every once in a while, and I do understand math and statistics. I know there’s only an infinitesimal chance of winning, but for just a buck I get the opportunity to dream about what I might do if my ticket did come up a winner.

    And I also know that if I *don’t* get a ticket, my chances of winning are zero.

    Gambling in Las Vegas generally has much better odds than the lottery. When I do go to Vegas I’ll gamble some (blackjack and craps) for the fun of playing, the mental challenge of remembering the proper strategies, and the off chance that I’ll end up ahead, which does happen sometimes.

  39. “And I also know that if I *don’t* get a ticket, my chances of winning are zero.”

    But your chance of retaining your dollar is 100%.

  40. There are three good reasons to play a lottery.
    1) the entertainment value
    (“did I win? Did I Win?? No? Oh well…”)
    2) it’s a cause you want to support
    (Many charity fundraisers employ lotteries or raffles)
    3) the expected value is greater than the cost of a ticket
    (only happens by mistake or stupidity)

  41. “But your chance of retaining your dollar is 100%.”

    Oh boy, a dollar. Considering the other things I’ll spend a dollar on, I’m happy to spend one on dreaming about becoming insanely wealthy.

    If I were really hurting for money and had to watch every last bit of it to survive, then no, I wouldn’t spend a dollar on a lottery ticket. And the people who buy a hundred tickets every week are delusional, too. But for most Americans, if they have a realistic assessment of their dim chances of winning, spending a dollar every now and then on a lottery ticket is a perfectly reasonable tradeoff.

  42. Hmmm… Something is slightly fishy with this script. I played several runs of 1040 at a time. Two sets of results in a row:

    In the 438706 times this simulation has run, players have won $1567482
    And by won I mean they have won back $1567482 of the $438706 they spent (357%)

    In the 3658912 times this simulation has run, players have won $4007
    And by won I mean they have won back $4007 of the $3658912 they spent (0%).

    These were about 45 seconds apart.

    So yes, the statistics are insane. As @moriarty said above, Someone will win. You won’t.

    But this is not a great example of it, given that it was not coded to deal with the literally billions of hits it needed (odds of winning are 56*55*54*53*52*47 = ~21 billion to 1) to have to generate truly good statistics, even if the randomize function it was using was decent (and it likely isn’t). Also, In playing with this (and arguing with my friends about it) off and on all day (yes, we’re physicists, so?) I’ve seen two major jackpots appear than immediately disappear.

    Coincidence? I think not! ;-)

  43. You played 1040 games of Mega Millions. It cost $1040. You won $72.

    See, this is why you should never get in line behind me at the movie-theater snack bar. When I select a line to get in, the guy at the front will forget why he’s there, or choose that moment to finally peruse the menu board at length, asking questions about ingredients and combo pricing, before finally buying the last box of Red Vines and a small Sprite (hold the ice). And then he’ll try to pay by check. And then the next lady will be ordering for an entire troop of Girl Scouts… meanwhile, the queues to my left and right accelerate. Until I give up and switch into one of them. At which point my new line stops dead. This also happens at any bank or airport or post office which has yet to convert to the Common Feeder Line policy. At the supermarket, I’m never the guy paying by out-of-state two-party check with 37 coupons and a mis-priced box of Wheaties. He’s the guy right in front of me.

    I am Donald, the Queue Killer. Who gets a sub-7% return on his lottery investment.


  44. Give me your dollar. In a few days I might give you a few back. Most likely you’ll never see that dollar again. There is a chance that I’ll make you a millionaire, but don’t count on it. If it makes you feel better, I’ll give fifty cents to some school kid. So, are you in?

  45. And check this out, when you pay to watch live entertainment you lose 100% of your money too. Why not just stare at a wall and KEEP your money?

  46. Lottery is bankrupt, ha HA!

    In the 664431 times this simulation has run, players have won $27209568
    And by won I mean they have won back $27209568 of the $664431 they spent (4095%).

  47. It’s quite possible for a high-stakes lottery to pay out more in prizes than it takes in, and still turn a profit. This is because the top prize is often of the form “one million dollars, paid $50K/year for 20 years” or similar. A $1M 20 year annuity costs a lot less than $1M (let’s say it’s $500K). So you can take in $1M in tickets, pay out $1M top prize, pay out $100K in smaller
    prizes, and take the other $400K profit and do something with it.

    Bonus points if instead of buying the annuity now, you invest $400K in something that will pay out and buy an annuity in 2020, and use the just-matured $500K from your investment in 2000 to buy the annuity.

  48. You played 1040 games of Mega Millions. It cost $1040. You won $83.

    In the several dozen times that I’ve bought a lottery ticket, I’ve never even gotten one number.

  49. The odds are like 100 billion billion times the number of electrons in the universe.

    Once chance in an Avogadro’s number of Avogadro’s number of Avogadro’s number.

    I use my $ to bet on a candy bar. Gives me a rush *every* time.

  50. I’m not going to pretend that the lottery is a good investment. On the other hand, some of us CAN let the innumerate subsidize us.

    Lottery with 1 in 195 million chance of winning (say, Powerball), paying out 10 million. Not a good bet.

    Lottery with 1 in 195 million chance of winning, paying out 250 million. Better bet.

    compare to

    $1 ticket for 10% chance of winning $12.

    When the percentage chance of winning times the prize equals or exceeds the cost of playing, the gamble is mathematically reasonable. Not necessary, of course, and certainly not a better use of money than food or rent, but not a mathematically unsound wager.

    Of course, not everyone thinks this way, but you don’t have to play the lottery until a lot of more hopeful, innumerate, or supersitious people have subsidized your chances.

  51. Ticket: 4, 12, 22, 46, 51, Mega: 19
    Lottery: 4, 12, 22, 46, 51, Mega: 42
    Winners: 4 12 22 46 51

    5 ball(s) correct. Five balls wins $500,000!

    SWEET! oh wait….

  52. Other than not playing at all wait til jackpot is over $100K and play a couple bucks. Large jackpots usually don’t last long so you are not going to be out much. And you can still have your lottery fantasy.

  53. Accepting that it’s pretty much impossible for me to win the lottery, I still play it. Couple pounds every other week seems like not a bad deal, given the – very slim – possibility that I’ll win.

    However, I’m willing to stop and spend that GBP4 per month differently on something else, if I have better prospects of profiting with a similarly casual approach. So what would be better?

  54. I think people who play the lottery understand maths and statistics better than those who look down on them.

    For one thing, they understand using mean average winnings for something with such low probability is silly, eg:

    $5 million jackpot with probability of 1 in 10 million = $0.50 value for a $1 ticket, therefore people who buy them are morons and I hate them.
    $15,000,000 rollover jackpot with the same probability = $1.50 value for a $1 ticket, what a sensible investment!

    But the cost of playing and overwhelming likelihood of losing your money is the same. And if you did win, would you really care that it’s 5 million rather than 15?

    For another, they understand that one of the assumptions in the probability calculation is wrong: $1 million is not worth a million times $1. It’s worth pretty close to infinity times $1. $1 in your pocket is worth nothing. It’s going to get spent on a Coke you don’t really want or a newspaper full of stories you read online yesterday. $1 million is going to pay off your mortgage, plus buy investments giving you an income while you travel or follow your dream career. The numbers in the calculations just can’t capture how life-changing the jackpot is and how worthless the stake is. You effectively paying nothing for a chance at an easy life, however small. Stupid not to.

    That’s also why one ticket a week makes sense, but taking money out of the bank specifically for tickets is a bad idea. Bank money is worth more than pocket money.

    1. Eh, who wants to be a millionaire, anyway?

      Of course, that song was written by Cole Porter: a man who inherited a fortune worth 400 million $$ from his parents, while still in his twenties. IIRC. Oh, well….

    2. Funnily enough, you have it exactly backwards.

      It’s true, the expected value of your investment is not all the matters. The other important financial factor is your ‘utility value’ of each dollar – how much each dollar is worth to you. If you have 1 dollar, then 1 more dollar seems quite good. If you have 5 million, then another is barely useful to you. That’s why the difference between 5 million and 15 million isn’t as great as between 0 and 5 million.

      However, as you can see, your utility value increases as you have less money. The dollar you’d save on the ticket is more important than the dollars in the gratuitous money you’d win. In your terms, $1 million is necessarily worth less than a million times $1.

      1. True, but having some real-world basis for the fantasy of having $1M or $100M, however slim, is objectively worth at least $1 to a large percentage of the population.

        If the tickets cost $1000 and were, say 3000 times as likely to pay off, the dollar volume of sales would fall by an enormous factor, even though according to the math it’s a much better deal, and according to the economists the marginal dollars in a $1000 expenditure are worth less than in the $1 expenditure. The answer is that the $1000 ticket does not offer 1000 or 3000 times as much hope/fantasy/entertainment as the $1 ticket, while on the other hand it costs several thousand times the risk of ruin of a $1 ticket (how many people can buy a $1000 ticket and still make the rent?). The $1 ticket, on the other hand offers nearly infinitely more hope than no ticket at all (modulo the chance of finding or being given a valid ticket). Also, odds are also of log value, not just payoffs – the odds of a MegaMillions jackpot win are -82.4dB. The log-value of the jackpot is 73-85dB$ nominally, 69.4-81.4dB$ actually. The value of the jackpot is thus 84%-99% of the ticket price on a log scale* without even accounting for the hope value or the defined prizes. *(Not mathematically really proper, linearity being nearly an article of faith, but perceptually valid.)

        1. Sure, the fantasy gives you extra value for your dollar. For that reason I don’t argue that playing the lottery is strictly illogical. My argument was purely on the value of the money you make or save. Personally I also get satisfaction from knowing I’ve made the best financial choice and that gives me a stronger incentive not to play.

          I see your logic about the log value of the jackpot, but to clarify, what’s the advantage of using a log value over a linear value?

          1. “I see your logic about the log value of the jackpot, but to clarify, what’s the advantage of using a log value over a linear value?”

            Well, perception is usually log – brightness, loudness etc. Also, economists often treat wealth as having log utility to an individual. Finally, most people intuitively think of $100 million as being not 10x or $90M greater than $10M, but as only somewhat greater – both being in the category of “more than I’ll ever have” and “enough to last the rest of my life”. Given the choice of a 1 in 10 chance of $10M or a 1 in 90 chance of $100M, nearly everybody will choose the 1 in 10 chance, even though its expectation value is lower.

    3. $1 million is going to pay off your mortgage, plus buy investments giving you an income while you travel or follow your dream career.

      Been a while since you’ve looked at typical mortgages huh?

  55. The emulator seems quite flawed. After all it is impossible for lottery players as a whole to win more then they put in. There are safe checks in place to prevent that.

    Here is a very very simplified version of their formula.

    Amount of $ put in = Cut of the house + cut of the charity + winnings to be paid out

  56. As an update…

    The “depressing” lottery simulator has been played over 23 million times, netting more than $76.6 million for players. A 325% payoff.

    “In the 23589427 times this simulation has run, players have won $76696477
    And by won I mean they have won back $76696477 of the $23589427 they spent (325%).”

Comments are closed.