Wednesday, August 1, 2012

Facebook Square problem and solution

Time to answer a facebook issue.  Sorry, not a political one, but a mathematical one!

There's a lot going around about how many squares are in this picture:


Now, I've seen a lot of answers, ranging from 21 to 42.  Here's the right answer, but first, lets go over a couple very important rules:

1.  You can only count squares inside this picture, no sides outside of the picture.

2.  All squares must have equal sides (judging by human eyes, none of this "there is no true square" stuff)

Okay, so here's how I counted it (thanks to MS Paint!)

First, the biggest square of all:


Sounds like a lot of people missed this in the count, but its a tricky one.  Next, let's add up the basic squares:


Now, some people may say "hey, some of those aren't really squares, they are L shapes!"  which you would be right, except the way I highlighted these by filling in black doesn't stop the four sides of the square to continue through those little ones.  So with the big one, and these 16 littler ones, we're at 17 total.  Let's check out some more squares here:


Each of these littlest ones add 4 to our count for a total of 25 (17+8).  We're not done there though.


We can't forget the two squares that make up those 8 littlest ones.  So now we're at 27 total squares.  Here's where I think a lot of people miss out on some hidden squares.


There's 3 squares that are 2x2 in the top row...



...three more in the middle row...


...and three more in the bottom row!  That brings our total count to 36!  But wait, there's 4 more here too!


And now you see the final four squares, measuring 3x3!  40 squares is what you get without overlapping.

Feel free to correct me if I forgot some I didn't overlap!