ExamShortcut

Counting Figures

🔒 Log in to track
medium importance~0-1 Q in Tier 14 formulas⚡ 4 shortcuts3 subtopics

Counting squares and rectangles

🔒 Log in to track

For a grid of m columns and n rows of equal cells:

  • Rectangles (squares included): choose 2 of the m + 1 vertical lines and 2 of the n + 1 horizontal lines → C(m+1, 2) × C(n+1, 2).
  • Squares: count k × k squares for every size k: (m − k + 1)(n − k + 1), summed for k = 1 … min(m, n).

For an n × n grid the square count is 1² + 2² + … + n² (a 3 × 3 grid has 9 + 4 + 1 = 14 squares).

Detailed notes

What the question asks

The figure is usually a grid, like a chessboard or a window with bars, and you must count squares or rectangles. A rectangle is a four-sided shape with four right angles. A square is a rectangle whose four sides are equal. So every square is also a rectangle. When a question asks for rectangles, squares are included unless it says "rectangles that are not squares".

Counting squares in a grid

In a grid of m columns and n rows of equal cells, count squares size by size.

  • 1 × 1 squares: m × n
  • 2 × 2 squares: (m − 1)(n − 1)
  • 3 × 3 squares: (m − 2)(n − 2) ... until one side reaches 1.

S=∑k=1min⁡(m,n)(m−k+1)(n−k+1)S = \sum_{k=1}^{\min(m,n)} (m-k+1)(n-k+1)

For a square grid of n × n this becomes 12+22+⋯+n2=n(n+1)(2n+1)61^2 + 2^2 + \dots + n^2 = \frac{n(n+1)(2n+1)}{6}.

Example: a chessboard (8 × 8) has 8×9×176=204\frac{8 \times 9 \times 17}{6} = 204 squares. A 4 × 3 grid has 12 + 6 + 2 = 20 squares.

Counting rectangles in a grid

A rectangle is fixed the moment you choose its two vertical sides and two horizontal sides. A grid of m columns has m + 1 vertical lines, and n rows give n + 1 horizontal lines. So

R=(m+12)×(n+12)=m(m+1)2×n(n+1)2R = \binom{m+1}{2} \times \binom{n+1}{2} = \frac{m(m+1)}{2} \times \frac{n(n+1)}{2}

Example: a 3 × 2 grid has 4 vertical and 3 horizontal lines: C(4, 2) × C(3, 2) = 6 × 3 = 18 rectangles.

A single strip of m cells has m(m+1)2\frac{m(m+1)}{2} rectangles (choose a start cell and an end cell).

Rectangles that are not squares = R − S.

Tilted squares

Joining the middles of the four sides of a square makes a tilted square (a diamond). Joining the middles again makes another upright square, and so on. Each tilted square counts once. Grid lines passing through a diamond cut it into triangles, not squares, so do not invent extra squares there.

Irregular grids

Plus signs, L-shapes and grids with missing lines break the formula. Then:

  1. Count the 1 × 1 cells.
  2. Look for each bigger size and check that all four sides are drawn.
  3. For rectangles, pick each cell as the top-left corner and count how far you can extend right and down.

Special cases

  • A line missing from the middle of a grid kills every rectangle that needs it as a side.
  • Cells must be equal for the square formula. If they are not, count by hand.
  • The outer boundary counts as one rectangle (and one square if it is square).

Quick revision

FigureSquaresRectangles
n × n grid1² + 2² + … + n²[n(n+1)/2]²
m × n gridΣ (m−k+1)(n−k+1)C(m+1,2) × C(n+1,2)
Strip of m cellsmm(m+1)/2
  • 2 × 2 → 5 squares, 9 rectangles; 3 × 3 → 14 squares, 36 rectangles; 4 × 4 → 30 squares, 100 rectangles.
  • Every square is a rectangle.
  • Irregular figure: check all four sides of every candidate.

Types of questions asked

Every way this subtopic shows up in exams — how to recognise it, the formula or logic to use, and a solved example.

