# Question of counting and probability

Alexsandro
Could someone help me with this question ?

There are two locks on the door and the keys are among the six different ones you carry in your pocket. In a hurry you dropped one somewhere.

a) What is the probability that you can still open the door ?

b) What is the probability that the first two keys you you try will open the door ?

a)2/3
b)4!/6!

eNathan
Why do you need help if you gave the answer?

Staff Emeritus
Gold Member
If you want help on the problem, you're going to have to show us what you've done.

Alexsandro
doubt

eNathan said:
Why do you need help if you gave the answer?

I found this question in a book of probability. I am not obtaining to model the problem to arrive the indicated reply. Could you help me to answer this question or to do some hint?

Homework Helper
Imagine yourself in the situation. You have 5 keys for 2 locks (you have to open Lock1 AND Lock2 simultaneously.) I guess it is possible that the same key can open both locks. As soon as both locks are opened you can stop and not try the rest of the keys.

Homework Helper
I would start with a tree diagram. First node ("the root") is the first key on Lock1, you have 2 branches: opened L1, did not open L1. Coming out from each of these branches you have 2 new branches: opened L2, did not open L2. Then you move on to the 2nd key, K2. If K1 opened L1 then you don't need to try K2 on L1. If K1 opened L2 then you don't need to try K2 on L2. Now you can make new branches for K2. And so on.

Homework Helper
Alexsandro said:
Could someone help me with this question ?

There are two locks on the door and the keys are among the six different ones you carry in your pocket. In a hurry you dropped one somewhere.

a) What is the probability that you can still open the door ?

Let K1, and K2 denote events defined as follows:

K1 = the key you dropped is the key for lock #1

K2 = the key you dropped is the key for lock #2

Here are two solutions:

solution #1

P(can still open door) = P(~K1 AND ~K2)
= P(~K1)*P(~K2|~K1)
= (5/6)*(4/5)
= 2/3

where the symbol '~' is the NOT operator (e.g., ~A = NOT A), and P(A|B) is the conditional probability of A given that B has occurred. Recall that P(A and B) = P(A)*P(B|A) for independent events this reduces to P(A and B) = P(A)*P(B), since P(B|A) = P(B) if A and B are independent events.

solution #2

P(can still open door) = P(~K1 AND ~K2)
= P(~(K1 OR K2)) by de Morgan's Law
= 1 - P(K1 OR K2) complement rule
= 1 - [ P(K1) + P(K2)]
= 1 - [ 1/6 + 1/6]
= 1 - 1/3
= 2/3

Note that for these calculation I have assumed that no key unlocks both locks, and that each lock can be unlocked by only one key.

For de Morgan's Laws goto http://mathworld.wolfram.com/deMorgansLaws.html

Alexsandro said:
b) What is the probability that the first two keys you try will open the door ?

Let U1, and U2 denote events defined as follows:

U1 = the first key you try unlocks lock #1

U2 = the second key you try unlocks lock #2

A solution is:

P(first two keys open door) = P(can still open door AND U1 AND U2)
= P(can still open door)*P((U1 AND U2)| can still open door)
= (2/3)*P(U1 | can still open door)*P(U1 |(can still open door AND U1))
= (2/3)*(1/5)*(1/4)
= 1/30

where P(can still open door) = 2/3 is from the answer to part a is used and P(A and B) = P(A)*P(B|A) has been generalized to

P(A and B and C) = P(A)*P(B|A)*P(C|(A and B))

This method of solution, however, does not appear to be the desired one as the cited answer is 4!/6! = 1/30.

Alexsandro
benorin said:
Let K1, and K2 denote events defined as follows:

K1 = the key you dropped is the key for lock #1

K2 = the key you dropped is the key for lock #2

Here are two solutions:

solution #1

P(can still open door) = P(~K1 AND ~K2)
= P(~K1)*P(~K2|~K1)
= (5/6)*(4/5)
= 2/3

where the symbol '~' is the NOT operator (e.g., ~A = NOT A), and P(A|B) is the conditional probability of A given that B has occurred. Recall that P(A and B) = P(A)*P(B|A) for independent events this reduces to P(A and B) = P(A)*P(B), since P(B|A) = P(B) if A and B are independent events.

solution #2

P(can still open door) = P(~K1 AND ~K2)
= P(~(K1 OR K2)) by de Morgan's Law
= 1 - P(K1 OR K2) complement rule
= 1 - [ P(K1) + P(K2)]
= 1 - [ 1/6 + 1/6]
= 1 - 1/3
= 2/3

Note that for these calculation I have assumed that no key unlocks both locks, and that each lock can be unlocked by only one key.

For de Morgan's Laws goto http://mathworld.wolfram.com/deMorgansLaws.html

Let U1, and U2 denote events defined as follows:

U1 = the first key you try unlocks lock #1

U2 = the second key you try unlocks lock #2

A solution is:

P(first two keys open door) = P(can still open door AND U1 AND U2)
= P(can still open door)*P((U1 AND U2)| can still open door)
= (2/3)*P(U1 | can still open door)*P(U1 |(can still open door AND U1))
= (2/3)*(1/5)*(1/4)
= 1/30

where P(can still open door) = 2/3 is from the answer to part a is used and P(A and B) = P(A)*P(B|A) has been generalized to

P(A and B and C) = P(A)*P(B|A)*P(C|(A and B))

This method of solution, however, does not appear to be the desired one as the cited answer is 4!/6! = 1/30.

------------

Thanks