This article does not cite any sources. (December 2009) (Learn how and when to remove this template message)
Early lotteries were done by drawing numbers, or winning tickets, from a container. In the UK, numbers of winning Premium Bonds (which were not strictly a lottery, but very similar in approach) were generated by an electronic machine called ERNIE.
Types of machines
Most lotteries use mechanical lottery machines. These are more interesting to watch, and more transparent, both literally and figuratively: the audience can see exactly how the internal workings of the machine operate, and they can watch the balls come out of the machine; generally, the balls are visible during the entire draw.
A "gravity pick machine" has a drum with rotating arms inside; the drum itself may or may not rotate. A number of balls, each bearing a possible winning number, are dropped into the drum while it is spinning. A hole on the side or bottom of the drum allows the balls to drop onto a tray, one at a time (the tray is generally inclined so as to allow the numbers to go to the end and allow the other balls to fall into place). Machines of this type are used in many games, such as the American games Mega Millions and Powerball. See the UK National Lottery.
A similar method is used to draw numbers from a manually operated bingo cage; a weighted cup catches the ball, which drops it onto the tray as the cage is rotated. This variant was at one time used by the Pennsylvania Lottery, the New Jersey Lottery, and the Illinois Lottery; in this variant, a cover is placed strategically, so as to obscure extra balls drawn beyond the number called for by the game matrix.
Another type of lottery machine has a fan in the bottom that blows the balls around the inside of the container. The winning numbers go up and out through a tube. This is mostly used in "pick 3" and "pick 4" games, however, it is occasionally used in "lotto" games. In the latter case, either several tubes are in the container, or a single tube is used, and the ball is mechanically pushed onto a tray.
Though similar in style to the latter type of "air mix" machines, those currently used by the American Powerball game do not use air mix; it is more in tune with a "gravity pick" machine, with the mixing paddles at the bottom of the machine. As the mixing paddle slows down, the ball lands on a pedestal, where it is carried to the top of the machine and then pushed onto the tray. On rare occasions, a similar machine is used in a "pick 3" or "pick 4" game.
Random number generator
Some lotteries use computerized random number generators, either alongside or in place of a mechanical draw machine. These are more "cost-effective": with mechanical equipment, machines and balls have to be replaced periodically. However, these are not as interesting to watch, and may give a player a sense that the lottery is being rigged.
Because of the massive payoff for a successful cheat (especially after the 1980 Pennsylvania Lottery scandal where drawing balls were rigged to draw a certain number of results), lottery machines are subject to strict security measures. In some cases there are several machines and several sets of balls, and the combination to be used is selected at random just before the draw.