How is randomness achieved in mechanical slot machines?

That could be, depending on 1) What determines the speed of the spinners, and 2) what determines when the spinners stop. Neither of which I have been able to find out.

The video I provided may have been too long, but look at the reel discs on this page.

You will notice that the wear marks are mostly not circular but relate to the payout finger locations and those holes.

This is a more complicated model with a special reward that may make it clearer.

In that blog post each “finger” relates to a “win” if all three holes line up for any one finger.

  1. Cherry
  2. Orange
  3. Plum
  4. Bell
  5. Melon
  6. Bar

This video may help see how that sets the odds.

And this video will show you the relationship between the kicker and the timing bar.

Assuming you know that your kicker is working correctly the ratio of when the timing bars stop the reels, which is a function of the clock, and the number of payout holes on those payout discs directly relates to the payout ratio.

Note that in the type in those photos and videos the notches on the payout wheels are not what stops the individual reels but is an overall lock, the wheel brakes on each wheel stop it based on timing from the above mentioned timing bar.

On the old, mechanical slots this is how they produced a reliable 2/5 or 3/6 payout as variations in the system would not impact the ratio of the clock applying the brake to the kicker’s rotation while still being “random” enough to encourage players to continue playing.

As long as the kicker is within spec the speed of the spinners doesn’t matter for the overall odds, because the timing bar stops the wheels in a deterministic fashion that ensures that the payout ratio is really close to the intended values.

Obviously the higher payout later games are far more complex.

Any casino owner or slot machine manufacturer whose payout rate was more consistent than what you’d get from a true random machine would very quickly find himself in prison, and any PRNG that produces less drift than true random is a terrible PRNG.

Theoretical Hold Percentage is what matters, and not some randomness and there are accounting/audit procedures when the spread of that MTH exceeds 4% in the systems I have worked with.

But it gets complicated and jurisdiction specific when you deal with Class II machines, where the outcomes are centrally determined and are sometimes called video lotto machines and Class III where the results are locally determined.

In general the Casino owner has absolutely no control over the odds, it is the manufacture who gets individual games approved in most locations that would be in trouble.

But the mathematical probabilities of the Theoretical Hold Percentage min/max isn’t even close to being restricted to most modern games in a “real random” way as many of the more popular games are Wide Area progressive systems to increase the max jackpot.

The delta from the par/paytables is what counts, and while I can’t seem to find an easy online link to this you will see even the federal indian gaming commission rules are close to that of Nevada.

Here is a link to some of the Nevada rules

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

I should clarify, a large number of play results needs to meet the chi square test but most regulators care about that distribution of a large sample, not any true randomness.

In a few cases methods of ensuring a product hitting that curve exposed patterns people exploited.

I know someone who is an engineer for a company that makes casino games (can’t give you the name because he doesn’t want any attention from anyone and neither does his company) but he told me once that regardless of what anyone in a casino may tell you, every time a machine pays off The Big One, that machine is immediately taken off the floor and shipped back to his company, where it is examined to see What Went Wrong.

I suspect in some sort of twisted way it’s not really 'random" at all.

For some reason which I can’t remember, in situations where true randomness was required, physical noise generators (which you could buy and fit to your computer) were normally used as the input to pseudorandom number generator algorithms, rather than as direct output devices.

Now that there is a much greater need for random number generators, it is more common to use other environmental inputs, which, when mixed together, are pretty noising and hard to control. Last I heard, even systems with physical noise generators typically mixed in other environmental inputs, because they could, and to avoid single-point-of-failure problems.

The Vegas casinos were notoriously superstitious: they didn’t want people/machines, with “bad luck”. “Notorious” in that other operators weren’t quite so unsettled.

:confused: “MTH”?

Sorry “Max Theoretical Hold”, While I am unable to share the name, and I only know about the products directly related to my previous employer I actually wrote and maintained gaming programs for a gaming vendor way back in the mid 90’s Sometimes the TLAs spill out.
As I only worked for one company I have a very limited perspective, and am not claiming expertise by stating that historical point.

I can say, mostly because it is way too impractical and unusable, that in the search for reliable, unhackable entropy source we did consider a Beta emitter until we dug into the regulatory requirements for the rather large one which would provide the rate we needed. This was an entropy source, not a seed or gameplay source, but a source to help pick seeds.
I have designed par sheets to and volatility indexes etc… from scratch though. The house always has and edge, and gaming should always be viewed as entertainment.

While some shady practices like algorithms that purposefully increased the number of near-miss outcomes are illegal, reel layouts that produce frequent near misses are OK. And as people almost always re-play any small return in the hopes of hitting the big jackpot it is fairly safe to have a game that pays out 8/10 or better because the house wins over time.

The games are not rigged to be unfair, but the experience is often constructed to play off of peoples innate fallacies and biases. There is really no need to protect against shady games from the players account, who is going to be paying anyway. It is typically either protecting the house from organized attempts to game the system or the state trying to protect tax revenue.

The player has lost by choosing to play in first place, and casino only need needs the patient in order to come out ahead. The risks in trying to manipulate the odds that are already in their favor is of little or no benefit for them compared to the risks. People who do try this are stepping over dollars to pick up pennies.

What they need to do is to keep you playing (e.g. free drinks, cheap food, etc…) and help you forget that you are spending money. Most of the shady practices in progressive slots like marking losses as “wins” really have the goal of keeping you in front of the machine.

