# Random Number Generator

• Oct 7th 2008, 01:57 PM
Obsidantion
Random Number Generator
If a random number generator generated random numbers between 1 and 5 (including both) until it generated a 5, what is the chance that no number before then will have been generated more than once?
• Oct 7th 2008, 02:21 PM
icemanfan
It should be clear (by the pigeonhole principle) that the five must be generated no later than fifth in the sequence if each other number is to have been generated only once.

Then either the five is generated first, second, third, fourth, or fifth.

P(1) = 1/5

P(2) = (4/5)x(1/5)

P(3) = (4/5)x(3/5)x(1/5)

P(4) = (4/5)x(3/5)x(2/5)x(1/5)

P(5) = (4/5)x(3/5)x(2/5)x(1/5)x(1/5)

Just add up the probabilities from there.
• Oct 21st 2008, 06:01 AM
Obsidantion
Nice one. I think this is correct.
• Oct 22nd 2008, 01:22 AM
CaptainBlack
Quote:

Originally Posted by Obsidantion
If a random number generator generated random numbers between 1 and 5 (including both) until it generated a 5, what is the chance that no number before then will have been generated more than once?

This looks vaguely familiar, it may have been asked elsewhere on MHF recently.

CB