How is randomness achieved in mechanical slot machines?

Possibly the same one I am currently working for :cool:

It would be the company that owns the assets of the one I worked for, but it is highly likely you work with the same people, as it is a tiny industry.

But hopefully you appreciate my tortured attempts of simplifying the complex parts (regulation) while also honoring a disclosure agreement that mostly puts new UI’s on the same old games. :slight_smile:

I am still confused as to the precise regulations. You seem to be saying that the results of the game need not be actually random, they just have to pass a chi-squared goodness-of-fit test? On the other hand, truly random, or close to it, results would pass any test for randomness one would care to pose, so how could “difficulties” or “volatility” arise in that case? (Besides the difficulty cheaters would have to know the results in advance.)

Picture a game of Roulette run that way; the gamblers would riot!

Roulette, card games and other physical games are much different, as far as regulations, but as the dope is bad about doing math, read through here.

https://www.cse.wustl.edu/~jain/cse567-08/ftp/k_27trg.pdf

But this is far from secret info, like I said this is codified in many of the regulations.

https://gaming.nv.gov/modules/showdocument.aspx?documentid=2919

I can’t think of any new thinking regarding PRNG’s in the past 30 years (in the open literature, probably military had that much earlier). Anyone re-inventing the wheel will most probably invent a bad wheel.

So:


Next_rnd := Hash (current_rnd || any_slightly_true_random_source);


Hash could be SHA256

any_slightly_true_random_source can be the low bits of the processor time, when real-time events happen (like pushing buttons or receiving comm data). Even better, take a A/D converter with an open input or an input connected to the ambient audio or FM noise or whatever. The beauty with proper crypto functions is that they will distill any entropy out of a slightly random source.

Even a $2 controller of 1990 vintage could make thousands of such computations a second.

For achieving a given win ratio just look at the lowest (say) 10 bits; if their value is less than n, than you have a n/1024 chance to win.

All the above appears in most introductory undergraduate courses on cryptography.

Note: outrage for losing money from a process that is known to lose you money, when it matches the rate that they say you will probably lose money seems a bit distance from the pitchfork rules.

If you are playing these games for anything but entertainment you are not considering the odds.

Here is a link to a fairly typical accountants view of the numbers.

http://www.indiangaming.com/istore/Dec15_Ashley.pdf

Notice how the conversation is pretty close to any other consumer product or service, particularly related to the references to the reinvestment percentage.

This is no different than any other company, and a higher volatility index increases risks and typically people will only accept higher risk if it also has higher returns. As the returns rate on most of these machines is 90%+ the margins simply are not large enough to accept high risk without a higher return, which would require lowering the perks or the payouts which impacts your ability to offer a competitive products against organizations that choose games with a lower volatility index.

Actuaries drive this process, and consumers willingness to play is the primary reason that they will typically be willing to accept risk at all.

If you do the math on most Games of Skill like poker, you will see that the house will typically take a percentage of the play and players will typically bet in a parimutuel fashion.

Games like roulette have a built in house edge of around 5%, this is exactly the same result as what I described where the odds are stacked in favor of the casino. Casinos do not beat the players because they get lucky but because of that built in advantage.

This has always been true for “lawful” gambling where the house always wins in the long run and the more you play the closer your losses will mirror the average take. Note this is on the amount you bet, not the amount you lose at the casino.

I don’t think it’s the amount of money spent on the game that people find objectionable, it’s the use of “random” number generators like the following:

Suppose there are 100 possible outcomes. To generate the next number x[sub]n+1[/sub], compute

x[sub]n+1[/sub] ≡ x[sub]n[/sub] + 1 (mod 100).

According to the link you have provided, this is in full compliance with the Technical Standards for Gaming Devices and Associated Equipment concerning software random number generators, provided I call it 100 times per second and not use a static seed upon initialization.

On second thought, in a slot machine people wouldn’t find it objectionable. On the contrary, that particular machine would bring in loads of happy customers.

These machines have way more outcomes, as an example of a progressive game that has the PAR sheet available due to a researchers FOIA requests.
“Lobstermania’s five reels have 47, 46, 48, 50, and 50 symbols, yielding a total of 259,440,000 possible combinations.”

They need those number of combinations to provide the large jackpots which is the point of the progressive slots, compare it to other options.

I don’t know how to protect the formatting but as an example you can see how the max payout relates to typical house edge.

Game - House edge - max win ratio

Blackjack - 0.5% - 3:2
Roulette - 5.26% - 35:1
Tradtional slots - ~0-15% - 5,000:1
progressive slots ~5-17% - 1,000,000:1+
MegaMillions - 50%+ - 100,000,000:1+
As Roulette was mentioned, the chances for a Straight up win or landing on any single number on a US wheel is 37:1 and the max payout is 35:1.

