[Math] How likely are two events to occur at the same time

probabilityprobability theoryrandomstatisticsstochastic-approximation

Let's think of two events $1$ and $2$.

Both events happen randomly $n_1$/$n_2$-times during a given time $T$ and last for a time of $t_1$/$t_2$.

What is probability $P$, that both events happen simultaneously at some moment?



EXAMPLE 1:

$T = 60$ min

Event $1$ – looking out of the office window: $n_1 = 8$ and $t_1 = 1$ min

Event $2$ – a green car is on the street visible: $n_2 = 20$ and $t_2 = 0.5$ min

$P$: How likely do I see a green car during these $60$ min?

Best Answer

Consider the discrete version of this problem, where $T$, $t_1, t_2$ are integers under some fixed unit of time and the events always start at integer multiples of time.

Then you are selecting $n_1$ values $\{a_i\}$ from $0,...,T-t_1+1$ so that each adjacent pair differs by at least $t_1$, and $n_2$ values f$\{b_j\}$ from $0,\dots T-t_2+1$ with adjacent pairs differing by at least $t_2$. You can count these with a stars-and-bars argument get you something like:

$$\binom{T-(t_1-1)n_1}{n_1}$$

The number of ways that they don't overlap can be written as the number of ways of ordering the $n_1+n_2$ blocks of type $1$ and $2$, and then inserting gaps before and after them totaling $A=T-n_1t_1-n_2t_2$. The number of orderings is $\binom{n_1+n_2}{n_1}$. A stars-and-bars argument means we can think of this as selecting $n_1+n_2$ elements from $A+n_1+n_2=T-n_1(t_1-1)-n_2(t_2-1)$ different locations. This totals $$\binom{n_1+n_2}{n_1}\binom{T-n_1(t_1-1)-n_2(t_2-1)}{n_1+n_2}$$

So the probability they don't overlap is:

$$p(t_1,t_2,T,n_1,n_2)=\frac {\binom{n_1+n_2}{n_1}\binom{T-n_1(t_1-1)-n_2(t_2-1)}{n_1+n_2}}{\binom{T-(t_1-1)n_1}{n_1}\binom{T-(t_2-1)n_2}{n_2}}$$

Expanding and canceling, we get:

$$p(t_1,t_2,T,n_1,n_2)=\frac{(T-n_1(t_1-1)-n_2(t_2-1))!(T-t_1n_1)!(T-t_2n_2)!}{(T-n_1t_1-n_2t_2)!(T-n_1(t_1-1))!(T-n_2(t_2-1))!}$$

Letting $A_i=T-n_it_i$, and $A=T-n_1t_1-n_2T_2$ we get:

$$p(t_1,t_2,T,n_1,n_2)=\frac{(A+n_1+n_2)!A_1!A_2!}{A!(A_1+n_1)!(A_2+n_2)!}$$ For continuous $t_1,t_2,T$, you'll need a limit of the above expression.

$$\lim_{M\to\infty} p(\lfloor Mt_1\rfloor,\lfloor Mt_2\rfloor, \lfloor MT\rfloor,n_1,n_2)$$

Which will give you the probability they do not overlap.

Using the following result, which is easy to prove directly:

For fixed $m$, $$\lim_{B\to\infty}\frac{(B+m)!}{B!B^m}=1$$

we get that this is the same as:

$$\begin{align}\lim_{M\to\infty} \frac{(AM)^{n_1+n_2}}{(A_1M)^{n_1}(A_2M)^{n_2}}&=\frac{A^{n_1+n_2}}{A_1^{n_1}A_2^{n_2}}\\ &=\frac{(T-n_1t_1-n_2t_2)^{n_1+n_2}}{(T-n_1t_1)^{n_1}(T-n_2t_2)^{n_2}} \end{align}$$

as the probability that the two events won't occur at the same time.

When $n_1=n_2=1$, this agrees with a more direct calculation of $\frac{(T-t_1-t_2)^2}{(T-t_1)(T-t_2)}$.

In your first case, $T=60, t_1=1, n_1=8, t_2=\frac{1}{2}, n_2=20$ you get $A=42, A_1=52, A_2=50$ and the probability is:

$$1-\frac{42^{28}}{52^{8}50^{20}}\approx 0.99446$$