Lottery is a popular way for governments to raise money for public projects, and it has been around for centuries. The Old Testament has Moses instructing the people of Israel to divide land by lot, and Roman emperors used it to give away property and slaves during Saturnalian feasts. At the outset of the Revolutionary War, the Continental Congress voted to establish lotteries as a way to fund the Colonial Army. But the broader popularity of lottery games persists today, even in states that don’t have an urgent need for money.

In addition to state lotteries, there are private ones, including the Powerball and Mega Millions. Regardless of the type, they all operate in roughly the same manner: People purchase tickets and then hope that their numbers are drawn. Those numbers are picked from a set of numbers such as birthdays, ages, or sequences like 1-2-3-4-5-6. Some prefer to select their own numbers, while others opt for “quick picks,” which choose the numbers at random.

Despite the wildly long odds, most people feel a sense of meritocratic hope that they will win someday, and they often spend substantial portions of their incomes on tickets. This can surprise observers, who might expect that lottery players are irrational and don’t know that the odds are against them. But the reality is a bit more complicated. A number of things can make the odds look much worse than they actually are, and some states have begun to address these issues.