0

Imagine a slot machine that generates random numbers between $1$ and $100$. Each number has the same probability of being selected as the others. When $1$ billion attempts are made on this slot machine, we expect that each number must have been chosen an average of $10$ million times. But when we run this machine, we see that number $100$ is selected $30$ million times. How can I calculate the probability that the machine is cheating or malfunctioning? For example, if The probability that the number $100$ will be chosen $30$ million times is $10^{-15}$, can we say that probability of the machine cheating or malfunctioning is $1 - 10^{-15}$ ?

Jeremy Miles
  • 17,812
  • Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to. –  Aug 29 '23 at 06:39
  • If you can reject the hypothesis that the frequencies are as promised by showing that the probability that the observed result occurs is very small , assuming the machine works correctly (in most cases $0.01$ is enough) , then you can (with a small fallacy probability) assume that the machine is cheating or defect. The billion attempts is however highly unrealistic. In practice , you will rather make , say , $2\ 000$ spins. –  Aug 29 '23 at 08:26
  • Thi is not the right approach. Key word: Hypothesis testing. – callculus42 Aug 29 '23 at 09:44
  • There are many statistical tests for random number generators. See, e.g., https://stackoverflow.com/questions/2130621/how-to-test-a-random-generator –  Aug 29 '23 at 12:45
  • I try to find probability of cheating. –  Aug 29 '23 at 21:06
  • 1
    @HakanEgne to find the probability of "cheating" you would need to use a Bayesian approach. – Matthew H. Aug 30 '23 at 02:11
  • I tried but I couldnt use Bayes theorem. Very difficult to find variables –  Aug 30 '23 at 13:14
  • You cannot "find the probability of cheating", that is not well-defined. The best you can do is a statistical test. This test will have some probability of correctly identifying fair machines as fair, and some probability of correctly identifying unfair machines as unfair (this is the "power" of the test, and is really a family of probabilities, one for each way the machine can be unfair). – Mike Earnest Aug 30 '23 at 15:33
  • 1
    You cannot find the probability of the machine "cheating" if you have no information about the distribution followed by the machine, in the same way that you cannot calculate $a + b$ if you have no information about $a$ or $b$. –  Sep 02 '23 at 01:20
  • 1
    The comments are correct and helpful. To appreciate them better, consider reading over our thread on the meaning of p-values and statistical tests. – whuber Sep 02 '23 at 14:27

0 Answers0