A lottery is a form of gambling in which people pay to buy tickets, and win prizes if they match a series of numbers drawn at random. It is a popular way to distribute money and other goods, and is often used to provide units in subsidized housing, kindergarten placements, or sports team roster spots. Despite the widespread popularity of lotteries, they are not without controversy. Whether or not they are ethical, they raise important questions about the ability of government at any level to manage an activity from which it profits, especially during an anti-tax era when state governments are constantly facing pressures to increase their revenue streams.

There are a few elements common to all lotteries: A selection process for allocating prizes, which may include drawing a set of numbers, selecting symbols from a pool or collection of counterfoils, or other mechanisms. A pool or collection of tickets and their counterfoils must first be thoroughly mixed by some mechanical means, such as shaking or tossing; this helps to ensure that chance rather than skill determines winners. Computers are increasingly used for this purpose, as they can quickly store and randomly select a number of tickets at once.

Finally, there must be a mechanism for collecting and pooling all the money paid as stakes. Most states do this by establishing their own lottery division, which will typically establish retailers and license them to sell and redeem tickets, train employees of these retailers to use lottery terminals, help them promote lottery games, pay high-tier prizes, and generally ensure that both players and retailers comply with state law and rules.