Checkmate! A mathematical solution to a life-or-death problem

10 Oct 2016

Image: George Kuryatov/Shutterstock

Maths can be challenging. Maths can be fun. And, on rare occasions, maths can even be life-saving.

Last week, we learned how Wonderland was getting along without Alice, and it wasn’t good news for a few unlucky playing cards.

In the intervening time, their luck changed – or rather, their approach did.

Future Human

As we know, the playing cards are rather intelligent. One cannot be fascinated with maths without becoming, over time, a logical thinker.

After the debacle of the not-quite-a-chessboard, the playing cards put their heads together to try and figure out how they could dodge the Queen of Heart’s ire and the executioner’s blade long enough to still be in one piece when the Red Queen and the White Queen returned for another match.

Suddenly, one of them had a brainwave.

“Fellas! Let’s learn how to draw a chessboard correctly and surprise our Queen with it before her next match. That might calm her a little,” he said.

The other cards all agreed.

Although distracted by their new, important task, the old adage still held true: once a mathematician, always a mathematician.

The cards set to work, laying out the correct 8 x 8 array of squares.

After a while, one of the cards called out to his comrades: “Hey! Let’s say we wrote either 1 or -1 in each square on this board, in such a way that each row and each column added up to -1. How many different ways could we do that?”

“An interesting question,” said one of the other cards. “Here’s another: If we add up all of the numbers that satisfy those conditions, is it possible for us to reach 10?”

Good questions, both. Can you answer them?

Scroll down for the solution to this week’s puzzle.

Chess game action shot

Chess game action shot. Image: Orla/Shutterstock


Let’s first deal with the question of how many different ways the cards can lay out the board so that each row and each column adds up to -1.

The first row can be filled in 27 ways. Each of the first seven unit squares in this row can be filled in two ways (with either 1 or -1). But, for the last unity square, there is only one possibility, as the product of all eight numbers in the row must be -1.

Rows two, three, four, five, six and seven can be filled in 27 times each.

Now, if you consider the product of the numbers in each column, we realise that each of the squares in row eight can be filled in only one way.

Thus, we know that the total number of different ways to lay out the board is 27(7), or 249.

Next, we turn to the question of adding all 64 numbers to reach 10.

Denote by a1, a2, …, a8 the number of times -1 appears in rows 1, 2, …, 8, ie, a1 denotes the number of times -1 appears in row one.

As the product of numbers in each row is -1, each ai (where i signifies the row) must be odd. Also the number of times 1 appears in row i equals 8 – ai.

The total number of times 1 appears on the board is therefore 64 – (a1 + a2 + … + a8).

The sum of all numbers, then, is 64 ­– 2(a1 + a2 + … + a8).

As all numbers on each row are odd, a1 + a2 + … + a8 must be even. It follows that S must be a multiple of 4.

Because of this, S cannot equal 10.

This week’s maths puzzle comes courtesy of Dr Marius Ghergu, School of Mathematics and Statistics, University College Dublin, who is actively involved in the UCD Mathematics Enrichment Programme and the Irish Mathematical Olympiad.

Want stories like this and more direct to your inbox? Sign up for Tech Trends, Silicon Republic’s weekly digest of need-to-know tech news.

Kirsty Tobin was careers editor at Silicon Republic