Here’s a thought challenge for you: Let’s say I have chosen a particular second in time from the past nine years. Between November of 2014 and today, I am thinking of a specific (and totally random) year, month, day, hour, minute and second. Could you guess it? No chance? You have a better chance of guessing a specific second from a nine-year span than you have of winning the Powerball.

Last month’s Powerball made headlines for topping a colossal $1.7 billion jackpot, the second largest in the game’s history (the winner hadn’t claimed their prize). Everybody knows that your chances of winning the lottery are slimmer than slim. But when rollover jackpots accumulate to record-size prizes, could the potential massive payout ever offset the rarity of winning? In other words, is the lottery ever a good bet? The answer might surprise you, when even a good bet might turn out to be a bad idea, mathematically.

Mathematicians sometimes separate good bets from bad ones using a concept called expected value. Consider the example of betting on the outcome of a die roll. It costs $1 to pick a number between one and six. If you guess the roll correctly, you win $1 and if you guess incorrectly, you lose your dollar. Would you take that bet? It seems unfair because you stand to win exactly as much as you stand to lose ($1), but you’re much more likely to lose (five out of six rolls lose).

What if it only cost $1 to play, but you would win $100 if you guessed correctly? Suddenly the prize feels large enough to compensate for the likelihood of losing. Some probabilistic reasoning can tell us exactly what cutoff value should make one feel tempted to play and not dismissive.

Clearly the relevant variables are: how much it costs to play, how much you stand to win, and the probability of winning. The expected value of a bet becomes a weighted average where the possible outcomes (winnings and losings) are weighted according to the probability of each occurring:

Expected value of a bet = (probability of winning) x (winning amount) – (probability of losing) x (losing amount)

The solution to this equation reveals how much money you could expect to win (or lose if it’s a negative number) per bet in the long run if you were to make the bet many times. For example, with our dollar bet on the outcome of a die roll, the probability of winning is ⅙, while the probability of losing is ⅚, and we stand to lose or win $1.

Expected value = (⅙) x ($1) – (⅚) x ($1) = –.667

If we took this bet many times, then in the long run we’d expect to lose about 67 cents per bet on average. A similar calculation with the $100 payout yields an expected value of almost $16, clearly a good bet. This framework also allows us to calculate a payout at which the bet is perfectly even, where the expected value over the long run is $0. For a die roll, this equilibrium payout comes to $5 because you’re five times more likely to lose than win; so a reward five times larger than the cost balances out the risk.

Let’s apply the expected value lens to the Powerball. The jackpot starts at about $20 million and a ticket only costs $2. The probability of hitting the jackpot: one in 292,201,338. Crunch these numbers and that lotto ticket has an expected value of about –$1.93. You would get more value out of those two bucks if you traded them for a dime.

This calculation ignores several subtleties for simplicity’s sake. For one, it assumes you take the annuity option, which doles out your winnings in yearly installments for 29 years rather than the lump sum cash payment (the annuity is worth more in the long run). Second, taxes ensure that you never walk away with a full purse. Winning big would slot you into the highest tax bracket, so 37 percent of your windfall would end up going to Uncle Sam (this doesn’t include state taxes, which vary across states). The Powerball also awards smaller prizes for partial matches of the drawn numbers, whereas we’ve only considered the jackpot. There’s one more major consideration I’ve left out that I will discuss below. But factoring all of these details into the math will only make that –$1.93 seem generous—the ticket is actually worth even less.

Still, a $20 million jackpot pales in comparison to last month’s $1.7 billion. If nobody wins the jackpot, the running total prize rolls over into the next drawing. When the pool keeps growing over many consecutive weeks, surely there’s a point at which the overwhelming prize dwarfs the miniscule chance of winning, much like the $100 die reward compensated for the mere one-in-six chance of guessing it. After all, the probability of matching all six numbers doesn’t change and the cost of a ticket doesn’t grow. It turns out that not only are massive jackpots still often bad bets, but they also paradoxically tend to be *worse* bets.

A multibillion dollar payout seems to offset the roughly one-in-300-million chance of winning to yield a positive expected value for a ticket. Indeed, this claim often circulates in the media buzz around mega jackpots. But it overlooks a crucial detail: multiple people could hit the jackpot and therefore split the winnings. We need to add more terms to the expected value calculation to account for all of the possible outcomes, e.g. (probability of holding the *only* winning ticket) x (jackpot) + (probability of splitting the jackpot with one other ticket) x (half the jackpot), etc.

