I have the following problem in probability theory.
Suppose Alice and Bob agree to meet each other in the train station.
Alice is arriving between 16:00 and 17:00 (uniformly distributed) and stays there for 10 minutes , Bob is arriving between 16:10 and 16:40 (uniformly distributed) and stays there for 5 minutes.
What is the expected value of time that Alice and Bob will be together?
$X=$ time Bob arrives to the station
$Y=$ time Alice arrives to the station
$W=$ time Bob and Alice will be together
Then $X,Y$ are independent continuous random variable and $\mathcal{P}(0 \leq W \leq 5)=1$.
I tried to calculate $E(W|Y=y)$ but couldn't understand how to calculate $f_{W|Y}(w|y)$.
Thank you, Michael
For clarity, let's use minutes and shift 14:00 to 0. We know that $0 \leq Y\leq 60$ and $10 \leq X \leq 40$. Because the probabilities are uniform $P(X)=\frac{1}{30}$ for any $X$ and $P(Y)=\frac{1}{60}$ for any $Y$. Also, since arrival times are independent, the joint probability distribution would be $P(X,Y)=P(X)P(Y)=\frac{1}{180}$.
Now let's compute the time that Bob and Alice would be together, $W$, as a function of their arrival time. It is quite easy to figure out that \begin{equation} W(X,Y) = \begin{cases} 0 &X < Y-5 \\ X-Y+5 &Y-5 < X < Y \\ 5 &Y < X < Y+5 \\ Y-X+10 &Y+5 < X < Y+10 \\ 0 &X > Y+10 \\ \end{cases} \end{equation}
According to the definition of expected value, $E[W]$ would be $$ E[W] =\int_{10}^{40} \int_{0}^{60} W(X,Y)P(X,Y) dYdX= \frac{1}{180}\int_{10}^{40} \int_{0}^{60} W(X,Y) dYdX. $$ All you have to do is to evaluate this integral. It can be a little time consuming, but it is straightforward.