3

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)$$

Kenta S
  • 16,151
  • 15
  • 26
  • 53
holala
  • 733
  • Do you mean the combined time, or do you mean the time at which we would expect the last person to have been served? – K.defaoite Aug 03 '20 at 03:49
  • @K.defaoite Find the expected value and variance of the time it takes for all three of them to finish – holala Aug 03 '20 at 03:55
  • 1
    Your answer would be correct if it were the combined time. But that is not the question. So your answer is incorrect. – Stephen Montgomery-Smith Aug 03 '20 at 04:42
  • @StephenMontgomery-Smith Yes indeed. The correct solution is in my answer. – K.defaoite Aug 03 '20 at 04:46
  • @StephenMontgomery-Smith Can you elaborate on what you mean by the combined time and what actually the question demands? – holala Aug 03 '20 at 05:07
  • @K.defaoite. I can't see your correct solution. Can you re-post it? – holala Aug 03 '20 at 05:08
  • @K.defaoite. Can you share with me your solution to the problem? – holala Aug 03 '20 at 11:25
  • I wrote up my solution. – Stephen Montgomery-Smith Aug 03 '20 at 12:44
  • I did the same. My previous approach was entirely incorrect. Understandable, as I was writing it at 2AM... I've posted an actually correct solution now for $n$ people. – K.defaoite Aug 03 '20 at 15:40
  • @K.defaoite. I am kind of confuse about the difference between the "combined time" and my earlier solution (even though it was wrong). Stephen did point out (in his comment) that my earlier solution would have been correct if the question asked of the "combined time". But going through your extensive solution, I realized that $T_n$ is the combined time that you solved for which is exactly the same solution that Stephen presented. – holala Aug 19 '20 at 02:06
  • Now, how do we interpret my solution with respect to @StephenMontgomery-Smith solution (same as K.defaoite's), i.e., the difference. And what is clue in the question that alerts us that we need to solve for the $\text{max} T$? – holala Aug 19 '20 at 02:11
  • 1
    Your solution would be correct if the three people were serve by the same teller. Then the time would be $A + B + C$. But in our situation, we have to wait until all three people are finished when they start at the same time. So that means, we are waiting until the maximum of their serving times are done. – Stephen Montgomery-Smith Aug 19 '20 at 02:16
  • @StephenMontgomery-Smith. Thanks for that explanation. If I may ask, at what circumstances (and situations) should we be required to find the min $T$? i.e. clues requiring us to compute say $E(\text{min} T)$? Is there any resources available you could recommend for me to know all the possible scenarios of using either of min $T$ or max $T$ ? I think my problem is how to figure out the right one to used in a given question. – holala Aug 20 '20 at 00:23
  • I f they had asked when the first person had finished being served, that would have been the minimum. – Stephen Montgomery-Smith Aug 20 '20 at 01:28
  • Maybe the way to think about it is to use an example. Suppose A had taken 5min, B had taken 6min, and C had taken 4min. They would all be done after 6min. And 6 is the maximum. – Stephen Montgomery-Smith Aug 20 '20 at 01:29
  • Thanks for helping out. – holala Aug 20 '20 at 03:08

2 Answers2

2

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 :)

K.defaoite
  • 12,536
  • Whoops. I forgot some minus signs in my binomial expansion. Let me correct it. – K.defaoite Aug 03 '20 at 16:09
  • Alright. Did you mean your solution and that of Stephen's is the same? Yours is a bit detailed. – holala Aug 03 '20 at 16:15
  • It's the same, just generalized a bit. And it's completely correct now!(some pesky minus signs :P) You can test it out numerically here. For the $n=3$ case it lines up with Stephen's answer of $\frac{11}{6\lambda}$. – K.defaoite Aug 03 '20 at 16:18
  • What did you get for the variance of time when $n=3$? – holala Aug 03 '20 at 16:30
  • @holala Let me write up the $n=3$ case in my answer. – K.defaoite Aug 03 '20 at 16:46
  • @holala $n=3$ case now fully written up. – K.defaoite Aug 03 '20 at 17:02
  • Is it wrong to use the idea that since we know Var$T = 1/\lambda^2$ and we already have $E[T] = 11/6\lambda$ then it implies that Var$T = 1/(11/6\lambda)^2 = 36\lambda^2/121$? – holala Aug 03 '20 at 17:25
  • 1
    Your double use of $T$ is confusing. Do you mean $T_n$? If so, that method is not correct because $T_n$ does not follow an exponential distribution. – K.defaoite Aug 03 '20 at 17:49
0

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.

Stephen Montgomery-Smith
  • 26,430
  • 2
  • 35
  • 64