**From New Scientist #2226, 19th February 2000** [link]

Amber cycles a distance of 8 miles to work each day, but she never leaves home before 0730h. She has found that if she sets off at *x* minutes before 0900h then the traffic is such that her average speed for the journey to work is (10 − *x*/10) miles per hour. On the other hand, if she sets off at *x* minutes after 0900h then her average speed is (10 + *x*/10) miles per hour.

(1) Find the time, to the nearest second, when Amber should set off in order to arrive at work at the earliest possible time.

Matthew lives in another town but he also cycles to work, setting off after 0730h, and he has found that his average speed for the journey to work follows exactly the same pattern as Amber’s. He has calculated that if he sets off at 0920h then he arrives at work earlier than if he sets off at any other time.

(2) How far does Matthew cycle to work?

[enigma1070]

### Like this:

Like Loading...

I solved this puzzle using the [[

`find_min()`

]] numerical solver in theenigma.pylibrary.This Python program runs in 81ms.

Run:[ @repl.it ]Solution:(1) Amber should set off at 08:29:17. (2) Matthew cycles 24 miles to work.To the nearest hundredth of a second, Amber’s start time should be 08:29:16.92. She will arrive at work at 09:38:33.84.

If Matthew sets off at 09:20, he is cycling at an average speed of 12 mph, so he makes his 24 mile journey in 2 hours and arrives at work at 11:20.

The arrival time for Amber

t(in minutes after 9am) is given by:where

xis the departure time (in minutes after 9am).This has a local minimum at:

So Amber should set off at 30.718 minutes before 9am, which we would more normally write as 08:29:17 (to the nearest second).

If the departure time is x minutes after 9, the speed is (100 + x)/600 miles per minute

and the journey time for distance d miles is 600d/(100 + x) minutes.

The arrival time is that plus x.

By differentiating we find a minimum when (100 + x)² = 600d,

so 100 + x = √(600d) and x = √(600d) – 100, which gives us expressions for both speed and times of departure and arrival in terms of x or d, depending on which we already know.