# Thread: Random Number Generation 1-100 odds

1. ## Random Number Generation 1-100 odds

I have a random number generator that I am trying to prove is "broken". It randomly generates numbers from 1 to 100. However in 50 attempts, it has not generated a single number over 85. So I guess the question is, what are the odds of randomly generating a number (1-100) 50 times in a row and never generating a numbers 86 through 100?

On the programming end, there's 4 catagories; like 1-60 produces a D, 61-85 produces a C, 86-95 produces a B, and 96-100 produces an A. And B or A are NEVER generating. So I'm trying to figure out if it was a QA test, are the odds of this happening outstanding enough that the programming end should be looked into .

2. Originally Posted by shorte
I have a random number generator that I am trying to prove is "broken". It randomly generates numbers from 1 to 100. However in 50 attempts, it has not generated a single number over 85. So I guess the question is, what are the odds of randomly generating a number (1-100) 50 times in a row and never generating a numbers 86 through 100?

On the programming end, there's 4 catagories; like 1-60 produces a D, 61-85 produces a C, 86-95 produces a B, and 96-100 produces an A. And B or A are NEVER generating. So I'm trying to figure out if it was a QA test, are the odds of this happening outstanding enough that the programming end should be looked into .

The probability of randomly generating a number (1-100) 50 times in a row and never generating a numbers 86 through 100 is $(0.85)^{50}=2.96\times10^{-4}$, which is very small.

3. Originally Posted by shorte
I have a random number generator that I am trying to prove is "broken". It randomly generates numbers from 1 to 100. However in 50 attempts, it has not generated a single number over 85. So I guess the question is, what are the odds of randomly generating a number (1-100) 50 times in a row and never generating a numbers 86 through 100?

On the programming end, there's 4 catagories; like 1-60 produces a D, 61-85 produces a C, 86-95 produces a B, and 96-100 produces an A. And B or A are NEVER generating. So I'm trying to figure out if it was a QA test, are the odds of this happening outstanding enough that the programming end should be looked into .

You can form a binomial model.

$p=0.85$

$q=0.15$

$(p+q)^{50}=\binom{50}{0}p^{50}+\binom{50}{1}p^{49} q+\binom{50}{2}p^{48}q^2+.....+\binom{50}{50}q^{50 }$

The first term is the probability of getting a number from 0-85 on all 50 generations.

4. Thanks for the help. I hate to ask more, but could you help me "translate" this? If I am correct, the actual math comes to 0.000296. Is that like a 30,000th of a percent? 300th of a percent? does that make the 'odds' something like "1 in 300' or '1 in 30,000'? Sorry im just not a tad smarter in the catagory, but I greatly appreciate the help.

5. Originally Posted by shorte
Thanks for the help. I hate to ask more, but could you help me "translate" this? If I am correct, the actual math comes to 0.000296. Is that like a 30,000th of a percent? 300th of a percent? does that make the 'odds' something like "1 in 300' or '1 in 30,000'? Sorry im just not a tad smarter in the catagory, but I greatly appreciate the help.
Yes,

a probability of 1 is 100% certainty, a probability of 0.1 is 10% or 1-in-10,

0.01 is 1-in-100, 0.001 is 1-in-1000, 0.0001 is 1-in-10,000

so a probability of 0.000296 is 2.96-in-10,000 or 1-in-3,378 approx.