A bus stop’s timetable is a list of gaps: the minutes between one bus and the next. Write average_wait(gaps): how long a passenger who turns up at a random moment waits for the next bus, on average. Nobody checks the timetable; they just turn up.
One hour at a bus stop: a bus every 10 minutes on average, but not evenly. Passengers turn up at random moments; each stick is how long one of them waits for the next bus. The obvious guess, half of 10, comes out too low. The goal is the line it ends on, the average of all the sticks. Once it has played, click a gap.
average_wait(gaps)| gaps | the minutes between one bus and the next, through the day, e.g. [5, 15] (a numpy array) | e.g. [10, 10, 10, 10, 10, 10] |
| returns | how long a passenger who turns up at a random moment waits for the next bus, on average, in minutes | |