That doesn’t sound that bad, but the “hold” or the average percentage of money originally brought to the table that the house gets is ~20-30% in Atlantic City semi-averaged over a couple of monthly charts. The house hold on slots is not typically that high, but I am having a hard time collecting info on progressives and post loyalty club era stats. But the point is that less volatile games, even when using a normal distribution over a random chance actually end up costing the consumer less because the play can be tighter.

But as I mentioned above, people don’t play because they understand the math, but because of various fallacies.

If you play without mistakes blackjack and video poker will give you the most play time with the lowest losses, but the potential take is also much lower.

Although it may seem counter-intuitive the chi-squared distribution tests actually allows both companies and the state to catch anomalies and cheating where a true random model would be much harder to validate and is actually in the interest of the consumer.

Not only that but demanding “true random” results only makes sense if you are committing the Monte Carlo Fallacy

Gamblers think that because a coin has hit heads 11 times in a row that there is a greater than 50% chance that it will be tails the next flip, but really the odds don’t change.

If the regulation requires audits to be close to matching normalized curve, it will be more likely to pay out in one sense, but the house edge will still stay the same over time, but the volatility goes down. In the case of class II and really in class III it allows them to provide more free drinks, entertainment etc…too. Which is becoming a larger part of the industry than the games themselves over time too.

In the case of class II that experience is the differentiation between spending money with them vs sitting at the local gas station serially buying scratch tickets.

I think it’s great hearing your explanations. I have a small circle of contacts in The Company who have given me many insights into how these things work. I enjoy knowing more about the “other side” of the machines - I’m the field guy that installs them :wink:

You have to be really careful with modulo in computer random number generation. Unless your modulo number is a power of two, you actually have an uneven distribution. It’s not usually a big deal (it’s very slight unless your range is extremely large), but a lot of random number packages have functions that accept a min and max value that do the legwork to properly make it uniform for precisely this reason.

I don’t know about others, but when I say “true random” I’m referring to the PRNG itself, not the actual underlying payout distribution. It’s easier for the casino to properly weight payouts if your PRNG is truly random IMO. This is a common random weight algorithm that only works properly assuming a uniform random distribution



weights = [20, 40, 40]
max_weight = weights.sum()

roll = next_int(0, max_weight)

acc = max_weight
index = None
for (choice,weight) in enumerate(weights):
    acc -= weight
    if acc <= roll:
        return choice


Have an actual uniform PRNG is just much easier to deal with if you’re trying to fix odds.

I remember from school that the digits in numbers like *pi *and *e *(appear to) have a random distribution, why are they not used to generate randomness? Pick a starting point, say the 271.345th digit after the decimal point and get your randomness mathematically. Perhaps not the best solution for the slot machines, as the starting point might be easy to find out and use to win big, but why not for other uses?

I mean, if you’re gonna do that you may as well just collect true random numbers from background radiation and bake them into your executable. There’s no reason you can’t do things like this other than it being predictable the second someone figures out what the list is.

Some techniques, like Monte Carlo integration, do not require truly random numbers, but in that case you can use something computationally simple like a linear congruential generator. One problem with digits of pi is that it takes longer and longer to compute (even binary) digits the farther out you start.

If you need pseudo-random numbers that are unpredictable (apparently not a requirement in Nevada casinos!), what you can do is, e.g., take a random seed as your key and use a cryptographic block cipher in counter mode, that is, each time you increment a counter by 1 and output the data E(K, n).

The digits of pi and e are not only not random, but they’re as far from random as it’s possible to get, because you can predict all of them, an infinite number, from a finite and in fact very small rule. If the casino’s “random” number generator starts by generating 3, then 1, then 4, then 1, then 5, then 9, then 2, I’m going to bet heavily on 6.

If you always use the same starting point, you will always generate the same sequence of “random” numbers, so that’s useless. So you would have to vary the starting point in an unpredictable, random way. If you can reliably generate a random number to give you the starting point, then just use that algorithm to directly generate PRNs. No need to add a level of indirection by using digits of pi.

True random and PRNG are Mutually exclusive terms, a PRNG is 100% deterministic and sources of true entropy are almost impossible to find.

I do not know anything about sources of True Entropy, but in practice what you want are multiple sources that are at least a little unpredictable that you can harvest and combine, not all of which are under the control of your adversary. Feed those into a machine and you should be good to go, even if a (secure) PRNG is used. At that point I would be more worried about someone physically tampering with the machine.

Which is exactly the same for PRNG’s.

By “true random” in this context I mean “assuming you do not know the internal state, the observed probability of rolling a fair die with the PRNG is as close to uniform is possible”. Of course it’s not truly random like background radiation and such is.

(Or perhaps “as close to the results you’d expect while observing true entropy as possible”)

You want “assuming that you do not know the internal state, but that you do know all of the other outputs so far, and that you also know what algorithm is used”. Someone could get ahold of an actual slot machine and disassemble it (both on a hardware level and on a software level) to see exactly how it works, and someone could watch a slot machine for a very long time to see what it’s been doing, and even if someone does both of those, you still don’t want them to have any edge.