# Probability that a periodic event with a duration $d$ will happen in the next $l$ days

I have a periodic event that has a duration in time $d$. This event always starts happening $p$ days (or whatever unit of time) after the start of the previous event, with $p>d$. Given a length of time $l$ days with $d < l < p$, and given that I don't know when the last time the event happened was (or even if it's happening at the moment), what's the probability that this event will be happening during the next $l$ days? Not necessarily start to finish, just that there'll be some part of this event happening then.

EDIT: By the way, I used "days" as a unit of time here but I want a solution to the continuous problem, i.e. the event can happen at any time during a day, it does not necessarily start at midnight, $d$, $l$, and $p$ are real numbers, etc.

I would consider two cases. The first if $d+l \geq p$. Since the time windows of length $d$ and $l$ can't be arranged within the time window of length $p$ without overlapping. The second case is where $d+l < p$. $\frac{d+l}{p}$ is the "percentage" (between $0$ and $1$) of time the time windows $d$ and $l$ together cover of $p$ without overlapping. Hence $1-\frac{d+l}{p}$ of the time window $p$ is left within which the time window $l$ can "move" without overlapping the time window $d$, i.e. the probability that the time window $l$ does not overlap the time window $d$ is exactly $1-\frac{d+l}{p}$, or in other words it is the probability that the event $d$ does not happen within the next time window $l$. This is the opposite of what you were asking, so your question is answered by $1-(1-\frac{d+l}{p}) = \frac{d+l}{p}$.