A lottery is a game in which players pay a small amount of money to have a chance at winning a larger sum. The prize money is typically awarded by a random drawing of numbers. In some cases, a percentage of the proceeds are donated to charity.

Lottery isn’t just a form of gambling—it’s also been used to distribute subsidized housing units and kindergarten placements. It was once hailed as a painless way for states to fund social services without the heavy burden of taxes on middle-class and working-class families.

People who play the lottery aren’t irrational, as the stereotype implies. Instead, they get a fair amount of value out of their ticket purchases, even if the odds are extremely long. For example, the purchase gives them a couple of minutes or hours or days to dream, to imagine what they’d do with the money if they won. For those who don’t have a lot of prospects in the real world, that may be enough to justify the expense.

There’s no single national lottery, but some consortiums organize games spanning multiple jurisdictions and carry larger jackpot prizes. A common strategy is to increase or decrease the number of balls in a lottery in order to change the odds, which can help drive ticket sales. If the odds are too low, someone will win the lottery every week and the prize pool won’t grow; if they’re too high, ticket sales will drop.