### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (49)
- teaser (3)

### Site Stats

- 184,818 hits

Advertisements

Programming Enigma Puzzles

28 November 2012

Posted by on **From New Scientist #2893, 1st December 2012** [link]

My uncle came to visit me by car on three days last week, taking the same round route each time, but returning by a different road from the one used to come to my hilltop home. On his arrival at my home on the first day, the miles per gallon (mpg) reading on his car’s display was 36.0, on the second 42.5 and on the third 44.0, when it also gave a reading of 71.5 for the cumulative mileage.

He told me that he had zeroed the display before he set out on day one, and had made no other journeys. He also says that, if I assume the mpg for the common approach and common return journeys are consistent from day to day, and that all the numerical values are exact, I should get a whole number answer for the mpg for the journey from my house back to his.

What is this whole number?

[enigma1726]

Advertisements

%d bloggers like this:

The problem boils down to a set of 4 equations in 4 variables. This program uses

SymPyto solve them (although you can do it on the back of an envelope if you prefer – or useWolfram Alpha). It runs in 288ms.Solution:The fuel consumption for the return journey is 62 mpg.Here’s the back of the envelope method:

From day 1 we deduce:

From day 2:

which we can rewrite as:

From day 3:

which we rewrite as:

subtracting these two we get:

and substituting for d

_{1}:which simplifies to:

So, rewriting things in terms of g

_{2}we get, from day 1:and from day 2:

which simplifies to:

And the solution we are looking for (fuel consumption on the return journey) is given by:

We can then go further and determine that values for all the variables using the additional information we are given, which is the cumulative distance:

rewriting in terms of g

_{2}, we get:which simplifies to give us a value for g

_{2}:and then the other values follow: