Alphacipher Puzzle

2 minute read

The Alphacipher Puzzle is described here.

I’ve tried to solve these before and have found them very difficult. However, I have now come up with three different solving methods.

Method One - Solve by Hand

This is the method described in the solving guide.

Real-world puzzles generally turn out a lot more complicated than the examples given in the guide, however, with persistence it is possible to solve one of these puzzles with just pen and paper and a lot of experimentation.

I have created an exact step by step solution here for the example puzzle given with the puzzle description.

Method Two - Use a Constraint Solving Package

Use special software designed for solving mathematical problems. In other words, cheat!

For this puzzle I used the Minion Solver. All that is required is that the puzzle be phrased in terms of mathematical constraints in a format that Minion can understand. For the example puzzle I created this input file.

Depending on the solver you use, and on the puzzle, it can sometimes take a very long time to reach a solution. There are 26! different ways of allocating the numbers to the letters, which is a lot of different possibilities for the solver to try if it can’t narrow the puzzle down somehow as it solves it.

Method Three - Use Mathematics

This method uses some of the mathematical properties of the Alphacipher puzzle in order to come up with an exact process for reaching an answer.

In mathematical terms, what you need to do is write out the puzzle as a system of linear equations, which you enter into a spreadsheet in the form of a matrix. There should be a row for each clue, plus a final row to represent the condition that all of the letters add up to 325. (ie 1 + 2 + … + 25 + 26 = 325)

You then need to use elementary row operations in order to convert your matrix into Reduced Row Echelon form. The process is described here.

Theoretically you could do this by hand but it would involve a lot of adding up, erasing and re-writing. It is possible you could find some software to do this, (eg MATLAB), however, I discovered that it is possible to do this by hand using just a few different repeated operations in a spreadsheet.

In fact, all you need to do is use Copy and Paste Special -> Add/Subtract to reproduce the elementary row operations. You can also use normal Copy/Paste to move rows around. It is possible to multiply rows by a constant by using Paste Special -> Multiply, so long as you create a row of the constant you wish to multiply by. It is also possible to just use repeated Addition/Subtraction to avoid having to do multiplies. This also allows you to always keep digits as integers.

The presence of the extra condition involving all of the letters means that if you are careful with your choice of row reduction operations, you shouldn’t need to completely solve the puzzle just to get the single missing letter.