Correction on “The games are not rigged to be unfair” , they are unfair by their very nature, they are not rigged to cheat past their design odds.

Certainly it is possible to design a game that uses a physical noise generator along with other environmental noise, possibly seeding a secure pseudorandom number generator if necessary. It is not very difficult. However, rat avatar’s link described slot machines (“older models”) with a crappy PRNG easily defeated in real time by some guy with an iPhone. Is that purely due to incompetence by the manufacturer? It made me wonder what are the relevant industry standards.

Not quite, there are two aspects of PRNGs: quality and security. A cryptographically secure PRNG has a lot of really stringent requirements that boil down to “a user with no knowledge of the internal state must not be able to guess the next number (at frequency better than random).” Quality relates to how close the values you generate are to actually random.

An example of a non-CS, low-quality PRNG is Xorshift which does a bunch of Xor and bit shifts on a seed to generate random numbers, but you can expect a lot of bad clumping and exploitability. A PRNG can be high quality and not CS. For instance, Mersenne Twister is not (unless modified) crypto secure, but does generate numbers nearly random.

You may ask how a user could guess the pattern if the results are random or close enough? A lot of ways (not limited to just that page either). Slots have a lot of advantages – guards to stop you from analyzing too much, no direct access to the output, no ability to manipulate the input (a slot pull is a slot pull), but there are still ways with some advanced mathematics you could take a sufficiently insecure one apart. Given there have been a few figured out once they get stolen and such, my guess is they generally don’t see the need to protect it super duper well. Probably because of said “guards” issue.

It’s usually bad form to reseed an RNG every time you use it based on external inputs. If you were to do this it’d be much better to use things like hardware noise, thermal temperatures, background radiation sensors, whatever. These can still be fooled but would be significantly harder in a casino setting. It usually requires physical access to the device while it’s booting to set these things up.

Input noise is used a lot in older video games and while you’d think it’d be nearly impossible, many speedrunners can reliably, with practice, pull of RNG manipulations that require pressing specific buttons fractions of a second after the title screen or whatever.

It’s mostly pointless now because almost every OS has a true RNG built in based on startup noise (which isn’t perfect, but is hard to subvert), so you can just draw a value from that source and use it as your RNG seed. Obviously this doesn’t apply to online casinos, it’s a security nightmare to allow users to run your RNG code on their own devices – that’s a server side thing, but for video games that prevents cheating without actively memory editing pretty handily. However, you can easily use something like this for the embedded computers in slots, a lot of open source code is available since variations of it exist in every Ubuntu-derived OS with /dev/random which is the computer’s stream of “truly random” noise.

Simple example of why you don’t want to re-seed every time: Suppose that you use as your seed the number of milliseconds since the computer booted up. Now suppose that you ask for another number less than a millisecond later. You’ll get two identical “random” numbers.

Re-seeding every time is tantamount to not using a PRNG at all, which would actually be OK if the rate (bits/s) of randomness flowing into the system is at least equal to the rate at which the application consumes random data. That may be reasonable for a fruit machine, but, in practice, if you use a textbook secure PRNG then re-seeding is handled automatically and you don’t have to estimate and possibly misjudge exactly how much entropy is collected from the environment.

Not necessarily, since running it through the PRNG once will (mostly) erase any pattern in your source of seeds. For instance, you could safely re-seed every time with the number of milliseconds since the computer booted up, if you know that you’re never going to be drawing multiple random numbers a millisecond apart. But if you just used the number of milliseconds itself as your random number, then you’d get “random” numbers that were monotonically increasing, a very obvious nonrandom pattern.

You would never use the raw inputs as such anyway; at the very least you would do something like append the input to the previous seed and apply a cryptographic hash function, in which case your “random” numbers would not form an obvious pattern. Also, you would save your seed file between boots; why lose carefully collected random bits?

Why a chi square test?

Well, that depends on what you’re using it for. In most (non-gambling) games, for instance, you can get away with a very low quality of randomness, and don’t need very much of it. For such a purpose, you probably can actually get away with something quick-and-dirty like the time fed through a linear congruence generator. Though there are often actual advantages to a PRNG over true randomness, in a context like that: For instance, if you’re working on a tough FreeCell layout, you can tell the guy at the next desk over what the game number is, and see how well he does at it, and the computer can come with 65k different but consistent layouts, without having to use enough storage to actually store all of them.

Many modern regulations in gaming like in Nevada with local generation require that the PRNG is running all of the time and then the interaction with the controls just selects a rolling sequence as a source of entropy.

This does make the fit to a normal distribution more complicated, but not knowing the values that were dropped makes it far harder to determine the seed.

In most parts of the country these terminals are electronic scratch tickets, so the payout distribution is created in a virtual roll of tickets, and those tickets are selected in a random fashion or pulled from a centralized location which adds entropy. The in order central location becomes problematic if there is a slow period and someone can ensure that the are anywhere close to the same player.

The PRNG is typically more related to families like Blum Blum Shub than the typical random() language call if the computational cost is acceptable which it may not be on a centralized pool of machines, although the inter-state pooled jackpots are an exception that I should call out, they cannot have a central determined game due to the wire act.

Re-seeding may be used in some solutions but would be difficult due to regulations and the primary need for a normal distribution. Even outside of the need to match payout metrics customers are less comfortable with products that have higher volatility indexes which this would produce in addition to some issues provided in other responses.
Randomness of the selection along a normal distribution is the important part here as the normal distribution is what makes the game “fair” and not a true randomness.