Friday’s Mega Millions jackpot has crossed the $1 billion mark, and the math nerds are getting excited.

If a lottery jackpot is high enough, it is theoretically possible that it’s mathematically advantageous to buy a ticket. For the next 10 years, however, until President Trump’s tax bill expires, that magical jackpot number required is smaller.

(A caveat before we get into this: at low numbers, this is merely a thought experiment. You would need a ton of tickets for this to apply meaningfully.)

**The math behind the lottery**

To start with, a simple definition of the value of a lottery ticket is the jackpot multiplied by the probability of winning. In an ultra-simple lottery with a $6 jackpot, where the winner is drawn from the roll of one die, a ticket would be worth $1 because it would cost six tickets to guarantee a $6 win. (6 x [1/6] = 1.)

If this theoretical lottery had a ticket price of 75 cents, you would do well to play this game. And, if possible, buy every number combination. You would spend $4.50 and be guaranteed $6.

This is the thinking behind the math. If the potential payout per ticket — the “expected value” — is greater than the sticker price, it’s mathematically advantageous to play.

But when the jackpot gets enormous, something special happens: the expected value rises significantly – because the odds stay the same. That’s what makes this Mega Millions interesting. It’s important to remember that while the pot grows like a raffle, the odds never go down as more tickets are sold.

**The Trump tax cuts factor**

Imagine a simplified example with only the Mega Millions jackpot, whose odds are 1 in 302,575,350, and whose tickets cost $2.

In this case, for the expected value of each ticket to be worth the ticket price, you would need to have a $605 million jackpot. (You can check this by theoretically imagining how much you’d need to buy every ball combination, and divide by the jackpot.)

But it’s not that simple, even when you ignore other prize amounts, which raise the value of each ticket and lower the required break-even jackpot.

That’s because taxes will claim a hefty chunk of the winnings, which means the jackpot would actually have to be much higher to make the math work.

How high? According to this in-depth analysis I did a few years ago for Powerball — which is much the same for Mega Millions — the magic jackpot number for a $2 expected value is probably around $2.3 billion. Or more, given the fact that the odds are now worse than they used to be.

This year, however, is better than last year for those who hit it big. That’s because it’s the first year Trump’s tax plan has been implemented – so now the top-tier tax bracket is 37%, not 39.6%

For potential lottery players, this actually moves the expected value down a decent amount. Adjusting for the new tax bracket, the golden number would fall to around $2.1 billion.

There is one wrench that gets thrown in here, however, which is that the tax cuts expire in 2028, meaning that this would only work if they were renewed, or if the jackpot *cash *number climbs high enough. Winners can choose the full jackpot in a decades-long annuity, or a lump sum of around 60% of the jackpot.

It’s unlikely that even a $3 billion jackpot would result in hedge funds running to the 7/11.

**The lottery’s Achilles heel**

None of the math really works, however, if you have to split the jackpot. This happens frequently, because people tend to pick the same numbers. Humans are very bad at selecting random numbers even when they want to, and birthdays and lucky numbers usually steer folks into the same picks.

This high likelihood of a split-factor makes a good case that playing when the jackpot is high is too late. It’s crowded.

But it may not be crowded everywhere, which is also why the jackpot keeps getting pushed week to week.

Higher, unloved numbers are just as statistically likely to come up, but people tend not to pick them. But if your ugly number combination does come up, and you did pick them, you are in a much better place, with the jackpot to yourself. If five people have picked the same numbers as you, you will divide the jackpot five ways.

So if you want to maximize your chances: play higher numbers over 31, use a random number generator, and play the highest jackpot to odds ratio as possible.

But even if you lose, you can still have fun. After all, for a mere $2, you can make everyone be nice to you. What if you win?

–

**Ethan Wolff-Mann*** is a writer at Yahoo Finance focusing on consumer issues, retail, personal finance, and more. Follow him on Twitter **@ewolffmann**.*