We’ve established that winning the lottery requires overcoming super low odds. Wouldn’t two winners on the same draw entail super *duper* low odds? Sometimes, but when hundreds of millions of tickets are sold, collisions can actually become more likely than not. For example, the first jackpot to ever reach a billion dollars occurred in 2016, and it overachieved at $1.56 billion. The hype surrounding the new record drove a buying frenzy and over 635 million tickets were sold. (That’s over 20 times the number of tickets sold in an average Powerball drawing that year.) With so many tickets in circulation, the probability of more than one winner exceeded 60 percent! Indeed, three winners ended up splitting the grand prize in 2016. When factoring in the total number of players, tax withholdings, and secondary prizes for partial matches, even this gargantuan jackpot didn’t offer a positive expected value. We omitted the pot-splitting detail from our $20 million Powerball expected value calculation above because smaller jackpots draw smaller crowds and carry a more negligible chance of splitting. Plus, at negative $1.93 expected value, we hardly needed another factor to convince us that it was a bad bet.

Side note: the 60 percent figure assumes that ticket numbers are picked at random, which isn’t precisely the case. Even though all sequences of six lottery numbers are equally likely to win, many people handpick their numbers, and they tend to choose sequences that mean something to them like birthdays or anniversaries (which results in many numbers under 31). People also seem to prefer odd numbers and numbers that aren’t multiples of 10, perhaps because they seem more random. This behavior increases the chance of pot-splitting for draws with smaller random-looking numbers, but decreases it for other draws. So, while you can’t increase your chance of your numbers being drawn, you can decrease your chance of splitting the jackpot by choosing large even numbers and including multiples of 10.

The buying manias have subsided since 2016. In fact, the two biggest jackpots in lotto history (last month and last year) attracted few enough buyers that the expected value of a ticket tipped into positive territory, even after adjusting for caveats like taxes and pot-splitting. Lotteries occasionally offer what we’re referring to here as a “good bet.” Smaller state lotteries might even be better places to look for positive expected value, as they tend to generate less hype and sell fewer tickets.

Don’t empty your rainy day fund at the nearest convenience store just yet. Despite conceding that the expected value of a ticket may occasionally look attractive, I’m going to backpedal and explain why I still think the lottery is a bad bet.

Lotteries with positive expected value are rare. And critically, you likely won’t be able to identify it in time to place a bet, because ticket sales numbers don’t get published in advance of drawings. As we’ve seen, larger jackpots don’t necessarily mean larger expected value. So while occasional lotteries offer a good bet, predicting *which* lotteries is a gamble in itself. Even if you could identify them, expected value may not actually be the best proxy for “good bet.” Expected value is useful for medium-sized problems like a $100 die roll, but may not adequately capture all of the relevant considerations in extreme situations like lotteries. Sometimes even a good bet is a bad idea, it turns out.

For one, expected value is premised on long-run behavior. You don’t actually expect to win $16 when you bet on our $100 die roll. In fact, you can’t win $16, you’ll either lose $1 or win $100. The $16 is what you’d expect to win per bet on average if you kept playing repeatedly. Lottery wins are so rare that this long-run average can never realistically be achieved. Second, money loses value as you keep amassing more. Your second $50 million won’t bring you as much joy as your first $50 million. Expected value analysis treats every dollar equally and doesn’t account for the diminishing marginal returns. Relatedly, expected value ignores personal risk aversion. People tend to dislike losing money more than they like winning it. This is why, while expected value is great for mathematical evaluations of probabilistic systems, it doesn’t fully model human psychology and decision-making.

Now to backpedal on my backpedaling: a lottery ticket costs $2. Players aren’t buying an investment, they’re buying permission to fantasize for a couple of days. We all make frivolous purchases and most of them have zero probability of netting us a fortune. The money spent on lottery tickets also doesn’t just get dumped into the ocean. Much of the revenue funds public services like education. There has even been some research suggesting that anticipation from playing the game makes people happy regardless of the outcome. So while I can’t recommend playing the lottery on a mathematical basis, there’s more to a happy life than math. Or so I’m told.

*This is an opinion and analysis article, and the views expressed by the author or authors are not necessarily those of *Scientific American.