# How to choose whether to quit the bus queue or stay there using probability theory?

I've been thinking of something for some time now, and since I am not very proficient in probability theory I thought this could be a good place to ask this question. This is something that came up to me in the long queues of the public transport.

Suppose that you're in a bus station, and you know that a bus (or several buses) will certainly come in the future (during the day,) but you don't know the exact moment. You imagine a probability that the bus will arrive within five minutes. So you wait five minutes. But the bus doesn't arrive. Is now the probability less than or greater than the original one you imagined?

The question is because if you're using the past to predict the future, maybe you won't be very optimistic about the bus arriving. But maybe you could also think that it actually makes the event more likely: since the bus hasn't arrived yet, there are less minutes available in the day and thus the probability is higher.

Think of the last five minutes of the day. You've been there the whole day and no buses have come. So, judging solely from the past, you can't predict that the bus is going to arrive within the next five minutes. But since you're sure that a bus will arrive before the day ends, and there are only five minutes for the day to end, you can be 100% sure that the bus wil arrive within five minutes.

So, the question is, if I'm going to calculate the probability and drop out of the queue, which method should I use? It's because sometimes I quit and suddenly the bus arrives, but sometimes I wait and wait and wait and the bus doesn't come. Or maybe this whole question is nonsense and that is simply terribly random?

I think you answered your own question. Suppose you are sure that n buses will arrive by the end of the day (which is h hours away) but are not sure when in those h hours they will arrive, you can use a poisson distribution with rate equal to n/h and compute the probability of a single bus arriving in the next ten minutes, say. As you wait for the bus and h starts to reduce, the rate n/h begins to increase and the chance that a buss will arrive in the next ten minutes increases. So with every passing moment, it makes less and less sense for you to quit the queue (assuming the bus will have space for you when it arrives).

• Nice answer, many thanks. I had the same intuition, but I didn't know it was called a Poisson distribution. Aug 19 '15 at 15:23
• If you truly model bus arrivals as a Poisson process, then this is precisely not true. Poisson processes are "memoryless", as they model the event of a bus arrival at any moment as a constant probability through time. I.e. after you have waited 5 minutes with no bus arriving, then the model will predict the same probability for a bus arriving in the next 10 minutes as in the original 10 minutes. Aug 20 '15 at 6:08
• leekaiinthesky, you are correct that for a given rate, poisson is a memoryless distribution. However if we are sure that n buses will arrive by the end on the day, then the rate itself continuously increases. Aug 20 '15 at 12:57
• Even under those specific assumptions using the Poisson distribution does not give the correct answer. Your argument is based on the rate increasing because you know that n busses will arrive in total, but in the Poisson distribution the total number of events is not fixed. Also even in the 10 minutes you want to calculate the probability for, the rate would already change according to your argument. This is only an approximation - which would still be a good answer if you discuss how good the approximation is.
– Erik
Sep 3 '15 at 6:55

It depends on how near to a schedule your buses are coming at.

1. If they're on a regular schedule, every minute you wait is a minute closer to a bus arrival, and on average you wait half the inter-bus interval.

2. If the buses were to arrive at varying inter-bus times, at a certain average rate per hour, you're more likely to arrive at the bus stop in a long gap than a short one. Indeed, if they arrive "effectively at random" (according to a Poisson process) it doesn't matter how long you wait, your expected remaining wait is the same.

3. If things get worse than that (gappier/burstier than "random" arrivals, perhaps because of traffic issues) then you could be better off not waiting.

• Okay, I'll try to digest that. Thanks. So if we don't know the average rate per hour, we basically can't tell anything? Aug 17 '15 at 21:47
• If you are waiting 23 hours and the bus still hasn't come, please ignore the premise of distributions (cdf) always adding up to 1. The bus will simply not come. In general, Europeans would believe in a uniform distribution, a good bet if you are Japanese; for Americans public transportation is looked upon more with the jaundiced eye of a Poisson, memoryless process, and they drive their own cars... Think about it... No matter how long you've waited the probability of the bus coming at a certain time remain stubbornly the same. I have heard that the Weibull distribution can help, but not sure. Aug 17 '15 at 22:14
• Here's a great, and free, paper on the Weibull and this topic. Aug 17 '15 at 22:26
• @Antoni Thanks. There's an extent to which probability models (like the Poisson in item 2 in my answer) don't really work for this problem; bus arrivals aren't really a random process in the way described above. If you push them hard enough, of course the conclusions they'd lead to will not make sense. Aug 18 '15 at 0:58
• @AntoniParellada and Glen_b many thanks for your answers. I hadn't imagined so much was behind this question. I'll keep studying to understand all that you have kindly written. Have an excellent day. Aug 18 '15 at 3:44

great question!

From a probability perspective, waiting may certainly make the odds go up. That will be true of Gaussian and Uniform distributions. It would not, however, be true for exponential distributions - the neat thing about exponential distributions being "memoryless" in that sense as the probably for the next interval is always the same.

However, I think a more interesting thing might be to generate some cost function. What is the cost of the alternate transportation (taxi, ueber)? What is the cost of being late? Then you can dust off the calc book and minimize the cost function.

To convince myself that the odds always increase for Gaussian distributions, I wrote a bit of matlab, but I will try to come up with something more mathematically pure. I think for uniform it is obvious, as the numerator is constant (until nothing) and the denominator is always decreasing towards nothing.

• An assumption of the OP is that "you're sure that a bus will arrive before the day ends," which puts some interesting restrictions on the probability distribution. I wish I had such certainty in real life.
– EdM
Aug 17 '15 at 13:32
• @MikeP Thanks for your answer. Does that apply even when the underlying distribution is unknown? Or maybe I can assume a certain distribution? Being that the case, it could be that as time goes by, I can change my opinion and say that such distribution no longer holds and look for another one. The memoryless distribution sounds nice, but maybe what I'd like to know requires a distribution that takes the past into account. Aug 17 '15 at 16:23
• No problem @NormanSimon! Not always. For example, suppose that you have a trimodal pdf, i did a quick example with the sum of 3 gaussians (each with sigma of 3, with means of -8, 0, and +8. In this case, as you came over a hump, the odds actually dropped slightly for the next 3 minute stretch. Aug 17 '15 at 17:19
• Oh, dear, Mike, it's sounds so complicated! But I promise I'll keep studying. Maybe I'm asking too advanced questions while I'm still a beginner. But many, many thanks =) Aug 18 '15 at 4:12

If you drop the restriction that the bus must arrive at some point during the day then it can be argued that the longer you wait, the longer you expect to have still to wait. The reason? The longer you wait, the greater your belief that the Poisson rate parameter is small. See question 1, here.

• You're welcome. But I meant "rate parameter is large", not small ...! I've edited my answer accordingly. Sep 4 '15 at 13:39