Reading the Wikipedia article about slot machines, it looks like nobody is using fixed reels that just do what they do. The machine controls the next result and shows whatever it wants to show at the time. This feels like a reasonable model.

In other words, while the model can contain “reels”, they don’t always spin the same number of symbols, or a random number of symbols. Instead, the machine knows the result it wants to show and spins to that result (essentially “cheating”).

Because I know nothing (at all) about a payout table design or reel design, I will start really small. Two symbols, one reel. X pays, Y doesn’t. I want 95% payout. X pays ¤10 (this symbol is the currency sign). One play is ¤1. If we play 1000 times, we pay ¤1000, and expect to win back ¤950, so 95 times out of 1000 we should be getting X, and the rest of the time we should be getting Y. The machine could use a random number generator (with output between 0 and 1), then spin to X when the value is <= 0.095 (= 95 / 1000).

OK, this is too simple. Let’s have something a bit more involved:

  • Two symbols, X and Y
  • Two reels
  • YY doesn’t pay
  • YX doesn’t pay
  • XY pays ¤5
  • XX pays ¤20
  • Looking for 95% payout
  • Play is ¤1

I’m looking for P(YY), P(YX), P(XY) and P(XX). I know that \[ P(YY) \times 0 + P(YX) \times 0 + P(XY) \times 5 + P(XX) \times 20 = 0.95 \] and that \[ P(YY) + P(YX) + P(XY) + P(XX) = 1 \].

There are clearly many solutions here. For example: \[ P(YY) = P(YX) = 0.42 \] \[ P(XY) = 0.15 \] \[ P(XX) = 0.01 \]

It’s solvable. It means that 84 times of 100 we should see YY or YX, winning nothing, 15 times XY winning 5 (75 in all) and 1 time XX (winning 20 in all). Overall we would win 95 from 100 spins, so 0.95. We can now build a machine that uses these probabilities and it would seem reasonable.

But this is hard work. What happens when we have 11 symbols, 5 reels and a payout table for 2, 3, 4 and 5 symbols, with 20 pay lines? We still have exactly 2 equations: one for the expected payout (total 0.95) and one for the sum of probabilities (1).

There’s something else here as well. In the example above, the probabilities are pretty arbitrary. I could have taken P(XX) = 0.04 and P(XY) = 0.03 and it would have worked: 4 out of 100 I win 20 (80 in all) and 3 out of 100 I win 5 (15 in all) and in total 95. But this feels wrong - winning a bigger prize happens more often than winning a smaller prize.

So some options are:

  • 19 of 100 win 5, 0 of 100 win 20 (19/0 -> 19)
  • 15 of 100 win 5, 1 of 100 win 20 (15/1 -> 16)
  • 11 of 100 win 5, 2 of 100 win 20 (11/2 -> 13)
  • 7 of 100 win 5, 3 of 100 win 20 (7/3 -> 10)
  • 3 of 100 win 5, 4 of 100 win 20 (3/4 -> 7)

Something needs to balance this. We don’t want to win bigger prizes at a higher probability because it’s much nicer to win something 16 times out of 100 than 7 times out of 100. But we also don’t want to win 19 times out of 100 because we like a “jackpot”.

What if the probability was proportional to the inverse of the payout? In that case, \( P(XY) = {c \over 5}, P(XX) = {c \over 20} \): \[ 5P(XY) = c = 20P(XX) \] \[ P(XY) = 4P(XX) \] \[ P(XY) + 4P(XX) = 0.19 \] \[ 8P(XX) = 0.19 \] \[ P(XX) = 0.02375 \] \[ P(XY) = 0.095 \]

So now we have:

  • 9,500 out of 100,000 we win 5 (47500 in total), 2,375 times out of 100,000 we win 20 (47500 in total), overall we win 47,500 + 47,500 = 95,000 and that’s our 95%.
  • 88,125 out of 100,000 we win nothing
  • The chance of winning 5 is exactly 4 times the chance of winning 20

This feels like a good result.