I set up this website ages ago and have done nothing with it since. Then this morning a friend and I had the following exchange:
Him: I wonder how many hours of R4 comedy panel shows I could listen to without laughing
Me: A lot probably. I could try to model the time to first laugh with maths.
Him: I’d like that
Me: Ok give me a few mins.
It took me about eight hours to get round to it, but let’s have a go.
Since we are modelling the time to an event, let’s use the exponential distribution. We have two quantities in which we are interested:
- How long we’ve been listening in hours, which we’ll call \(t\);
- The time taken (also in hours) until the first laugh, \(T\).
Then the probability that the first laugh will occur at some time \(t\) is:
\[ \mathbb{P}(T = t) = \lambda e^{-\lambda t} \]
Perhaps more usefully we can consider the probability that the first laugh will occur at or before some time \(t\):
\[ \mathbb{P}(T \leq t) = 1 - e^{-\lambda t} \]
Unfortunately we don’t have any data to work with, because neither I nor my friend is willing to spend hours listening to Radio 4 comedy panel shows. So our approach will be to start off with a reasonable estimate for the average time it will take to laugh, then look at what that implies.
Me: I’ve just got round to doing the maths on the Radio 4 thing. I reckon 3 hours is a reasonable estimate for average time to a laugh. What do you think? Too high or low?
Him: Sounds about right. Did you actually calculate this?
The expected value (mean) of the exponential distribution is:
\[ \mathbb{E}(T) = \frac{1}{\lambda} \]
So if we think the average is 3 hours that implies that \(\lambda = 1/3\).
So if this value of \(\lambda\) is correct we would expect to have our first laugh inside the first hour roughly one quarter of the time, and within the first two hours about half the time. By the time we’ve listened to nine hours our probability of having laughed is 95%.
Of course this may not be a good model. For one thing, it assumes that the rate at which laughs occur remains constant, independent of how long we’ve been listening, which is the memorylessness property of the exponential. This may be a poor assumption: it’s possible that over time, as we become more fatigued from having listened to many hours of Radio 4 comedy panel shows, the rate at which laughs occur might change. Perhaps over time we would be lulled into finding them funnier? Or maybe we would become even less likely to find a pun about Putin and poutine funny, meaning that the rate would decrease. A more sophisticated model would almost certainly need some data for testing.
Update: 13 Mar 2022
After I posted this my friend asked me why I had chosen the exponential distribution, and it occurred to me that I had mostly just hand-waved that question by saying “since we are modelling the time to an event …” the exponential distribution would be a reasonable choice. That’s a bit weak.
The exponential distribution is a common choice for modelling waiting times, but that doesn’t explain why it’s a good choice.
The two good reasons to pick it are:
- It has a deep connection to the Poisson distribution and Poisson processes (PDF). The exponential distribution models the time between events in a Poisson process: the way I framed the problem above is just a special case of this, i.e. modelling the time to the first event. Such a process is not the only option, but it’s OK in this instance.
- For our variable \(T\) we know almost nothing except that it must be positive (since we can’t have negative time) and that we have some notion of its mean. Beyond that everything is a mystery. The exponential distribution is the maximum entropy distribution for a positive variable with a specified mean. Entropy here is good: we think it’s reasonable to assume that \(T\) has a mean, but we know nothing else beyond that. So our model where \(T \sim \operatorname{Pois}(1/3)\) is the best we can do, and will be the least surprised by whatever data we might discover (if we are ever able to persuade people to conduct this experiment).