How many squares are there in the given figure?

2023

How many squares are there in the given figure?

Four-by-four square grid consisting of sixteen equal square cells

Answer: B. 30ConceptIn 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…

  1. A.

    25

  2. B.

    30

  3. C.

    32

  4. D.

    More than one of the above

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

  1. The figure is a 4 by 4 grid, so n = 4.

  2. For 1 by 1 squares, the count is 42 = 16.

  3. For 2 by 2 squares, the count is 32 = 9.

  4. For 3 by 3 squares, the count is 22 = 4.

  5. For 4 by 4 squares, the count is 12 = 1.

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

Explore the full course: Rssb Senior Computer Instructor

Loading lesson…