# Probability two people will talk at the same time

The other day, I was talking to a friend, and then one of those lulls in the conversation came, where we had nothing more to say on the current subject and a new topic didn't immediately come to mind. We both decided to end the gap and start talking at the same time, as sometimes happens. What are the odds of that happening? I thought. I tried to work it out, but my lack of knowledge in probability and statistics (a class I'm taking next semester, though) prevented me from getting very far.

First, let's count two people talking within one second of each other as breaking the gap. That seems like a reasonable number.

Second, it seems that the average length of these gaps between topics is only a few minutes, and more often than not, they're broken by one person or the other, rather than both attempting it simultaneously. I assume there's some reasonable first approximation formula $p(t)$ to model the probability that a given person will talk at time $t$, then those probabilities are somehow combined (addition? multiplication?) for the number of people in the conversation, and you get the result.

How can I find the solution from here?

Assume that you have just finished talking about one topic. Let's assume we have $n$ people.

If we model the number of seconds the $i^{th}$ person typically takes to start a new conversation as a continuous random variable $S_i$, what we need to compute is the probability that, in a sample of these n random variables, the first two happen within 1 second of each other.

A natural assumption is that each of the $S_i$ is exponentially distributed, and that everyone takes on average the same time to start a new topic (probably not true, but let's keep it simple for now). This means: $$p(S_i = x) = \lambda e^{-\lambda x}$$

The parameter $\lambda$ is the inverse of the average time a single person takes to come up with a new topic. In order to simplify things let's think about a version where there are only 2 people speaking, you want $p(|S_1 - S_2|) < 1$, which is $p(S_2 \in [S_1, S_1+1]) + p(S_1 \in [S_2, S_2+1])$ This is equivalent to:

$$\int_0^{\infty} \int_{s_1}^{s_1+1} p(S_1=s_1) \cdot p(S_2=s_2) ds_2 ds_1 + \int_0^{\infty} \int_{s_2}^{s_2+1} p(S_1=s_1) \cdot p(S_2=s_2) ds_1 ds_2$$

Since the probability distributions for $S_1$ and $S_2$ are the same, we have:

$$2 \cdot \int_0^{\infty} \int_{s_1}^{s_1+1} p(S_1=s_1) \cdot p(S_2=s_2) ds_2 ds_1$$

Replacing the probability density function:

$$2 \cdot \int_0^{\infty} \lambda e^{-\lambda s_1} ds_1 \int_{s_1}^{s_1+1} \lambda e^{-\lambda s_2} ds_2$$

It is easy to integrate the exponential pdf (try it!) and the result is $1 - e^{-\lambda}$. Without surprise, the probability that two people start a topic at almost the same time grows with $\lambda$. A large $\lambda$ means that people take little time to start a new topic on average, so the probability of collision increases.

If you want to model this for two people that come up with a new topic at different rates, you can use two different distributions with $\lambda_1$ and $\lambda_2$. This time you have to compute the two original integrals. Computing this yields: $$\frac{(1-e^{-\lambda_2})\lambda_1 + (1-e^{-\lambda_1})\lambda_2}{\lambda_1 + \lambda_2}$$

Again, as the $\lambda$ increase the probability of getting two people talking at the same time increases. You can check the heatmap below to see its shape. The x-axis represents the average time the first person takes to initiate a new topic ($\lambda_1^{-1}$) and the y-axis the same for the second person ($\lambda_2^{-2}$).

So, now that we have solved this for the case of 2 people how can we solve it for the case of $n$? I think it's probably easier if we try to compute the probability of the opposite event: that a single person comes up with the topic alone, which means everyone else would have come up with a new topic more than 1 second later.

The probability that the first person comes up with a new topic alone is: $$\prod_{i=2}^n p(S_i > S_1 + 1)$$

The probability that any person comes up with the topic alone is the sum of the above for each person: $$\sum_{i=1}^n \prod_{j \neq i} p(S_j > S_i + 1)$$

Let's assume again that $S_i$ has an exponential distribution with parameter $\lambda_i$. Let us first determine what is the integral for $p(S_j > S_i + 1)$:

$$\int_0^{\infty} \int_{s_1+1}^{\infty} p(S_i=s_i) \cdot p(S_j=s_j) ds_j ds_i$$

Solving this integral yields:

$$\frac{\lambda_i e^{-\lambda_j}}{\lambda_i + \lambda_j}$$

Therefore the probability that two people initiate a new topic at "the same time" is:

$$1 - \sum_{i=1}^n \prod_{j \neq i} \frac{\lambda_i e^{-\lambda_j}}{\lambda_i + \lambda_j}$$

If everyone takes the same time $\lambda^{-1}$ on average to start a new topic, the above becomes:

$$1 - \sum_{i=1}^n \prod_{j \neq i} \frac{\lambda e^{-\lambda}}{2 \lambda} = 1 - \sum_{i=1}^n \frac{e^{-(n-1)\lambda}}{2^{n-1}} = 1 - n \frac{e^{-(n-1)\lambda}}{2^{n-1}}$$

Just as a sanity check, if you take $n$ to be 2, the above simplifies to our original formula $1 - e^{-\lambda}$ =)