How long would it take to land on $\frac{1}{10^8}$ if a random number was selected every second?

64 Views Asked by At

I am making a program to basically pick a number from $1-100$ million per second I would like to know how long would it take to land on $1$. I could just run this program to see but I predicted that would be over a year is there any formula to calculate this?

1

There are 1 best solutions below

0
On BEST ANSWER

The number of times you need to pick a number is described by a geometric distribution with success probability $p = \frac{1}{10^8}$.

If you're asking about the expected number of trials until success, this is given by the expected value of this distribution, which can be calculated as $\frac{1}{p} = 10^8$. So your expected waiting time is $10^8$ seconds, which is a bit over 3 years.