- 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.
| Cells in the row | Vertical lines | Ways to choose 2 lines | Rectangles |
|---|---|---|---|
| 1 | 2 | 1 | 1 |
| 2 | 3 | 3 | 3 |
| 3 | 4 | 6 | 6 |
| 4 | 5 | 10 | 10 |
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.
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. How many rectangles are there in a row of 3 cells?
- 6
- 3
- 5
- 9
Show answer
Answer: A. 3 of one cell, 2 of two cells and 1 of three cells: 3 + 2 + 1 = 6.
-
2. How many rectangles are there in a row of 4 cells?
- 4
- 10
- 8
- 16
Show answer
Answer: B. 4 + 3 + 2 + 1 = 10. Alternatively, 5 vertical lines give 10 pairs.
-
3. How many rectangles, of any size, are in a 2 by 2 grid of cells?
- 4
- 5
- 9
- 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. A grid is 3 cells wide and 2 cells high. How many rectangles does it hold?
- 6
- 12
- 24
- 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. In a grid 3 cells wide and 2 cells high, how many of the rectangles are squares?
- 8
- 6
- 9
- 10
Show answer
Answer: A. The squares are six 1 by 1 and two 2 by 2: 6 + 2 = 8.
Sign in to keep track of the lessons you finish.