### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,123)
- misc (2)
- project euler (2)
- puzzle (31)
- site news (43)
- tantalizer (31)
- teaser (3)

### Site Stats

- 168,282 hits

Programming Enigma Puzzles

27 February 2014

Posted by on **From New Scientist #1317, 5th August 1982** [link]

It’s easy to make up Enigmas: here are six letters-for-digits multiplication puzzles in one go! In each case, regarded as a separate problem, each letter stands consistently for a digit and different letters stand for different digits. Unfortunately I shall have to check if it’s possible to find numbers that fit and then discard the impossible puzzles (and if some numbers do fit I shall have to add additional clues to make the answer unique). How many of the following six Enigmas must I discard?

E.NIGMAS = ENIGMA

EN.IGMAS = ENIGMA

ENI.GMAS = ENIGMA

ENIG.MAS = ENIGMA

ENIGM.AS = ENIGMA

ENIGMA.S = ENIGMA

[enigma172]

Advertisements

%d bloggers like this:

We can arrive at the solution fairly easily by analysis. But this Python program checks all possible values for the letters. It runs in 3.8s (under PyPy).

Solution:Five of the equations must be discarded. Only the last one has solutions.Analytically we can see that:

simplifies to:

and any assignment of the remaining digits to E, N, I, G, M, A will give a valid equation. So there are 9!/(9-6)! = 60480 possibilities (before additional constraints, such as disallowing leading zeros, are added).

Similarly the remaining equations can be rewritten as:

The first and second equations are obviously not going to have solutions.

For the third equation GMA/ENI would be a 1 or 2 digit number, making GMAS = 10xy, but then GMA = 10x and there is no possible assignment of ENI that would make this work.

A similar argument eliminates the fourth and fifth equations from having solutions.

Hence only the last equation given in the puzzle has solutions, and they are all trivial.