## Teaser 2904: Catching another bus

**From The Sunday Times, 20th May 2018** [link]

I want to catch a bus into town, and I arrive at the bus stop at a random time.

The number 12 bus runs every 12 minutes, the number 15 bus runs every 15 minutes and the number 20 bus runs every 20 minutes.

All the buses leave the bus stop at an exact number of minutes past the hour and no two buses leave at the same time. Interestingly, given the above information, the probability that I catch a number 12 bus is as small as it possibly could be.

What is the probability that I catch a number 12 bus?

[teaser2904]

## Jim Randell 2:16 pm

on12 June 2019 Permalink |The period between each type of bus exactly divides 60, so in any hour period the pattern of buses is the same as the previous hour.

So if we make a timetable of the buses, as no buses arrive at the same time, the periods in between buses arriving is spent waiting for the next bus, so by examining the gaps between buses we can determine the proportions of the hour spent waiting for each type of bus.

This Python program runs in 76ms.

Run:[ @repl.it ]Solution:The probability of catching a number 12 bus is 7/20.If we start the hour when a #20 bus is at the stop, then the #20 buses arrive at: +0, +20, +40, +60.

The first #12 bus arrives at +5 minutes, so has a timetable of: +5, +17, +29, +41, +53.

The first #15 bus arrives at +13 minutes, so has a timetable of: +13, +28, +43, +58.

So the timetable looks like this:

Adding the waiting times for each type of bus we get:

So if we arrive at a random time during the hour the probability the next bus is #12 is 21/60 = 7/20.

LikeLike