You and two friends have arranged to meet at a popular downtown mall between 3 p.m. and 4 p.m. one afternoon. However, you neglected to specify a time within that one-hour window. Therefore, the three of you will be arriving at randomly selected times between 3 p.m. and 4 p.m. Once each of you arrives at the mall, you will be there for exactly 15 minutes. When the 15 minutes are up, you leave.
At some point (or points) during the hour, there will be a maximum number of friends at the mall. This maximum could be one (sad!), two, or three. On average, what would you expect this maximum number of friends to be?
Let's abstract a bit and assume that your buddy Xena, you, and second buddy Zevulon each arrive at random times $X$, $Y$, $Z$ which are i.i.d. $U(0,1).$ The maximum number of friends at any one time between 3 and 4 p.m. is $$N = N(X,Y,Z) = \begin{cases} 3, &\text{if $\max \{ |X-Y|, |X-Z|, |Y-Z| \} \leq \frac{1}{4}$;}\\ 1, &\text{if $\min \{ |X-Y|, |X-Z|, |Y-Z| \} \gt \frac{1}{4}$;}\\ 2, &\text{otherwise.}\end{cases}$$ One method for solving this problem would be to just throw some Monte Carlo simulations at this distribution, to get $\mathbb{E}[N]$; however, let's see if we can't find an analytical answer first.
Let's define $E(x,y) = \mathbb{E} [ N(X,Y,Z) \mid X=x, Y=y ].$ If we understand $E(x,y),$ then we see that $$\mathbb{E}[N] = \int_0^1 \int_0^1 E(x,y) \, dx \, dy.$$ From the symmetry of $N$ we have $$\mathbb{E}[N] = 2 \int_0^1 \int_0^x E(x,y) \, dy\, dx.$$ Now let's study the following cases:
- $A = \{ (x,y) \in [0,1]^2 \mid 0 \leq x \leq 1, \max\{0,x-\frac{1}{4}\} \leq y \leq x \};$
- $B = \{ (x,y) \in [0,1]^2 \mid \frac{1}{4} \leq x \leq 1, \max\{0, x - \frac{1}{2} \} \leq y \leq x - \frac{1}{4} \};$
- $C = \{ (x,y) \in [0,1]^2 \mid \frac{1}{2} \leq x \leq 1, 0 \leq y \leq x - \frac{1}{2}\}.$
In case A, we have that $|x-y| \leq \frac{1}{4}$ already, so at the very least we have $N \geq 2$ regardless of the value of $Z \sim U(0,1)$. Furthermore, whenever $\max{0,x-\frac{1}{4}} \leq Z \leq \min \{ 1, y + \frac{1}{4} \}$ we have $N=3,$ so we must have \begin{align*}E_A(x,y) &= \mathbb{P} \{ N \geq 1 \} + \mathbb{P} \{ N \geq 2\} + \mathbb{P} \{ N \geq 3 \} \\ &= 2 + \min \{ 1, y + \frac{1}{4} \} - \max \{ 0, x - \frac{1}{4} \}.\end{align*} So let \begin{align*}I_A &= \iint_A E_A(x,y) \,dx \,dy \\ &= \int_0^1 \int_{\max \{ 0, x - \frac{1}{4} \}}^x \left( 2 + \min \{ 1, y + \frac{1}{4} \} - \max \{0, x - \frac{1}{4} \} \right) \,dy \,dx\\ &= \frac{33}{64}\end{align*}
In case B, we cannot have $N = 3,$ but depending on the value of $Z \sim U(0,1)$ we can have either $N=1$ or $N=2.$ Furthermore, we see that for $(x,y) \in B$ we have $x -\frac{1}{4} \lt y + \frac{1}{4}$ so we have $N = 2$ whenever $\max\{0, y - \frac{1}{4}\} \leq Z \leq \min \{ 1, x + \frac{1}{4} \},$ so we must have \begin{align*}E_B(x,y) &= \mathbb{P} \{ N \geq 1 \} + \mathbb{P} \{ N \geq 2\} + \mathbb{P} \{ N \geq 3 \} \\ &= 1 + \min \{ 1, x + \frac{1}{4} \} - \max \{ 0, y - \frac{1}{4} \}.\end{align*} So let \begin{align*}I_B &= \iint_B E_B(x,y) \,dx \,dy \\ &= \int_{\frac{1}{4}}^1 \int_{\max \{ 0, x - \frac{1}{2} \}}^{x-\frac{1}{4}} \left( 1 + \min \{ 1, x + \frac{1}{4} \} - \max \{0, y - \frac{1}{4} \} \right) \,dy \,dx\\ &= \frac{53}{192}\end{align*}
In case C, we cannot have $N = 3,$ but depending on the value of $Z \sim U(0,1)$ we can have either $N=1$ or $N=2.$ Furthermore, we see that for $(x,y) \in B$ we have $x -\frac{1}{4} \gt y + \frac{1}{4}$ so we have $N = 2$ whenever $$\max\{0, y - \frac{1}{4}\} \leq Z \leq y + \frac{1}{4},$$ which has probability $\min \{ \frac{1}{2}, y + \frac{1}{4} \}$, or $$x - \frac{1}{4} \leq Z \leq \min \{1, x+ \frac{1}{4}\},$$ which has probability $\min \{ \frac{1}{2}, \frac{5}{4} - x \},$ so we must have \begin{align*}E_C(x,y) &= \mathbb{P} \{ N \geq 1 \} + \mathbb{P} \{ N \geq 2\} + \mathbb{P} \{ N \geq 3 \} \\ &= 1 + \min \{ \frac{1}{2}, y + \frac{1}{4} \} + \min \{ \frac{1}{2}, \frac{5}{4}-x \}.\end{align*} So let \begin{align*}I_C &= \iint_C E_C(x,y) \,dx \,dy \\ &= \int_{\frac{1}{2}}^1 \int_{0}^{x-\frac{1}{2}} \left( 1 + \min \{ \frac{1}{2}, y + \frac{1}{4} \} + \min \{\frac{1}{2}, \frac{5}{4} -x \} \right) \,dy \,dx\\ &= \frac{43}{192}\end{align*}
So we have that the expected nmaximum number of friends is \begin{align*}\mathbb{E}[N] &= 2 \left( I_A + I_B + I_C \right)\\ &= 2 \left( \frac{33}{64} + \frac{53}{192} + \frac{43}{192} \right)\\ &= \frac{65}{32} = 2.03125\end{align*}
No comments:
Post a Comment