# Random Number Generation 1-100 odds

• Jan 28th 2011, 12:37 PM
shorte
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 .

• Jan 28th 2011, 12:44 PM
alexmahone
Quote:

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.
• Jan 28th 2011, 01:34 PM
Quote:

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.
• Jan 30th 2011, 11:52 AM
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.
• Jan 30th 2011, 12:01 PM