I have a set of practice questions to prepare for finals. And I have worked through most.
I am unsure about my approach in the below question. I have outlined what I have worked out here.
Suppose there are $n$ questions to be solved, and suppose two students divide the work as follows. Student $A$ starts with question $1$, and student $B$ starts with question $2$. Whenever one of them finishes a question, they immediately start on the next question which is not attempted by either of them.
Suppose student $A$ finishes each question independently in Exponential $($$μA$$)$ amount of time, and student $B$ finishes each question independently in Exponential $($$μB$$)$ amount of time.
Here, I have to calculate the expected amount of time it takes to finish all the $n$ questions.
My attempt:
$E($time taken to finish $n$ questions$)$
$=$ $E($$T1$ $+$ $T2$ $+$ .... $+$ $Tn$$)$
$=$ $E($$T1$$)$ $+$ $E($$T2$$)$ $+$ .... $+$ $E($$Tn$$)$
where $T1$ is the time taken to finish question $1$, $T2$ is the time taken to finish question $2$, and so on.
We are given that student $A$ starts with question $1$, and student $B$ starts with question $2$.
So, $E($$T1$$)$ $=$ $E($$TA$$)$ $=$ $\frac{1}{μA}$, because $TA$ ~ Exponential($μA$).
And $E($$T2$$)$ $=$ $E($$TB$$)$ $=$ $\frac{1}{μB}$, because $TB$ ~ Exponential($μB$)
Now, I think:
$E($$T3$$)$ $=$ $E($$TA$ $|$ $TA < TB$ $)$ + $E($$TB$ $|$ $TB < TA$ $)$
So, $E($$T3$$)$ $=$ $\frac{2}{μA + μB}$
This is because, $A$ and $B$ are working on questions $1$ and $2$ respectively, and whoever among $A$ and $B$ finishes first, will start with the $3$rd question.
Is this approach correct in calculating $E($$T3$$)$?
Further, I think that $E($$T4$$)$ $=$ $E($$T5$$)$ $=$ .... $=$ $E($$Tn$$)$ $=$ $\frac{2}{μA + μB}$
Therefore, $E($time taken to finish $n$ questions$)$
$=$ $[$$1/μA$$]$ $+$ $[$$1/μB$$]$ $+$ $[$ $(n-2) 2$ $/$ $(μA + μB)$ $]$
Is this approach correct, or am I going off track somewhere? Any advice will be very helpful. Thank you!
I present the solution using two methods that are based renewal and Poisson processes, respectively. Finally I compare different job assignment polices.
First method:
Assuming that the solution times $X_A$ and $X_B$ by the two students are independent exponential distributions, $X_A \sim \text{exp}(\lambda_A), X_B \sim \text{exp}(\lambda_B)$, the expectation is given by
$$(n-2) \, \mathbb{E} \left ( \min \{ X_A , X_B\} \right )+ \mathbb{E} \left ( \max \{ X_A , X_B\} \right ).$$
As exponential distributions are memoryless, at each time instant that a new question is assigned to a student, the situation is renewed. The first $n-2$ cycles are similar with length $\min \{ X_A , X_B\}$. After the assignment of the last question, the situation is again renewed similarly as the time instance 0, but we need to wait until both students answer their assigned questions; the required time is $\max \{ X_A , X_B\}$.
Using the known properties of the minimum (see 1) and maximum (see 2) of two independent exponential distributions, the final answer is
$$\frac{n-2}{\lambda_A+\lambda_B}+\frac{1}{\lambda_A}+\frac{1}{\lambda_B}-\frac{1}{\lambda_A+\lambda_B}.$$
Second method:
The question-assignment process for each student is a Poisson process, which is independent from the other. Hence, the whole question-assignment process is a Poisson process with parameter $\lambda_A+\lambda_B$ due to the superposition property of Poisson processes. At time instant 0, 2 questions have been already assigned. We need to wait until the remaining $n-2$ questions are assigned. The distribution of the time instant when the last remaining question is assigned follows $G(n-2,\lambda_A+\lambda_B)$; hence, the expected time of this phase is $\frac{n-2}{\lambda_A+\lambda_B}$. To find the expected time required for completely answering all the questions, we need to add the required time for completing both last questions assigned to the students, which is $\max \{ X_A , X_B\}$, whose expectation is $\frac{1}{\lambda_A}+\frac{1}{\lambda_B}-\frac{1}{\lambda_A+\lambda_B}$. Thus, the same solution is obtained.
Applied insights:
It is worth noting that when $\lambda_A=\lambda_B=\lambda$, the expected finish time using two students under the job assignment policy explained above is considerably smaller than the expected finish time by a single student:
$$\frac{n+1}{2\lambda} \le \frac{n}{\lambda}.$$
More interesting observation is that, for $n=2k$, the job assignment policy is also better than the policy under which the questions are divided equally between the two students, i.e.,
$$\frac{2k+1}{2\lambda}=\frac{1}{\lambda} \left ( k+\frac{1 }{2} \right ) \le \mathbb{E} \left ( \max \left \{ \sum_{i=1}^{k} X_{Ai}, \sum_{i=1}^{k} X_{Bi} \right \} \right )= \frac{1}{\lambda} \left \{ k+\frac{\Gamma \left( k+\frac{1}{2}\right) }{\sqrt{\pi} \, \Gamma (k)} \right \} $$
where $X_{Ai}$ and $X_{Bi}$, $i=1 \dots k$, are independent and follow $\exp(\lambda)$. To get the right-side expectation, see 3 and use the facts that $\frac{1}{2\lambda}\chi_{2k}^2 \sim G(k,\lambda)$ and $\mathbb E \big[\min(X,Y)+\max(X,Y)\big]=\mathbb E\big[X+Y\big].$