We have a key ring with 6 keys, but only one key opens the door. We test the keys to the door with no preference until we find the right key. Now we have two different cases:

1) At the first case when a key is not the right one we discard it and try the next one until we find the right one.

2) At the second case we have amnesia so when we try a key and its a wrong one we put it back in the key ring and we start again from the beginning to find the right key.

For both cases find the probabilities to: How many tries we will need in average, and the probability to find the right key exactly at the 4th try.

  • 2
    $\begingroup$ What have you tried so far? Can you break the problem down into smaller parts? Can you think of a simpler version of the problem that you can try solving first? $\endgroup$ – Elliott May 4 '14 at 17:12

For 1), let X be the number of tries. Then E(X) is the expected number of tries. Recall that $E(X)=\sum_{x=1}^{x=6}xP(X=x)$.


For 2) if you pick the correct key, it's a success and if you don't it's a failure. Let p be the probability of a success. Then $p=\frac{1}{6}$. So, you should notice that $X is Geometric(p)=Geometric(\frac{1}{6})$.

Now, you know that for a Geometric Distribution, $E(X) = \frac{1}{p}=6$
Finally, $P(X=4) =(1-p)^3p$

  • $\begingroup$ yes i know what geometric distribution is. $\endgroup$ – Aggelos May 4 '14 at 18:25
  • $\begingroup$ I've edited the answer to question 2 based on your response. $\endgroup$ – user137481 May 4 '14 at 20:23


Let random variable $X$ be defined as the number of keys that are tryed when the door opens.

(1) What values can $X$ take and with what probabilities? Find $\mathbb{E}X$ on base of this distribution.

(2) $$\mathbb{E}X=\mathbb{E}\left(X\mid X=1\right)P\left(X=1\right)+\mathbb{E}\left(X\mid X>1\right)P\left(X>1\right)$$ Note that here: $\mathbb{E}\left(X\mid X>1\right)=1+\mathbb{E}X$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.