Lottery is a type of gambling in which prizes are allocated by chance. Prizes may be money, goods or services. The modern lottery arose from ancient practices such as drawing lots for military conscription and commercial promotions in which property (e.g. merchandise) is given away by a random procedure, or for the selection of juries from lists of registered voters. By contrast, games such as keno and bingo, where players choose numbers from a pool to win a fixed sum, are not usually considered lotteries because the player is not paying for a chance at winning the prize.
People buy lottery tickets because they enjoy the thrill of the possible win and they indulge in a fantasy of becoming wealthy. There is also a belief that people will always gamble, so states should enact lotteries to capture this inevitable gambling.
The earliest known European lotteries were held during the Roman Empire to raise funds for public works projects and distribute gifts to the guests at Saturnalian dinner parties. The winners of these lotteries were rewarded with objects of unequal value, such as fancy dinnerware.
In the 19th and 20th centuries, state governments created lotteries to raise revenue for a variety of public usages. They saw them as a painless alternative to higher taxes on the middle class and working classes.
The purchase of lottery tickets can be explained by decision models based on expected value maximization, as well as by more general utility functions defined on things other than the lottery results. However, it is unlikely that the expected value of monetary loss for any individual will be outweighed by the entertainment and other non-monetary gain from buying a ticket.