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.

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.*

**Solution:**

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 2^{7} 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 2^{7} 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 2^{7(7)}, or 2^{49}.

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

Denote by *a _{1}*,

*a*, …,

_{2}*a*the number of times -1 appears in rows 1, 2, …, 8, ie,

_{8}*a*denotes the number of times -1 appears in row one.

_{1}As the product of numbers in each row is -1, each *a _{i}* (where

*i*signifies the row) must be odd. Also the number of times 1 appears in row

*i*equals 8 –

*a*.

_{i}The total number of times 1 appears on the board is therefore 64 – (*a _{1}* +

*a*+ … +

_{2}*a*).

_{8}The sum of all numbers, then, is 64 – 2(*a _{1}* +

*a*+ … +

_{2}*a*).

_{8}As all numbers on each row are odd, *a _{1}* +

*a*+ … +

_{2}*a*must be even. It follows that S must be a multiple of 4.

_{8}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.*