[Math] How many squares are in this image? Is there a method to check

puzzle

In this image I have counted 14 but others say 18.

enter image description here

Is there a method to check exactly?

Best Answer

[I will give two methods. The SECOND one is the better one.]

Method? Well, sort of, you can look at each "atom" piece and count how many squares that is the upper right hand corner of.

A)Top right square -> top right square; engulf the the rectangles for a 3 by 3, the whole 4x4 = 3.

B) top middle rectangle -> 2x2 square; 3x3 square = 2.

C) top left square -> top left square = 1.

D) middle side rectangle -> 2x2 square; 3x3 = 2.

E) next square in the (2,2) spot -> 1x1;2x2;3x3 = 3

F) (3,2) spot ->1x1; 2x2 = 2

G) (4,2) spot -> 1x1 = 1

H) (3,2) spot -> 1x1; 2x2 = 2

I) (3,3) spot -> 1x1 = 1

J) (4,1) spot -> 1x1 = 1

K) low middle rectangle = 0

L) (4,4) spot -> 1x1 = 1

So total: 18

=======

This i a simplification of simply figuring out the squares in a complete grid and subtracting the one that rectangles make impossible.

A 4x4 grid will have: 16 1x1 squares; 9 2x2 squares (as there are 3 squares in each of the top 3 rows that can be an upper right hand corner of a 3x3 square), 4 3x3 squares, and 1 4x4 square.

So an n x n grid will have $\sum k^2$ total squares.

In this case 16 + 9 + 4 + 1 = 30.

The first top rectangle eliminates 2 1x1 squares and 1 2x2 square. So only 27 possible.

The left side rectangle eliminates 2 1x1 squares and 1 2x2 square. So only 24 possible.

The right side triangle eliminates 2 1x1 squares (1 2x2 that was already eliminated) and a 3x3. So only 21 possible.

The bottom rectangle eliminates 2 1x1 squares, 2 2x2 squares. So only 18 possible squares.