Type 1: Squares in a gridvery common3 practice Q
How to spot it:

A chessboard-like grid; the question asks for squares.

S=∑k=1min⁡(m,n)(m−k+1)(n−k+1)S=\sum_{k=1}^{\min(m,n)}(m-k+1)(n-k+1)
  1. Note m columns and n rows.
  2. Add (m−k+1)(n−k+1) for k = 1, 2, … up to the smaller side.
  3. For n × n use 1² + 2² + … + n².

Why: a k × k square fits in (m−k+1) places across and (n−k+1) places down.

Example: How many squares are there in a 4 × 4 grid?

1 + 4 + 9 + 16 = 30.

Type 2: Rectangles in a gridcommon4 practice Q
How to spot it:

A grid of cells; the question asks for rectangles (squares included).

R=(m+12)(n+12)R=\binom{m+1}{2}\binom{n+1}{2}
  1. Count vertical lines (m + 1) and horizontal lines (n + 1).
  2. Rectangles = C(m+1, 2) × C(n+1, 2).
  3. For a single strip of m cells: m(m+1)/2.

Why: choosing 2 vertical and 2 horizontal lines fixes exactly one rectangle.

Example: How many rectangles are there in a grid of 4 columns and 3 rows?

Vertical lines 5 → C(5,2) = 10. Horizontal lines 4 → C(4,2) = 6. Rectangles = 10 × 6 = 60.

Type 3: Squares with a tilted (diamond) square insidecommon3 practice Q
How to spot it:

A square or grid with lines joining the middles of the sides, forming a diamond, sometimes repeated.

  1. Count the upright squares of the grid.
  2. Add each tilted square whose four sides are fully drawn.
  3. Do not count triangles formed where grid lines cut the diamond.

Why: a tilted square is a square too, but grid lines through it only make triangles.

Example: A square is divided into 4 equal squares by its two midlines, and the midpoints of its four sides are joined to form a diamond. How many squares are there?

Upright squares: 4 small + 1 big = 5. Tilted square: 1. Total = 6.

Type 4: Irregular grids (plus, L-shape, missing lines)occasional3 practice Q
How to spot it:

Cells joined in a cross, L or step shape, or a grid with a line missing.

  1. Count single cells.
  2. For each bigger shape, check all four sides are drawn.
  3. For rectangles, fix a top-left cell and extend right/down while the region stays filled.

Why: the grid formula assumes every line runs the full width; here it does not.

Example: Five equal squares form a plus sign (one in the centre, one on each side). How many rectangles are there?

Single cells: 5. Two-cell rectangles: 4 (centre with each arm). Three-cell rectangles: 2 (the full row and the full column). Total = 11.

Formulas

Rectangles in an m × n grid
R=(m+12)(n+12)R = \binom{m+1}{2}\binom{n+1}{2}

Pick two vertical and two horizontal lines.

Squares in an m × n grid
S=∑k=1min⁡(m,n)(m−k+1)(n−k+1)S = \sum_{k=1}^{\min(m,n)} (m-k+1)(n-k+1)

n × n grid: 1² + 2² + … + n².

Shortcut tricks

⚡ Line-pair trick

A rectangle is decided by its two vertical sides and two horizontal sides — so count line pairs, never shapes.

Example: Q. How many rectangles are in a 3 × 2 grid?

Sol. Vertical lines 4 → C(4,2) = 6; horizontal lines 3 → C(3,2) = 3. 6 × 3 = 18.

R = C(vertical lines, 2) × C(horizontal lines, 2).

Where students lose marks

  • Forgetting that every square is also a rectangle.

  • Using the number of cells instead of the number of lines in C( , 2).

  • Missing the larger squares (2 × 2, 3 × 3) in a grid.

Practice sets — 16 questions

Sets of 10, mixed across the question types above. Each answer comes with a step-by-step explanation.

Topic test · 10 questions

Suggested time 7 min · wrong answers go to your mistake notebook automatically.