Solving for n, n is an exponent.

3k Views Asked by At

If you have a sequence of random numbers ranging between 1 and 64, what is the length of a sequence that will give a 98% chance of having at least one ( 1, 2, or 3) in the sequence?

Here is the way I am currently thinking about this.

The probability of getting a (1,2 or 3) is 3/64.

Since we are looking for "at least" one, it is easier for us to find the probability of a random number not being a (1,2 or 3). The probability of that is obviously 61/64.

If we have for example two random numbers in a sequence, the probability of the first not being a (1,2 or 3) is 61/64 and the probability of the second not being a (1,2 or 3) is also 61/64. To find the overall probability that at least one is a (1,2 or 3) we can calculate it as the following. P = 1 – ( (61/64) * (61/64) )

To generalize for a sequence of length n we get P = 1 – ( (61/64) ^ n )

Since we want the know the amount of numbers that would give us a 98% chance of having at least one (1,2 or 3), we can plug in the following and solve for n.

0.98 = 1 – ( (61/64) ^ n )

I am however stuck at this point and unaware of how to solve for n (well without using a program or calculator.) Can anyone explain the correct way to solve for n here? Would it be correct to use (log)?

2

There are 2 best solutions below

0
On BEST ANSWER

Your logic is fine all the way to the final equation. Now isolate the term with $n$ on one side and take logs: $$\left(\frac {61}{64}\right)^n=1-0.98=0.02\\n \log \left(\frac {61}{64}\right)=\log 0.02\\n=\frac{\log 0.02}{\log \left(\frac {61}{64}\right)}$$

1
On

Yes, logs are the way. First change your equation by bringing the 1 and the 98% together: $$ \left( \frac{61}{64} \right)^n = 0.02 $$ Then take logarithms: $$ n\log \frac{61}{64} = \log (0.02) = -\log(50) $$ And solve for $n$: $$ n= - \frac{ \log(50)}{\log(61) - \log(64)} = \frac{ \log(50)}{\log(64) - \log(61)} $$ Unfortunately, you need a log table to find those logs -- or do you?

You can figure out what this is without resorting to log tables if you remember three things that most math-intelligent experienced people know:

  • $e \approx 2.72$
  • $\ln 2 \approx 0.69$
  • For small $x$, $\ln (1+x) \approx 1+x-\frac{1}{2}x^2$

The trick would be to write $$\ln(50) = 2\ln 5 + \ln 2 = 2(\ln 2 + \ln(\frac{5}{2}) ) + \ln 2 =3\ln 2 + 2 \ln \frac{5}{2} = 3\ln 2 + 2 + 2 \ln \frac{5}{2e} $$ and carry those calculations to 2 decimal places, noting that $\frac{5}{2e}$ is close to 1 (easy arithmetic). Then once you have $\ln(50) \approx 3.91$ the denuminator can be written as $$\ln \frac{64}{61} \approx 1+\frac{3}{61} - \frac{9}{8192}$$. And when you divide you get $$ n \approx 81.55$$ (the actual answer is about $81.48$).

Last step - you want the probability to be at least 98% so you have to round up, giving the answer $$n = 82 $$