Question
A locksmith has five labelled keys, exactly two of which open a cabinet. The first technician selects one key uniformly at random and tries it. If it fails, that key is removed from the set. If it succeeds, the key is returned to the set. A second technician then chooses uniformly from whatever keys remain and tries one key; the second technician has not seen the first attempt.
You are told only that the second attempt succeeded. What is the probability that the first attempt failed?
Get hint
Hint 1
Split histories by whether the first key worked. The second draw is from four keys in the failure branch and five in the success branch.
Check your answer
Solution
Let \(F_{1}\) be first-attempt failure and \(S_{2}\) be second-attempt success. Initially 3 of 5 keys fail and 2 succeed, giving \(P(F_{1})=3/5\) and \(P(F_{1}^{c})=2/5\).
If the first key fails, it is one of the three nonworking keys and is removed. Four keys remain, of which two work: \(P(S_{2}\mid F_{1})=2/4=1/2\). If the first key succeeds, it is returned, so all five keys remain with two working ones: \(P(S_{2}\mid F_{1}^{c})=2/5\). The full probability of second success is
\[P(S_{2})=(3/5)(1/2)+(2/5)(2/5)=3/10+4/25=15/50+8/50=23/50\].
The joint probability \(P(F_{1}\cap S_{2})=(3/5)(1/2)=3/10=15/50\). Bayes' rule gives \(P(F_{1}\mid S_{2})=(15/50)/(23/50)=15/23\approx0.65217\). This posterior exceeds the prior failure probability 3/5 because a failed first attempt removes a dud and raises the second attempt's chance of success. Assuming the second attempt is always a fresh one-of-five draw would miss the result-dependent change in sample space.
Assumptions
The five keys are distinguishable, exactly two work, and each technician chooses uniformly from the currently available set.
A failed key is removed permanently before the second attempt; a successful key is returned.
There are exactly two attempts and no additional information about the first is revealed.
Final Answer
\(P(\text{first failed}\mid\text{second succeeded})=15/23\approx65.22\%\).