Probability with door locks.

AuPik

New member
Joined
Jun 8, 2020
Messages
2
The question goes as follows: We have a door with 2 locks locked with different keys, that need to be unlocked in order to open the door, and we have 10 keys. We choose a key randomly and try it on each lock. After we try a key we discard it. What is the probability that we will be able to open the door on the 5th key ?

the way i tried to solve it is by assigning the probability of opening one lock x = (C(10,4)*C(6,1))/C(16,5)
So opening 2 locks would be x^2

but the anwser is written as 4/45, and in the way i solve it i get an error of ~0.006.
I need help figuring out what is wrong with my solution.
Thanks in advance :)
 
Last edited:
Your logic fails because after you open the 1st lock you now longer have 10 keys to try, so squaring does not work!

What is the probability that the door opens with the 1st key?
What is the probability that the door opens with the 2nd key?
What is the probability that the door opens with the 3rd key?
Keep going until you see a pattern. So what is the probability that the nth key will open the door?
 
Here is a better way to think about it. First consider the 1st 4 keys chosen. You want 3 to be bad keys and 1 key to be good. AND then you want the 5th key to be good. Can you continue from here?
 
Ok, so i get 8/10*7/9*6/8*1/7*1/6 = 0.01111111
first three keys are bad last two are good.
Do i just multiply the anwser by 4*2 based on the fact that the first good key can be in 4 places and both good keys can change positions ?
 
The question goes as follows: We have a door with 2 locks locked with different keys, that need to be unlocked in order to open the door, and we have 10 keys. We choose a key randomly and try it on each lock. After we try a key we discard it. What is the probability that we will be able to open the door on the 5th key ?
We want one of the first four keys tried to work. that is event one, \(E_1\).
Event two, \(E_2\), is that the fifth key tried opens the door.
Now what is \(\mathcal{P}(E_1)\cdot\mathcal{P}(E_2)=?\)
 
Ok, so i get 8/10*7/9*6/8*1/7*1/6 = 0.01111111
first three keys are bad last two are good.
Do i just multiply the anwser by 4*2 based on the fact that the first good key can be in 4 places and both good keys can change positions ?
First of all 8/10*7/9*6/8*1/7*1/6 does NOT equal 0.01111111. Where did you get that from??
 
Ok, so i get 8/10*7/9*6/8*1/7*1/6 = 0.01111111 first three keys are bad last two are good.
Do i just multiply the anwser by 4*2 based on the fact that the first good key can be in 4 places and both good keys can change positions ?
I should have added to reply #5 that the given answer of \(\dfrac{4}{45}\) is correct.
 
It's very easy. The probability to choose the first key during the first 4 trials is [MATH]4/10[/MATH]. The probability that the 5th trial gives us the second key is [MATH]1/9[/MATH] (the first key is already chosen!). Now, since we don't care which of the two keys was chosen first we have to multiply the result by 2. Thus we have as a result: [MATH]2*4/10*1/9 = 4/45[/MATH]!
 
Last edited:
(the first key is already chosen!). Now, since we don't care which of the two keys was chosen first we have to multiply the result by 2. Thus we have as a result: [MATH]2*4/10*1/9 = 4/45[/MATH]!
Did you consider that the OP says "After we try a key we discard it." ?
 
OK. I see some clarifications are needed. Actually I want to reformulate the problem to make it easier to solve. So, let’s consider a number of ordered sets of [MATH]10[/MATH] keys where each key takes a numerated place in a set. There are as many as [MATH]10![/MATH] of such sets. We can choose any set to try the keys of this set on the door. The key on the first place we take first to try it on the door, the key on the second place we take second, and so on. After we try a key we discard it. Now our problem can be formulated as follows: what is the probability to choose such a set that one of the “magic” keys (the one that opens a lock) will be on any of the places 1, 2, 3 or 4 and the second “magic” key will be on the 5th place? We can reformulate the question further, asking what is the probability to prepare such a set randomly? Let’s see how we can prepare such a set. For this let’s begin with the first “magic” key. So, place it randomly on any of the 10 empty places. Obviously, the probability that this key will be on any of the places 1 to 4 is [MATH]4/10[/MATH]. Now, we take the second “magic” key and place it randomly on the 9 empty places left after the first key is placed. The probability that this key will be on the 5th place is [MATH]1/9[/MATH]. The probability that the first “magic” key will be on any of the places 1 to 4 AND the second “magic” key will be on the 5th place is [MATH]4/10*1/9[/MATH]. Since we don’t care which one of the “magic” keys will go first we want to multiply the found probability by 2. Thus we have finally: [MATH]2*4/10*1/9 = 4/45[/MATH]. (The distribution of the other keys is absolutely irrelevant and doesn’t influence the found probability)
 
Last edited:
Top