A lottery is a gambling game in which chances are sold for the chance to win prizes that can be money or goods. The winners are selected by a random drawing. The prizes may be small items or large sums of money. The games are generally regulated to ensure fairness and legality.

In the modern sense, the first European lotteries appear in 15th-century Burgundy and Flanders with towns attempting to raise money for town fortifications or to help poor citizens. Francis I of France introduced public lotteries for profit and other purposes in many cities in the 1500s. These public lotteries were the predecessors of modern casinos and state-sponsored lotteries.

Modern economics studies have found that the purchase of lottery tickets cannot be explained by decision models based on expected value maximization. However, more general models based on utility functions defined on things other than the probability of winning can explain some lottery purchases.

The word lottery is derived from the Latin lupus, meaning “fate.” Lotteries have long been used to determine the distribution of property and rights. The Old Testament contains dozens of references to distributing land and other assets by lot, including the granting of slaves to the Roman emperors by lottery.

The winner of a lottery is awarded the prize in a lump sum or as an annual payment, depending on the rules. The New York Lottery offers lump sum payments, as well as annual annuity payments, which are paid in installments over time. Most winners choose to receive the lump sum, as it gives them more control over how their prize is invested and avoids income taxes.