Probability puzzle about arrival time I recently came up with an interesting probability puzzle and wondered what would be the best way to solve it. It goes as follows:

Suppose your friend is to arrive sometime on Monday, with a uniform
  distribution over the full 24 hour day. Whatever time they arrive
  dictates how long they will stay at your place. For example:
  
  
*
  
*If your friend arrives exactly at midnight (00:00) on Monday, they won't stay at all, and simply say "hello" while passing by.
  
*If they arrive at 1:30am (01:30) they will stay for an hour and a half, until 3:00am (03:00).
  
*If they arrive at 2:00pm (14:00) they will stay for 14 hours, until 4:00am the next day, Tuesday.
  
  
  If $t$ is a moment in time sometime between the beginning of Monday
  and the end of Tuesday, what is the probability your friend is at your
  house at time $t$?

Stated a little more formally, if $a \in [0, 86400)$ is the arrival time (in seconds) of your friend, then the times they will be staying at your house will be given by $[a,2a)$. So the question becomes:

Given $t\in[0, 172800)$, what is the probability that your friend is
  at your house at time $t$?

Naturally I am interested in the method for arriving at a solution more so than the actual solution itself. I would also like to know how to approach the problem if the distribution on $[0,86400)$ was not uniform, but instead was given by some specific probability density function.
Thanks, in advance.
 A: Hint: If your friend is at your house at time $t \in [0,86400)$ then they must have arrived at some time in $[\lceil t/2\rceil,t]$ and the probability that they arrived in such an interval is....?
If $t \in [86400, 172800)$ then them must have arrived in the interval $[\lceil t/2 \rceil , 86400)$ and then the probability is...?
Can you see how to generalise to arbitrary distributions?
A: You are introducing the Bernoulli random variable $B_t$ which reads as follows:
$$B_t = \begin{cases}
0 & \text{if the friend is not at home at time}~t\\
1 & \text{if the friend is at home at time}~t\\
\end{cases}.$$
In this sense, $t$ is a parameter of the random variable, not a random variable itself.
The probability that $B_t = 1$ corresponds to:
$$p_t = p((A < t) \wedge (A > t/2)),$$
where $A$ (the arrival time) is a random variable. In this case, since it is  uniformly distributed in the set $[0, D]$, where $D = 86400$, the pdf of $A$ is:
$$f_A(a) = \frac{1}{D}, \forall a \in [0, D].$$
To find the exact expression, we must consider the following cases:


*

*If $t < D$, then: $$p_t = \int_{t/2}^t f_A(a)da = \int_{t/2}^t \frac{1}{D}da = \frac{t}{2D}.$$

*If $t > D$, but $t/2<D$, then:
$$p_t = \int_{t/2}^{D} f_A(a)da = \int_{t/2}^{D} \frac{1}{D}da = 1 - \frac{t}{2D}.$$

*Of course, if $t/2 > D$ (not possible, since the friend arrives within the first day for sure), then: $$p_t = 0.$$


Roughly speaking, you can find the distribution of $B_t$ (which is $[1-p_t, p_t]$ on the set $\{0, 1\}$), and not the distribution of $t$!
For general distribution of $A$ (i.e. if $f_A(a)$ has another form), then just solve the integrals stated in points $1$ and $2$ with the right distribution.
A: This graph may help visualize the problem:

The horizontal axis is your friend's arrival time;
the vertical axis is a time at which you might observe your friend at your house.
Each point within the entire rectangular region represents a possible event in which your friend arrives at a particular time (horizontal coordinate) and you look for your friend at your house at a particular time (vertical coordinate).
The shaded area represents the events in which you look and find your friend at your house.
By selecting a particular time $t$ at which you look to see if your friend is at your house,
you restrict the event space to one horizontal line across the graph.
The probability that your friend is at your house at time $t$ is the
probability that the combined event
(friend arriving at random time, you observing at time $t$)
falls within the shaded region along that line.
This gives you a minimum and maximum time of arrival that will result in your friend being at your house at time $t.$
So now the problem is merely to determine the probability that the arrival time is within that interval.
