Erlang B formula to solve a probability problem

109 Views Asked by At

I am trying to solve this problem where I need to express a probability problem as a queueing problem. I'm having troubles getting the distributions right.

Here's the problem:

There are $n$ keys, only one of them opens the lock. Find the average number of keys tried before the door is opened.

As a probability problem,I solve it like this. Let $\xi$ be the r.v. for number of attempts. Then my goal is to calculate $\mathbb{E}\xi$. Then $k-th$ attempt is successful if attempts $1,\dots,k-1$ failed and $k-th$ succeeded. Then $$\mathbb{E}\xi=1\cdot\frac{1}{n}+\sum_{k=2}^n\Big(k\frac{1}{n-k+1}\prod_{m=0}^{k-2}\frac{n-m-1}{n-m}\Big)$$ i.e. for $n=3$, for example: $$\mathbb{E}\xi=1\cdot\frac{1}{3}+2\cdot\frac{1}{2}\cdot\frac{2}{3}+3\cdot1\cdot\frac{2}{3}\cdot\frac{1}{2}=2$$

I'm quite sure that $\mathbb{E}\xi=\frac{\sum_{m=1}^nm}{n}\quad\forall n\geq 1$ because every key is equally likely to open the lock. So, we are equally likely to have the correct key on any attempt.

My goal is to solve this problem using the Erlang B formula: $$E_k=\frac{\alpha^k/k!}{\sum_{m=0}^k\alpha^m/m!}$$ where $\alpha=\lambda/\beta$ is traffic, $k$ - number of used resources (channels).

I need to describe this probability problem as a queuing problem to obtain a solution with Erlang B. If I assume that the average number of attempts is the average number of channels used to obtain the right key, I have the following distribution of $\xi$:

$\xi$ 1 2 ... n
Prob. of right key 1-$E_1$ $E_2-E_1$ ... $E_n-E_{n-1}$

the expected value is then $$\mathbb{E}\xi=\sum_{k=1}^nk(E_{k-1}-E_k)\quad\text{where }E_0=1$$

I apply this formula to $n=3$ (3 keys mean 3 total possibilities, thus 3 channels) and $\alpha=1$ (1 key per try) and get $\mathbb{E}\xi\sim 1.512<2$. I then try to recalculate for different $n,\alpha$ and never get the correct answer.

How do I interpret/assign the parameters in Erlang B to get on the right track?