• Foundation
  • About 12 min
  • 5 practice questions

Counting rectangles in simple grids

Count the rectangles in a row of cells and in a small grid by choosing two vertical and two horizontal lines, with no rectangle missed or counted twice.

If something looks wrong, please tell us.

A grid of lines hides many rectangles, not only the small cells. A figure with 6 cells does not hold 6 rectangles; it holds more, because two or three neighbouring cells together also make a rectangle. This lesson gives a way to count them all, starting with a single row, so that you can find a hidden rectangle of any size in a grid.

A single row of cells

Take a row of 3 cells in a line. The rectangles are: 3 of size 1 cell, 2 of size 2 cells (the first two cells, the last two cells), and 1 of size 3 cells. That is 3 + 2 + 1 = 6. For a row of n cells the count is n + (n minus 1) + ... + 1. The shortcut is that a rectangle is fixed by choosing its left side and right side from the n + 1 vertical lines. For 3 cells there are 4 vertical lines, and choosing 2 of them can be done in 6 ways, which agrees.

Rectangles in a row of cells
Cells in the rowVertical linesWays to choose 2 linesRectangles
1211
2333
3466
451010

A grid with several rows

For a grid, a rectangle is fixed by two vertical lines and two horizontal lines. So rectangles = (ways to choose 2 vertical lines) times (ways to choose 2 horizontal lines). In a 2 by 2 grid there are 3 vertical and 3 horizontal lines. Choosing 2 of 3 can be done in 3 ways, so there are 3 times 3 = 9 rectangles. In a grid 3 cells wide and 2 high there are 4 vertical lines (6 ways) and 3 horizontal lines (3 ways), so 6 times 3 = 18 rectangles.

Worked examples

Example 1. How many rectangles are there in a 2 by 2 grid of cells? Working: 3 vertical lines give 3 pairs, 3 horizontal lines give 3 pairs. 3 times 3 = 9. Check by size: four 1 by 1, two 2 by 1 (wide), two 1 by 2 (tall), one 2 by 2. That is 4 + 2 + 2 + 1 = 9.

Example 2. How many rectangles are in a grid 3 cells wide and 2 cells high, and how many are squares? Working: all rectangles: 6 times 3 = 18. Squares: six 1 by 1 and two 2 by 2, which makes 8. So the number of rectangles that are not squares is 18 minus 8 = 10.

Example 3. The question figure is a rectangle 2 cells wide and 1 cell high. How many places can it be found in a 3 by 3 grid? Working: across, 2 positions; down, 3 rows. So 2 times 3 = 6 places, if the rectangle must lie flat as drawn.

A rectangle is fixed by two vertical lines and two horizontal lines. Count the ways to choose each pair and multiply.

— Rule to remember

Traps

  • Counting only the single cells. Rectangles made of several cells count too.
  • Counting a square as a different shape from a rectangle when the question counts all rectangles. A square is a special rectangle.
  • Counting rectangles that are not made entirely of grid lines. A hidden rectangle needs all four sides drawn.

Key takeaways. Count a row by choosing two vertical lines. Count a grid by choosing two vertical and two horizontal lines and multiplying. Check small grids by listing rectangles by size.

Check your understanding

  1. 1. How many rectangles are there in a row of 3 cells?

    1. 6
    2. 3
    3. 5
    4. 9
    Show answer

    Answer: A. 3 of one cell, 2 of two cells and 1 of three cells: 3 + 2 + 1 = 6.

  2. 2. How many rectangles are there in a row of 4 cells?

    1. 4
    2. 10
    3. 8
    4. 16
    Show answer

    Answer: B. 4 + 3 + 2 + 1 = 10. Alternatively, 5 vertical lines give 10 pairs.

  3. 3. How many rectangles, of any size, are in a 2 by 2 grid of cells?

    1. 4
    2. 5
    3. 9
    4. 16
    Show answer

    Answer: C. Choosing 2 of 3 vertical lines (3 ways) and 2 of 3 horizontal lines (3 ways) gives 3 times 3 = 9.

  4. 4. A grid is 3 cells wide and 2 cells high. How many rectangles does it hold?

    1. 6
    2. 12
    3. 24
    4. 18
    Show answer

    Answer: D. The 4 vertical lines give 6 pairs and the 3 horizontal lines give 3 pairs: 6 times 3 = 18.

  5. 5. In a grid 3 cells wide and 2 cells high, how many of the rectangles are squares?

    1. 8
    2. 6
    3. 9
    4. 10
    Show answer

    Answer: A. The squares are six 1 by 1 and two 2 by 2: 6 + 2 = 8.

Privacy · Terms · Refunds · Delivery