Make sure your slot machine has a good pseudorandom number gen

  • Thread starter scottdave
  • Start date
  • Tags
    Machine
In summary, the pseudorandom number generators in certain slot machines have been found to be vulnerable to attack.
  • #1
scottdave
Science Advisor
Homework Helper
Insights Author
Gold Member
1,984
963
TL;DR Summary
Here's a 22 minute podcast about how some Russian "hackers" figured out how to cheat some slot machines.
In this NPR podcast (Planet Money) they describe how the cheaters figured out the pseudorandom number generators in a certain model of slot machine. I found it interesting and entertaining.
 
  • Like
  • Informative
Likes Tom.G and .Scott
Technology news on Phys.org
  • #2
And it appears the vulnerability has not been fixed.
 
  • #3
I listened to that, and it was interesting. Thanks for sharing.

This is naive, amateur ideas about random and encryption are always naive. But why do they use a pseudo random number generator in the first place?

We could have a 24 bit counter driven by a 1024 K Hz oscillator. The counter would cycle every 16 seconds. The "random" number would be the instantaneous clock value at the instant that the lever was pulled. No human could time their muscle movement with 1024K precision.

That is fundamentally different than a computational algorithm because the non-repeatability of human muscle movement is the basis.
 
  • Like
Likes Klystron
  • #4
anorlunda said:
We could have a 24 bit counter driven by a 1024 K Hz oscillator. The counter would cycle every 16 seconds. The "random" number would be the instantaneous clock value at the instant that the lever was pulled.
Really?
 
  • #5
anorlunda said:
We could have a 24 bit counter driven by a 1024 K Hz oscillator. The counter would cycle every 16 seconds. The "random" number would be the instantaneous clock value at the instant that the lever was pulled. No human could time their muscle movement with 1024K precision.
No, but if you were aware of the cycle you could certainly bias the results within a small enough range to distort the odds significantly in your favour. You would need a much smaller cycle time for this to work, perhaps 1ms, which would limit the range of values to c. 1,000 with a 1MHz oscillator.
 
  • #6
pbuk said:
You would need a much smaller cycle time for this to work, perhaps 1ms, which would limit the range of values to c. 1,000 with a 1MHz oscillator.
I don't see where the cycle (wrap) time comes into play. The result is changing 1024 K times per second.

Each 2n possible bit values must map to a 3 digit selection of m possible slot machine symbols. As long as 2n >> m3, n doesn't matter much.
 
  • #7
anorlunda said:
As long as 2n >> m3, n doesn't matter much.
That would be true but a typical modern casino machine might have 5 reels with 50 symbols on each so it's going to take ## \dfrac{50^5}{1,024^2} \mathrm{s} \approx 5 \mathrm{min} ## to cycle through the combinations.
 
  • #8
pbuk said:
That would be true but a typical modern casino machine might have 5 reels with 50 symbols on each so it's going to take ## \dfrac{50^5}{1,024^2} \mathrm{s} \approx 5 \mathrm{min} ## to cycle through the combinations.
Interesting. But even if it did take 5 minutes, what is the probability of a user timing his pull exactly enough to hit one of the winners? Each number is active for only 1/1024K seconds, about one microsecond. Isn't that the important part? Not the time to cycle all possibilities.

So even if I know a winner is due in about 1 second from now, what is the probability I can hit the exact microsecond ?
 
  • #9
anorlunda said:
So even if I know a winner is due in about 1 second from now, what is the probability I can hit the exact microsecond ?
Not great, but even with 1 second accuracy in 5 minutes you can improve your odds by a factor of 300.
 
  • #10
anorlunda said:
This is naive, amateur ideas about random and encryption are always naive. But why do they use a pseudo random number generator in the first place?
In some cases that's part of a legally mandated professionally code-reviewed strategy for making the return rate (the 'hold' percentage) predictable and settable.
 
  • Like
Likes pbuk and anorlunda
  • #11
I had thought of the idea of randomly pulling a number from the clock, but not to get the actual random number, but to seed a pseudorandom generator.
 
  • #12
scottdave said:
I had thought of the idea of randomly pulling a number from the clock, but not to get the actual random number, but to seed a pseudorandom generator.
That's a not-uncommon PRNG tactic.
 
  • #13
sysprog said:
In some cases that's part of a legally mandated professionally code-reviewed strategy for making the return rate (the 'hold' percentage) predictable and settable.
It would have been more accurate had I said "the retention level(s)" instead of "the return rate" -- in the vernacular of slot machine gaming, the 'hold ' percentage is the percentage retained; not the percentage returned.
 
  • Like
Likes anorlunda
  • #14
sysprog said:
In some cases that's part of a legally mandated professionally code-reviewed strategy for making the return rate (the 'hold' percentage) predictable and settable.
I think you nailed it. Whatever the shortcomings, a PRNG algorithm can be analyzed and its characteristics well characterized. Better more random schemes might be implementation dependent and thus hard to analyze and prove.
 

Related to Make sure your slot machine has a good pseudorandom number gen

What is a pseudorandom number generator (PRNG)?

A pseudorandom number generator is a computer algorithm that produces a sequence of numbers that appear random, but are actually determined by a starting value known as a seed.

Why is it important for a slot machine to have a good pseudorandom number generator?

It is important for a slot machine to have a good pseudorandom number generator because it ensures that each spin is fair and unbiased, giving all players an equal chance of winning. A poor PRNG can result in patterns or predictability, making the game less fair.

How can I tell if a slot machine has a good pseudorandom number generator?

Unfortunately, as a player, you cannot determine the quality of a slot machine's PRNG. This information is typically kept confidential by the casino and gaming industry. However, reputable casinos and gaming companies use well-known and tested PRNG algorithms to ensure fairness.

Can a pseudorandom number generator be manipulated?

Yes, a PRNG can be manipulated by someone who has access to the source code or knows the algorithm used. This is why it is crucial for casinos and gaming companies to use secure and well-tested PRNG algorithms to prevent any manipulation.

What are some examples of commonly used pseudorandom number generators?

Some commonly used PRNG algorithms include Linear Congruential Generator (LCG), Middle Square Method (MSM), and Blum Blum Shub (BBS). These algorithms have been extensively studied and tested to ensure randomness and fairness.

Similar threads

  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
2
Replies
39
Views
4K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
430
Replies
5
Views
1K
Replies
2
Views
605
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
  • STEM Academic Advising
Replies
9
Views
1K
Replies
28
Views
2K
Replies
10
Views
2K
Back
Top