Expected waiting times and Variance of waiting time of Exponential distribution

752 Views Asked by At

I am not sure about my solution to this problem. I need your help and guidance. Thank you.

Assume that $A, B,$ and $C$ went to a bank to be served by three tellers and when they got into the bank, all the three tellers were free and so each of $A, B,$ and $C$ were served. The time it took $A, B,$ and $C$ to be served is distributed exponentially and independent of one another with a constant rate $\mu$. What is the expected value and variance of the time it took $A, B,$ and $C$ to be served.

My idea is that since the time it took to be served by A, B and C is iid, then the expectation and variance of time will be the sum of each expected time and the sum of each time variance. That is $$\sum_{i=1}^3 E[T_i] = 3(1/\mu)$$ and $$\sum_{i=1}^3 \text{Var}[T_i] = 3(1/\mu^2)$$

2

There are 2 best solutions below

2
On

Let $A$, $B$ and $C$ be their serving times. Since they are exponential with parameter $\mu$ $$ P(A < t) = P(B<t) = P(C < t) = 1-e^{-\mu t} .$$ We are interested in the serving time $T = \max\{A,B,C\}$. Then using independence, \begin{align} P(T < t) &= P(A<t) \cdot P(B<t) \cdot P(C<t) \\&= (1-e^{-\mu t})^3 \\&= 1 - 3 e^{-\mu t} + 3 e^{-2\mu t} - e^{-3\mu t} .\end{align} The PDF is found by differentiating: $$ 3 \mu e^{-\mu t} - 6 \mu e^{-2\mu t} + 3 \mu e^{-3\mu t} .$$ The expected value is $$ \int_0^\infty t (3 \mu e^{-\mu t} - 6 \mu e^{-2\mu t} + 3 \mu e^{-3\mu t}) \, dt = \frac{11}{6\mu} .$$ The expected value of $T^2$ is $$ \int_0^\infty t^2 (3 \mu e^{-\mu t} - 6 \mu e^{-2\mu t} + 3 \mu e^{-3\mu t}) \, dt = \dots $$ well, you get the idea, and from this you get the variance.

8
On

Ok, I think my previous solution was incorrect. I'm going to start over. Let the waiting time, $T$, for one person be modeled by an exponential distribution with parameter $\lambda$: $$p(t~|~\lambda,1)=\lambda e^{-\lambda t}$$ Then, the probability that they are done waiting by a time $t$ is $$\mathrm{P}(T<t)=\int_0^{t}p_T(\tilde{t})\mathrm{d}\tilde{t}=1-e^{-\lambda t}$$ Let $T_n$ be the combined waiting time for $n$ people. The probability that all $n$ people are done waiting by a time $t$, because we assumed independence, is $(1-e^{-\lambda t})^n$. That is, $$\mathrm{P}(T_n<t)=(1-e^{-\lambda t})^n$$ Thus we can see that $(1-e^{-\lambda t})^n$ is the CDF of the random variable $T_n$. Therefore, its PDF is $$p(t~|~\lambda,n)=\frac{\mathrm{d}}{\mathrm{d}t}\left(1-e^{-\lambda t}\right)^n=n\left(1-e^{-\lambda t}\right)^{n-1}\lambda e^{-\lambda t}$$ You can verify for yourself that this is a valid PDF in the range $[0,\infty)$. The expected waiting time for $n$ people is $$\mathrm{E}(T_n)=\int_0^\infty t\cdot n\left(1-e^{-\lambda t}\right)^{n-1}\lambda e^{-\lambda t}\mathrm{d}t$$ Using some binomial expansion, $$(1-e^{-\lambda t})^{n-1}=\sum_{k=0}^{m}{}_m\mathrm{C}_k ~(-1)^{m-k}e^{-(m-k)\lambda t}$$ Here $m=n-1$, for convenience. Plugging into the integral, $$\mathrm{E}(T_n)=n\lambda \int_0^\infty te^{-\lambda t}\sum_{k=0}^m {}_m\mathrm{C}_k~(-1)^{m-k}e^{-(m-k)\lambda t}\mathrm{d}t$$ Doing some simplifications and assuming we are allowed to interchange integration and summation, $$\mathrm{E}(T_n)=n\lambda \sum_{k=0}^m (-1)^{m-k}{}_m\mathrm{C}_k \int_0^\infty te^{-(m-k+1)\lambda t}\mathrm{d}t$$ Use a change of variable $t'=\lambda(m-k+1)t ~;~ \mathrm{d}t'=\lambda(m-k+1)\mathrm{d}t$: $$\mathrm{E}(T_n)=n\lambda \sum_{k=0}^m (-1)^{m-k}{}_m\mathrm{C}_k\int_0^\infty \frac{t'}{\lambda(m-k+1)}e^{-t'}\frac{1}{\lambda(m-k+1)}\mathrm{d}t'$$ $$\mathrm{E}(T_n)=\frac{n}{\lambda}\sum_{k=0}^m \frac{(-1)^{m-k}{}_m\mathrm{C}_k}{(m-k+1)^2}\int_0^\infty t'e^{-t'}\mathrm{d}t'$$ Some routine algebra shows us the above integral is $1$. Thus, $$\mathrm{E}(T_n)=\frac{n}{\lambda}\sum_{k=0}^{n-1}\frac{(-1)^{n-1-k}{}_{(n-1)}\mathrm{C}_k}{(n-k)^2}$$ We can see that this is consistent, as $\mathrm{E}(T_1)=\frac{1}{\lambda}.$ Now for the variance. $$\operatorname{Var}(T_n)=\mathrm{E}({T_n}^2)-\mathrm{E}(T_n)^2$$ $$=\int_0^\infty t^2\cdot n\left(1-e^{-\lambda t}\right)^{n-1}\lambda e^{-\lambda t}\mathrm{d}t-\left(\frac{n}{\lambda}\sum_{k=0}^{n-1}\frac{(-1)^{n-1-k}{}_{(n-1)}\mathrm{C}_k}{(n-k)^2}\right)^2$$ Now we do the same binomial expansion: $$\mathrm{E}({T_n}^2)=n\lambda\int_0^\infty t^2e^{-\lambda t}(1-e^{-\lambda t})^{n-1}\mathrm{d}t$$ $$=n\lambda \int_0^\infty t^2e^{-\lambda t}\sum_{k=0}^m {}_m\mathrm{C}_k ~(-1)^{m-k}e^{-(m-k)\lambda t}\mathrm{d}t$$ Now using a change of variable $\tau=(m-k+1)\lambda t$ as before and interchanging integration and summation again: $$\mathrm{E}({T_n}^2)=n\lambda \sum_{k=0}^m (-1)^{m-k}{}_m\mathrm{C}_k\int_0^\infty \left(\frac{\tau}{\lambda(m-k+1)}\right)^2 e^{-\tau} \frac{1}{\lambda(m-k+1)}\mathrm{d}\tau$$ $$\mathrm{E}({T_n}^2)=\frac{n}{\lambda^2}\sum_{k=0}^{n-1}\frac{(-1)^{n-1-k}{}_{(n-1)}\mathrm{C}_k}{(n-k)^3}\int_0^\infty \tau^2 e^{-\tau}\mathrm{d}\tau$$ The above integral can be shown to be $2$. So, $$\mathrm{E}({T_n}^2)=\frac{2n}{\lambda^2}\sum_{k=0}^{n-1}\frac{(-1)^{n-1-k}{}_{(n-1)}\mathrm{C}_k}{(n-k)^3}$$ Therefore $$\operatorname{Var}(T_n)=\frac{2n}{\lambda^2}\sum_{k=0}^{n-1}\frac{(-1)^{n-1-k}{}_{(n-1)}\mathrm{C}_k}{(n-k)^3}-\left(\frac{n}{\lambda}\sum_{k=0}^{n-1}\frac{(-1)^{n-1-k}{}_{(n-1)}\mathrm{C}_k}{(n-k)^2}\right)^2$$ This is consistent, as in the $n=1$ case the sums go away and we're left with $$\operatorname{Var}(T_1)=\frac{2\cdot 1}{\lambda^2}-\frac{1}{\lambda^2}=\frac{1}{\lambda^2}.$$ Plug in $n=3$ to the above formulae for a solution to your problem.

