## Brain-Teaser 466

**From The Sunday Times, 3rd May 1970** [link]

The ferryman collected 5s. when he took six horses and two prams across the river, and 5s. 9d. when he brought six bicycles and three wheel-barrows back. He is at present collecting 4s. for two wheel-barrows, three prams and a horse.

His idiosyncratic tariff of charges is for vehicles and animals only, and not for people.

How much will he collect for his next cargo, which awaits him on the far bank and consists of one wheel-barrow, one horse, one bicycle and one pram?

[teaser466]

## Jim Randell 7:32 am

on23 March 2019 Permalink |We note that 1 shilling (s) = 12 pence (d).

So we have the following 3 equations (expression amounts in pence):

There are 3 equations in 4 variables, so we cannot work out the actual prices. But we don’t need to, we are looking for the price of a particular combination.

So, we can consider looking for multipliers

t, u, vfor the equations that give the required combination:Then the amount to be collected (in pence) is then:

Equating the coefficients of

w, h, b, pwe get the following 4 equations:which is 4 equations in 3 variables, so we try to solve them:

From [b]:

Then from [w]:

and from [h]:

And we can check [p] gives the right value (which it does).

So the equations are consistent, and the solution is:

Solution:He will collect 2s 7d.Here’s a Python program that does the same thing using the Gaussian elimination solver for linear equations from the

enigma.pylibrary. (Originally written forEnigma 287).It runs in 87ms.

Run:[ @repl.it ]LikeLike