Distribution of patient's waiting time

698 Views Asked by At

The doctor has two visits scheduled: first at 11 AM and second at 11:30 AM. Time of each visit is exponential with expected value of 30 minutes and both times are independent.

Assuming, that every patient arrives on time, determine distribution of time spent at the clinic for the second patient.


Could anyone please advise how to solve the above? Everything would be so much easier if the second patient were seeing doctor straight after the first patient - but we have to also take into account, that he arrives at 11:30.

1

There are 1 best solutions below

0
On BEST ANSWER

Condition on the event that the first patient finishes before $30$ minutes. Let $V_1$ is the visit time of the first patient, and $V_2$ the visit time of the second, where visit times include only the time the patient spends with the doctor. Let $T_1$ and $T_2$ represent the total time spent at the clinic for each patient, respectively; these include any waiting time. Then $T_1 = V_1$ because the first patient never waits, and $T_2 = V_2 + W$, where $W \ge 0$ is the time patient 2 needs to wait. If patient 1 is done within $30$ minutes, then $W = 0$. Otherwise $W = V_1 - 30$. For example, if it took $33$ minutes for patient 1's visit, then patient 2 had to wait $33 - 30 = 3$ minutes.

The rest is simply a matter of applying the notation for our model: we are given $$V_1, V_2 \sim \operatorname{Exponential}(\mu = 30),$$ so $$\Pr[T_2 \le t] = \Pr[T_2 \le t \mid V_1 \le 30]\Pr[V_1 \le 30] + \Pr[T_2 \le t \mid V_1 > 30]\Pr[V_1 > 30]$$ by the law of total probability. But $$\Pr[T_2 \le t \mid V_1 \le 30] = \Pr[V_2 \le t],$$ since when $V_1 \le 30$, we established that $W = 0$, hence $T_2 = V_2$. In the second case, $$\Pr[T_2 \le t \mid V_1 > 30] = \Pr[V_2 + V_1 - 30 \le t \mid V_1 > 30],$$ because when $V_1 > 30$, $W = V_1 - 30$ hence $T_2 = V_2 + V_1 - 30$. The evaluation of this last conditional probability involves some subtlety. The random variable $$V_1 - 30 \mid V_1 > 30$$ is exponential with mean $30$, because of the memorylessness property of the exponential distribution. In other words, given that the first patient's visit time exceeds $30$ minutes, their additional visit time $V_1 - 30$ beyond this is again exponentially distributed with mean $30$ minutes. So the desired conditional probability is the probability that $$\Pr[G \le t]$$ where $$G \sim \operatorname{Gamma}(\alpha = 2, \theta = 30),$$ where the parametrization is by shape and scale. Now that we have completely specified the cumulative distribution, I leave the rest of the computation as an exercise.