[Math] Probability of guessing a password.

probability

the question is roughly this;

A bank requires you to have a 4 digit pin, and a 6 digit/ character password which includes lower and upper case letters. Upon logging in the bank requests 3 digits from your pin and 3 digits from your password, what is the probability some will access your bank account in 3 attempts?

For the pin, the probability is $\frac{1}{1000}$, and for the password the probability is $\frac{1}{62\cdot62\cdot62}=\frac{1}{238328}$.

The probability of guessing both correctly and access the bank account is $\frac{1}{238328000}$.

The solution states that because you have three attempts, the probability to access the account is $$\frac{3}{n}=\frac{3}{238328000}.$$

I think this is wrong however, and the reason is because you wouldn't try the same guess another two times so I think the correct answer is actually, $$\frac{1}{238328000}+\frac{1}{238327999}+\frac{1}{238327998}.$$

Who is right?

Best Answer

The solution is right and does assume three different guesses.

The probability to succeed at the first attempt is

$$\frac1{238328000}.$$

Then in case of a failure, the probability to succeed at the second attempt is $$\left(1-\frac1{238328000}\right).\frac1{238327999}=\frac1{238328000}.$$

Finally, a third attempt is successful with probability

$$\left(1-\frac1{238328000}-\frac1{238328000}\right).\frac1{238327998}=\frac1{238328000}.$$


The probability to succeed simply grows linearly as the number of attempts over the number of possibilities, and reaches one at exhaustion.