Tl;dr

It is only worth investing when the Jackpot size is larger than the odds of the lottery.

For example, it’s only worth investing when the jackpot is larger than $292,201,338 for Power Ball.

Similarly, for Mega Million, only invest when the jackpot is larger than $258,890,850.

Background

In 1956, a researcher in Bell Labs named J.L.Kelly, Jr described a formula to determine the optimal size of a series of vets in order to maximise the logarithm of wealth.

Formula

For simple bets with two outcomes, one involving losing the entire amount bet, and the other involving winning the bet amount multiplied by the payoff odds, the Kelly bet is:

**f***is the fraction of the current bankroll to wager, i.e. a lottery ticket.**b**is the net odds received on the wager ("b to 1"). In this case, it'd be the lottery prize.**p**is the winning odds.**q**is the probability of losing, which is 1 − p.

It'd only be wise to invest the ticket when the expected payoff (prize * winning odds) is greater than the losing odds.