**From New Scientist #2436, 28th February 2004**

I have assigned a number to each letter of the alphabet. The numbers, which are not all different, include negative numbers, zero, positive numbers and fractions. I can tell you that:

O + N + E = 1

T + W + O = 2

T + H + R + E + E = 3

F + O + U + R = 4

F + I + V + E = 5

S + I + X = 6

S + E + V + E + N = 7

E + I + G + H + T = 8

N + I + N + E = 9

T + E + N = 10

E + L + E + V + E + N = 11

T + W + E + L + V + E = 12

T + H + I + R + T + E + E + N = 13

F + O + U + R + T + E + E + N = 14

Find the value of (A + F + F + I + X + I + N + G) – (A + N + S + W + E + R).

[enigma1278]

### Like this:

Like Loading...

*Related*

This is the puzzle that inspired

Enigma 1292. Not surprisingly the same kind of programming approach works on it.This Python program uses the SymPy library to deal with the simultaneous equations. It runs in 450ms.

Solution:(A + F + F + I + X + I + N + G) – (A + N + S + W + E + R) = 16.Obviously we could get the same result from calculating (2F + 2I + X + G) – (S + W + E + R).

If we consider finding the multipliers for each equation such that by summing each equation multiplied by its respective multiplier we are left with the correct coefficients of each letter then we can consider the puzzle as an LP problem.

Here’s my GLPK model for the problem. (I’ve also tried to use PyMathProg to create the model without having to work out the data by hand, but it’s not working for me so far).

There are multiple solutions, but GLPK finds one set of multipliers that give the required equation:

[1] – [2] + [3] + 2×[4] + 2×[5] + [6] – 2×[7] + [8] + 5×[10] – 2×[13] – 2×[14] = 16.

Aha – I found out what the problem was with my PyMathProg solution. The bounds on a float variable default to [0, ∞), and I need them to be (-∞, ∞).

So, here’s my PyMathProg solution (it runs in 51ms):

The multipliers it finds are:

[3] + 2×[4] + 2×[5] + [6] – 2×[7] + [8] + 5×[10] + [11] – [12] – 2×[13] – 2×[14] = 16.

So while the GLPK solver made (E + N) – (T + W) from (O + N + E) – (T + W + O), the PyMathProg solution made it from (E + L + E + V + E + N) – (T + W + E + L + V + E).

I fear you’ve lost me with your multipliers.

At first sight we have 14 equations in 15 unknowns, but it’s worse than that because they’re not all independent equations. FOUR = 4 and FOURTEEN = 14, so TEEN = 10; but TEN = 10 so E = 0.

That’s reduced the number of unknowns but we have to throw out equation 14.

Now THR = 3 and THIR = 3, so I = 0. Equation 13 is out.

Continuing such reasoning, I deduce N = 4.5, O = -3.5, T = 5.5, W = 0.

But after that we have only pairs or more:

HR = -2.5, FUR = 7.5, FV = 5, SX = 6, SV = 2.5, GH = 2.5, LV = 6.5, .

It doesn’t seem to be enough to work out 2F + X + G – (S + R).

Have I missed something glaringly obvious?

From what you’ve got left:

– (H + R) – 2(S + V) + (G + H) + 2(F + V) + (S + X) = 2.5 – 5 + 2.5 + 10 + 6

⇒ (2F + G + X) – (R + S) = 16