The lottery is a public competition in which people purchase tickets for the chance of winning prizes. Its earliest recorded use dates from the 15th century in various towns in the Low Countries, where it was used to raise money for town fortifications and for the poor.
Its popularity has been attributed to its ability to generate large amounts of revenues, with little cost to players. Its establishment has followed a consistent pattern: it is monopolized by the state; the agency or corporation that runs it begins operations with a modest number of relatively simple games; and revenue increases gradually as new games are added to the pool.
Despite their popularity, however, it is important to keep in mind that lotteries are gambling and should be considered as such. The purchase of a lottery ticket cannot be accounted for by decision models that assume that the price of a ticket equals expected value.
But it can be accounted for by models that consider non-monetary gain. Some people play the lottery because they enjoy the sense of hope that a win may bring, and they feel that they can only get that from the lottery.
The lottery also provides a source of entertainment, which could be more valuable than the monetary gain from a winning ticket. This form of gambling is therefore a legitimate source of revenue, as long as the non-monetary gain outweighs the disutility associated with a monetary loss.