A lottery is a gambling game in which numbers are drawn for prizes. It’s also a way for governments to raise money for things like schools and public works projects. People spent upward of $100 billion on lotteries in 2021. States are promoting the games as ways to raise money for children. But the true costs of these games deserve scrutiny.

Federal law defines a lottery as a game in which you pay for a chance to win a prize, which could be money or something else. It’s illegal to operate a lottery without the payment of consideration. And you can’t sell a ticket by mail or over the phone. State and local laws vary, but generally retailers are required to keep a percentage of the ticket sales for themselves. The rest goes to administrative and vendor expenses and toward whatever project the state designates.

Most people who play the lottery do so on a regular basis, often selecting the same numbers each week. A survey found that people who played more than once a week were likely to be high school educated and middle-aged men living in middle class families. These regular players are entrapped by the gambler’s fallacy, the myth that their chances of winning increase the longer they wait between losing streaks.

Lottery advertisements often portray the prizes as being a last, best or only chance at a better life. These messages may help explain why people continue to purchase tickets even though they know their odds of winning are long.