Toy Slot Machine

Lift some coins to the slot, then pull the handle. Press bet buttons to change the stakes. (The mobile version is under construction.)

PAY TABLE
Line Pay
three sharks 200x
other three of a kind 20x
two of a kind 2x

Payout Percentage Calculation

There are 3 reels, each with 10 symbols, so the sample space consists of 1000 equally likely outcomes. There is only 1 way to get three sharks. There are 9 ways to get a different three of a kind. To get two of a kind, there are 3 possible configurations **-, *-*, or -**, times 10 ways to choose the doubled symbol times 9 ways to choose the other symbol. To get 3 different symbols (worth nothing) there are 10 times 9 times 8 ways. These counts are summarized in the 'Number of Outcomes' column of the calculation table below.

The probability of each event is the number of outcomes for the event divided by the total number of outcomes.

The values are taken from the pay table.

CALCULATION
Event Number of Outcomes Probability Value Expected Value Calculation
three sharks 1 1/1000 200 200/1000
other three of a kind 9 9/1000 20 180/1000
two of a kind 270 270/1000 2 540/1000
three different 720 720/1000 0 0
TOTAL 1000 1 N/A 920/1000

The expected value of 920/1000 is found by multiplying each value by its probability and summing. The expected payout for this slot machine is 92%.

Random Number Generator

This toy slot machine uses a Lehmer random number generator The formula chosen is

Xk+1 = 1111 * Xk mod 3001.

Since 3001 is prime, and 1111 is a primitive element of the units of Z 3001, the formula cycles through all 3000 units: {1,2,3,...,3000}. The first element or seed is given by

X0 = (t mod 3000) + 1

where t is the number of milliseconds since January 1, 1970.

On each spin, the random number is taken mod 1000 so that the cycle of 3000 provides each number in {0, 1, 2,...,999} exactly 3 times. This then determines the spin. For example 123 -> (dog, crow, mouse). (Preceeding zeros are added when it is not a 3-digit number.)

Empirical Testing

It is one thing to calculate a theoretical payout percentage, but to see if that percentage is realized in practice, it is necessary to do a large number of spins. To this end, pressing the Generate Spins button bypasses the 3D model, and taps directly into the random number generator. The resulting spin history is displayed opposite the model as before.

One press of the button simulates starting with 100 coins, and playing until either there are more than 100 coins, or no coins left.

SPIN HISTORY


< Return to home page.