How many squares are there in the given figure?
2023
How many squares are there in the given figure?

Answer: B. 30 — ConceptIn a regular n by n grid, a square of side k cells can start in n - k + 1 horizontal positions and n - k + 1 vertical positions. Therefore, the number…
- A.
25
- B.
30
- C.
32
- D.
More than one of the above
- E.
None of the above
Attempted by 74 students.
Show answer & explanation
Correct answer: B
Concept
In a regular n by n grid, a square of side k cells can start in n - k + 1 horizontal positions and n - k + 1 vertical positions.
Therefore, the number of k by k squares is (n - k + 1)2, and the total is the sum of these counts for k from 1 to n.
Application
The figure is a 4 by 4 grid, so n = 4.
For 1 by 1 squares, the count is 42 = 16.
For 2 by 2 squares, the count is 32 = 9.
For 3 by 3 squares, the count is 22 = 4.
For 4 by 4 squares, the count is 12 = 1.
Adding the counts gives 16 + 9 + 4 + 1 = 30.
Cross-check
The sum-of-squares formula gives n(n + 1)(2n + 1) / 6 = 4 × 5 × 9 / 6 = 30, confirming the direct count.
Thus, the figure contains 30 squares.