EDIT: Let's actually do this. $$\mathrm{E}(T_3)=\frac{3}{\lambda}\sum_{k=0}^2 \frac{(-1)^{2-k}{}_2\mathrm{C}_k}{(3-k)^2}$$ $$=\frac{3}{\lambda}\left(\frac{(-1)^2\cdot 1}{3^2}+\frac{(-1)^1\cdot 2}{2^2}+\frac{(-1)^0\cdot 1}{1^2}\right)=\frac{3}{\lambda}\left(\frac{1}{9}-\frac{1}{2}+1\right)=\frac{11}{6\lambda}.$$ The variance, $$\operatorname{Var}(T_3)=\frac{2\cdot 3}{\lambda^2}\sum_{k=0}^{2}\frac{(-1)^{2-k}{}_{2}\mathrm{C}_k}{(3-k)^3}-\left(\frac{11}{6\lambda}\right)^2$$ $$=-\left(\frac{11}{6\lambda}\right)^2+\frac{6}{\lambda^2}\left(\frac{(-1)^2\cdot 1}{3^3}+\frac{(-1)^1\cdot 2}{2^3}+\frac{(-1)^0\cdot 1}{1^3}\right)$$ $$=-\frac{121}{36\lambda^2}+\frac{6}{\lambda^2}\left(\frac{1}{27}-\frac{1}{4}+1\right)=\frac{1}{\lambda^2}\left(\frac{-121}{36}+\frac{85}{18}\right)=\frac{49}{36\lambda^2}.$$

ADDENDUM:

Wolfram finds some interesting closed forms for the sums mentioned above. It finds $$\frac{n}{\lambda}\sum_{k=0}^{n-1}\frac{(-1)^{n-1-k}{}_{(n-1)}\mathrm{C}_k}{(n-k)^2}=\frac{1}{\lambda} H_n$$ With $H_n$ being the harmonic numbers. It also finds $$\sum_{k=0}^{n-1}\frac{(-1)^{n-1-k}{}_{(n-1)}\mathrm{C}_k}{(n-k)^3}=\frac{6{H_n}^2-6\digamma'(n+1)+\pi^2}{12n}$$ With $\digamma$ being the digamma function and $\digamma'$ its first derivative. This leads to $$\operatorname{Var}(T_n)=\frac{2n}{\lambda^2}\frac{6{H_n}^2-6\digamma'(n+1)+\pi^2}{12n}-\left(\frac{1}{\lambda} H_n\right)^2$$ $$=\frac{\pi^2}{6\lambda^2}-\frac{\digamma'(n+1)}{\lambda^2}$$ Quite nice :)