Sunday, August 19, 2012

How many squares?

The old "how many coconuts?" puzzle had some mathematical sophistication.  Not so this recent puzzle that made the rounds on Facebook (the link may not work, in which case you'll have to go the home page of the original poster - a radio station, it seems - and look through their Wall photos album to find this):


The question, of course, was: how many squares?

Perhaps it's the apparent simplicity of the puzzle that prompted hordes of people - over 245,000 within a day or so, a veritable feeding frenzy - to comment with their answers.  Which, both predictably and sadly, were all over the place.  Even the OP had not much of a clue, claiming 25 as the "best answer" - as if this were indeed a matter of popular vote.  Shades of the Indiana legislature trying to mandate the value of pi!

Okay, lest anyone try their hand at the puzzle here, the answer is 40.  This is because the diagram is a composite of two small 2x2 grids, each of which has 5 squares, and one large 4x4 grid, which has 30 squares.

And how do we know this?  Because there is a general formula for an NxN grid: the number of squares is the sum of the squares of the numbers 1 to N.  Thus a 2x2 grid has 1 + 4 = 5 squares, and a 4x4 grid has 1  + 4 + 9 + 16 = 30 squares.

And how can we prove this formula?  By using a uniform procedure to count the squares of different sizes (1x1, 2x2, etc up to NxN).

 Imagine a unit 1x1 square superimposed on the square at the top left.  Shifting it one unit to the right, we get N positions for it.  Similarly, shifting it one unit at a time down the left side yields N possible starting points for the rightward shifts along a row.  So, there are NxN 1x1 squares in an NxN grid.   Next, start with a 2x2 square at the top left.  Shifting it one unit at a time to the right yields N-1 positions.  A similar analysis down the left side allows us to conclude that there are (N-1)x(N-1) 2x2 squares in an NxN grid.  We can repeat this analysis with progressively larger squares (3x3, up to NxN), and each time we will get a number of squares that is a perfect square, including 1 - which is the square of 1! - for an NxN square at the end.  The formula follows.

So, knowing the formula - or even working it out on the fly - would have found the answer without even counting.  Nevertheless, it's somewhat disquieting that only a very small percentage of approximately 250,000 people on Facebook - surely a representative sample of reasonably educated people -  got this puzzle right.


  

No comments: