-2
$\begingroup$

A random number generator generates a number between 0-9. Single digit, totally random.

We have the list of previous digits generated.

I would like to calculate what is the probability for each number between 0-9 to be the next number generated.

So we have something like: 0,2,3,4,6,4,9,1,3,5,8,7,2 generated

And would like to get something like

  • nr: probability to come next
  • 0: 10.125%
  • 1: 9.25%
  • 2: 6,58%
  • 3: 9.58%
  • 4: 6.23%
  • 5: 9.23%
  • etc

Thank you very much!

  • 1
    If the random number generator is "totally random", any past generation shouldn't impact the next, no? (all digits proba being 1/10)2017-01-03
  • 0
    LaTeX is needed to make this readable, if you wouldn't mind...2017-01-03
  • 1
    Based on the 'memoryless property' of random events, the probability for each is always 10%2017-01-03

2 Answers 2

2

Assuming this is a uniform distribution, each number is equally likely. That is, $\Pr(X=n) = \frac1{10}$, for $n=0,1,2,\ldots,9$.

The expected value for the next number, regardless of the history, is always $$E[X] = 0(\tfrac1{10}) + 1(\tfrac1{10}) + \cdots + 9(\tfrac1{10}) = 4.5$$

although that's pretty meaningless.

It's like rolling a fair 10-sided die.

2

After the given sequence $0,2,3,4,6,4,9,1,3,5,8,7,2$:

$$ 0: 10\%\\ 1: 10\%\\ 2: 10\%\\ 3: 10\%\\ 4: 10\%\\ 5: 10\%\\ 6: 10\%\\ 7: 10\%\\ 8: 10\%\\ 9: 10\%\\ $$


If you want to detect bias in the generator, i.e. not all digits appearing with the same frequency, then you can estimate the distribution, which is conveniently done with a histogram. An estimator of the distribution is given by the empirical frequencies (count in a bin over total count).

Note anyway that the variance of these estimates is relatively high, so that it takes a large number of drawings to get accurate values. (https://en.wikipedia.org/wiki/Multinomial_distribution)

If your goal is to check "fairness" of the generator, you should have a look a the Chi-squared test https://en.wikipedia.org/wiki/Pearson%27s_chi-squared_test#Test_for_fit_of_a_distribution.

  • 0
    @ringø: if I was wrong, there should be a suitable probabilistic model somehow describing the correlation between the drawings.2017-01-03
  • 0
    Well, I wondered if the OP isn't suggesting the generator is actually not really fully random... despite the "totally" ...2017-01-03
  • 1
    @ringø: I'd rather imagine that the OP has the "popular" intuition of a dependency between the drawings, even if "totally" random. Again, if there is such a dependency, it must be described by a model because there can be many types of dependencies, giving different behaviors.2017-01-03
  • 0
    Some people think indeed that the "loto" past drawings may affect the next...2017-01-03
  • 0
    @YvesDaoust Yeah that's probably right. I was under an impression that if the number 5 was drawn 2500 times in a row then it's slightly less likely to draw number 5 again in the next round.2017-01-03