Although the public transportation system in Madrid is very good, I don’t usually take the bus or the train to move around. But sometimes my car decides I should take public transportation (bus or train). One of things I always found intriguing is that I always wait way more for the bus than what is expected according to the frequency quoted by the transportation companies at the bus or train stop. For example: if the frequency of the buses is 4 per hour, you should expect a bus each 15 minutes on average, although fluctuations around this value may occur due to traffic conditions. Thus, arriving at the bus stop at random will get you an average of 15/2 = 7.5 minutes of wait. I have the impression I always wait 15 minutes instead. How can this be? Is it that I am so unlucky I always arrive at the bus stop when the previous bus has just left?
The answer to this question is the famous waiting time paradox in queueing theory: in short, let’s assume that the times between two buses are given by the variable . In the ideal world, will be a deterministic variable. In the example above, minutes. However, due to traffic conditions and other variables, is distributed around 15 minutes. For example, the following graphic shows the “lateness”of non-frequent buses in Great Britain, extracted from the Bus Punctuality Statistics GB 2007 report
As we can see, although most of the buses were late only less than a couple of minutes, but there is an significant fraction of them that were late more than 5 minutes. And even some of them came earlier than expected! Assuming that our buses come at times drawn from the above distribution, let’s see how a day will look like from the bus stop:
Buses arrived at the bus stop (vertical lines) with time between them given by . After my car breaks down, I arrive at the bus stop at the time given by the vertical arrow. Thus I have to wait a time . The question is: what is the average value of ? Given that my car breaks at random, I can assume that my arrival time is completely at random, uncorrelated with bus time tables. However, if the time I get to the bus stop is random, I have more probability to get to the bus stop in an interval in which the time between buses is bigger. Specifically, the probability that I arrive at an interval with time between buses is
where is the average value of time between buses. Given the interval , the waiting time is equally distributed (since my arrival is random), and thus we have to multiply the above probability by . Finally, we average over all possible , giving
which give us the distribution of waiting times. The average value of is the given by
where is the variance of the times between buses. This equation is the main result. It says:
- If buses come at perfect and regular time intervals, then and the waiting time is what we expect: . That is if we expect a bus each 15 minutes, I will wait (in average) 7.5 minutes.
- However, in real world, buses do not arrive at perfect times and then > 0. Thus, waiting time is always greater than . In fact, the distribution of lateness above shows that there is a large fraction of buses with long delays and then could be very big, controlling the waiting time.
In fact, the GB Bus Punctuality Report shows that in average, waiting time exceeds 40% the expected time . That is: due to the variance in times between buses, you (and me) end up waiting a time greater than the average time between buses. And that is my feeling: if trains/buses come each 15 minutes, I end up waiting 15 minutes, not 7.5.
In a ideal world, bus timetables would quote both the frequency of the buses and their variance , so we can estimate the waiting time. Unfortunately, they just tell us part of the story…