Lottery Math: A Tax on People Who Skipped Statistics Class

I don't judge anyone for buying a lottery ticket. For a few dollars, you buy a few days of daydreaming about telling your boss exactly what you think. That's entertainment, and entertainment costs money.
But let's look at the maths, because the maths is beautiful and slightly devastating.
How unlikely is "1 in 14 million"?
In a classic 6/49 lottery, you pick 6 numbers from 49. The number of possible combinations is:
from math import comb
print(comb(49, 6)) # 13,983,816
One ticket gives you one of nearly 14 million combinations.

To feel it: imagine a road trip of about 14 million steps, roughly 10,000 kilometres, enough to cross Canada from coast to coast. Somewhere along that walk, one specific step is the winner. You get to pick one step. Good luck.
Expected value: the number lotteries hope you never calculate
Expected value is the average result if you played forever. For a lottery:
expected value = Σ (probability of each prize × prize) − ticket price
Lotteries are designed to pay out less than they take in, because that's how they fund prizes, operations and public programmes. So the expected value of a ticket is always negative. On average, a $3 ticket is "worth" maybe half its price or less, depending on the game.

"But someone has to win!"
True. Someone does win. The problem is that "someone" is a specific person out of millions. This is the lottery fallacy: confusing "it's likely that someone wins" with "it's likely that I win."
The patterns that don't help
- Lucky numbers and birthdays. Every combination is equally likely, but birthdays cluster in 1–31, so if you win, you're more likely to share the jackpot with other birthday-pickers.
- "Hot" and "cold" numbers. Each draw is independent. The balls don't remember last week.
- 1-2-3-4-5-6. Exactly as likely as any other combination. Also very popular with people who know that, so you'd share the prize.
Jackpot rollovers change things (a little)
When jackpots roll over and become enormous, the expected value of a ticket improves. In rare cases, it can even look positive on paper, until you account for taxes in some countries, annuity vs lump sum, and the high chance of splitting the prize with many other buyers who also noticed the giant jackpot.
How to play responsibly
- Treat it as entertainment with a fixed budget, like a movie ticket.
- Never "invest" in lotteries or chase losses.
- If it stops being fun or starts being a plan, talk to someone. Gambling problems are common and help is available.
The statistics lesson
If you put $3 a week into a lottery for 40 years, you'd spend about $6,240 and most likely win back a fraction of it. Put the same $3 a week into a diversified investment, and at historical average returns it could grow into many times that. Neither will buy you a yacht. Only one of them is likely to buy you a nice holiday at retirement. Daydreaming, however, remains free.