Official lottery is a form of gambling in which the organizers sell tickets for chances to win prizes. These prizes can range from cash to goods to services. Prizes are usually determined through a drawing that takes place at regular intervals. Typically, the tickets are thoroughly mixed by some mechanical means, such as shaking or tossing; this is to ensure that chance alone determines the winners. Computers are also increasingly used for this purpose.

Regardless of the method, there are certain elements that are common to all lotteries. The first is the pool, or collection of tickets or their counterfoils from which winners are drawn. The second is a set of rules governing the frequency and sizes of prizes. Finally, the third is a system for collecting and pooling the money paid as stakes. A percentage is normally deducted for the costs of organizing and promoting, and the remainder is awarded to winners.

The history of lotteries is a complex one. They were originally a form of public entertainment and a way to finance large public works projects, such as road building or the construction of the Sydney Opera House. By the 1800s, however, religious and moral sensibilities were turning against them. It was also easy for corrupt lottery organizers to pocket the money without awarding the prizes, as Denmark Vesey proved when he won a local Charleston lotteries and used it to purchase his freedom in 1822.

Lotteries in modern times are typically regulated by state governments, though some are national in scope. They may offer both a variety of games and a set of prizes that are unique to each game, such as the Powerball jackpot or the Mega Millions prize pool. In addition, some have special rules regulating their operations, such as requiring independent auditing or banning players who have criminal records.