2

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!

MilesToGo
  • 127
  • Nice question! However, it'd be much more readable if the maths were formatted properly - have a look here. – dvdgrgrtt Nov 15 '23 at 06:13
  • Thank you for the link! I'll read through this and will start making edits to the formatting now... – MilesToGo Nov 15 '23 at 06:17
  • Your thinking with $\mathbb{E}[T_3]$ is correct but the expression is incorrect. You would also need to account for the probabilities of events. $\mathbb{E}[T_3] = \mathbb{E}[T_3| A \text{ solves it }] \Pr(A \text{ solves it }) + \mathbb{E}[T_3| B \text{ solves it }] \Pr(B \text{ solves it })$. What is $\mathbb{E}[T_3| A \text{ solves it }]$ and $\Pr(A \text{ solves it })$? Also $\mathbb{E}[T_3] = \mathbb{E}[T_4] = \dots = \mathbb{E}[T_n]$ is correct. Can you explain why? – sudeep5221 Nov 15 '23 at 06:26
  • @sudeep5221 Thank you! I think $E[$$T3$|$A$ solves it$]$ $=$ $E[$$TA$$]$ $=$ $1$ $/$ MuA, and $P($$A$ solves it$)$ $=$ $P($$TA$ < $TB$$)$ $=$ MuA $/$ $($MuA $+$ MuB$)$. This is because if it's given that $A$ solves question $3$, then it means $A$ took lesser time to solve question $1$ than the time B took to solve question $2$. Similarly, for $E[$$T3$|$B$ solves it$]$ and $P($$B$ solves it$)$. So we get E[T3] = 2/(MuA + MuB). – MilesToGo Nov 15 '23 at 06:36
  • And I think the explanation behind $E[$$T3$$]$ $=$ $E[$$T4$$]$ $=$ .... $=$ $E[$$Tn$$]$ is that for each question, we have the $2$ students $A$ and $B$ working on the previous 2 questions. Whoever finishes first among them, will start with the next question. And the exponential random variable is memoryless, so we can calculate expected time for solving each question by conditioning on each student solving it. The probability that a given student solves a question doesn't change, because both $TA$ and $TB$ are exponential and independent. Is this correct? Thank you very much!! – MilesToGo Nov 15 '23 at 06:48
  • That's correct! Seems like the answer after the math for $\mathbb{E}[T_3]$ was originally correct. I hadn't worked out the math. Sorry about that. – sudeep5221 Nov 15 '23 at 07:33
  • @sudeep5221 Not at all! Thank you so much for explaining how I have to look at the probabilities of the events. That was really helpful! :) Have a great day! – MilesToGo Nov 15 '23 at 08:20
  • Hmm, for this question, it looks like I have to use the property that the sum of $2$ independent Poisson processes is also a Poisson process (PP). If $A(t)$ is a PP with rate $μA$, where $A(t)$ is the number of questions solved by student $A$ at time t (and similarly a PP $B(t)$ with rate $μB$ for student B), then we have, $A(t)$ + $B(t)$ is a PP with rate ($μA$ + $μB$). So the times between successive questions being solved by dividing the work are all $Ti$ ~ Exp($μA$ + $μB$). So, $E($time taken to finish $n$ questions$)$ $=$ $n$ $/$ $($$μA$ + $μB$$)$. Does this make sense here? – MilesToGo Nov 16 '23 at 04:50
  • 1
    @MilesToGo I provided the solution using two different methods. The second is based on the superposition property of Poisson processes. I suggest that you first focus on the case $n=2$, for which the completion time is $\max { X_A , X_B}$, not $X_A + X_B$, and then analyze the general case $n\ge2$. – Amir Nov 16 '23 at 15:33
  • @Amir Thank you very much for explaining! I'll work through it step by step in order to understand. – MilesToGo Nov 17 '23 at 10:47
  • 1
    Hope you understand the answer very well! If you find the answer useful please accept it to make your question more visible. – Amir Nov 20 '23 at 08:09
  • Thank you very much! I understood now! – MilesToGo Nov 23 '23 at 08:18

1 Answers1

1

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].$

Amir
  • 4,305