BTT Mathematics / Primary Mathematics Learning Hub
Finding some shapes is a search. Counting every valid shape exactly once requires a system. A reliable solution explains both why nothing was missed and why nothing was counted twice.
A grid with two rows and three columns contains six small cells. But it contains more than six rectangles. Two neighbouring cells can form a larger rectangle, three cells can form a whole row, and both rows together can form still larger rectangles. The small visible pieces are only one size class.
The challenge is not to look harder at the same picture. It is to choose a description that identifies each shape uniquely. A rectangle can be named by its top, bottom, left and right boundaries. A square can be named by its size and position. In a simple triangular fan, a triangle can be named by the pair of rays that form its sides.
This guide develops original worked examples and 24 practice questions for Primary Mathematics enrichment. The complete-counting formulas are optional extensions. A learner can first use labelled lines, organised lists and small tables. The work is not presented as a required formal combinatorics syllabus for every Primary level.
Counting rules · All rectangles · Squares · Restrictions · Triangles · 24 questions · Worked solutions
1. Decide what counts as a different shape
Unless a question states otherwise, the grids here consist of unit square cells. All horizontal and vertical grid segments are drawn. Count rectangles whose sides follow those lines; do not invent diagonals. Shapes in different positions count separately, even if their size is identical. Squares count as rectangles because they satisfy the rectangle definition.
Consequently, “all rectangles” includes squares, while “rectangles that are not squares” excludes them. Naming this convention at the start prevents a disagreement caused by two different interpretations of the same word.
A grid described as three rows by four columns has twelve cells, four horizontal boundary lines and five vertical boundary lines. Cell counts and boundary-line counts are different. A formula using line pairs must use four and five, not three and four.
The smallest complete example
+---+---+---+ | | | | +---+---+---+ | | | | +---+---+---+
This two-row, three-column grid contains six unit cells. Start by counting rectangles one row high. Width one gives six positions, width two gives four, and width three gives two. There are twelve one-row-high rectangles.
Now count rectangles two rows high. Width one gives three positions, width two gives two, and width three gives one. There are six of these. The complete total is twelve plus six, or eighteen rectangles.
The organisation provides a completeness argument: every rectangle has height one or two, and every possible width in each height group was included. There is no third height and no fourth width that could fit the grid.
2. Count rectangles by their boundary lines
A rectangle requires two different horizontal lines: one top and one bottom. It also requires two different vertical lines: one left and one right. Once those four boundaries are chosen, there is exactly one rectangle.
In the two-row, three-column grid, the three horizontal lines have three unordered pairs. Label them H0, H1 and H2: the pairs are H0–H1, H0–H2 and H1–H2. The four vertical lines have six unordered pairs. Each horizontal pair can combine with each vertical pair, giving 3 × 6 = 18 rectangles.
Why we use unordered pairs
Choosing H0 then H2 produces the same pair of boundaries as choosing H2 then H0. It does not produce a second rectangle. If there are four lines, choosing a first line in four ways and a second different line in three ways produces twelve ordered selections, but every boundary pair appears twice. There are six unordered pairs.
A younger learner can count them as 3 + 2 + 1 = 6: three possible partners for the first line, two new partners for the second, and one for the third. The optional formula for k lines is k × (k − 1) ÷ 2.
Worked example: three rows by four columns
There are four horizontal boundary lines, giving six pairs, and five vertical boundary lines, giving ten pairs. The total number of rectangles is 6 × 10 = 60.
For a complete r-row, c-column grid, the same reasoning gives:
Rectangles = [r(r + 1) ÷ 2] × [c(c + 1) ÷ 2].
The expression is not a substitute for checking the drawing. It assumes complete horizontal and vertical boundaries. Missing segments or forbidden regions require additional reasoning.
Why this method is exhaustive
Every valid axis-aligned rectangle has one top line, one bottom line, one left line and one right line. Therefore every valid rectangle appears among the boundary choices. Conversely, in a complete grid, every such selection produces a valid rectangle. Because distinct boundary selections produce distinct rectangles, no selection duplicates another.
These two directions matter. A list that contains only valid shapes can still be incomplete. A formula that includes all possibilities can still count some of them twice. Boundary selection establishes validity, completeness and uniqueness together.
3. Check the total by size and position
A second method is to count each possible height and width. A rectangle h cells high can start in r − h + 1 vertical positions within r rows. A rectangle w cells wide can start in c − w + 1 horizontal positions within c columns. Multiply these position counts.
In a four-row, five-column grid, a rectangle two cells high and three cells wide has three possible top-row positions and three possible left-column positions. There are 3 × 3 = 9 placements.
Rotating the required shape gives a rectangle three cells high and two cells wide. That has 2 × 4 = 8 placements. If either orientation is allowed, the total is seventeen. Do not assume the two orientation counts are equal merely because the small rectangle has the same area.
| Height | Width 1 | Width 2 | Width 3 | Width 4 | Total |
|---|---|---|---|---|---|
| 1 | 12 | 9 | 6 | 3 | 30 |
| 2 | 8 | 6 | 4 | 2 | 20 |
| 3 | 4 | 3 | 2 | 1 | 10 |
The table totals sixty, agreeing with the boundary-pair method. This is a useful independent check because it organises the same objects in a different way.
4. Count squares by side length
A square on a unit square grid must have the same number of rows and columns. In a three-row, four-column grid, a unit square has twelve placements. A two-by-two square has 2 × 3 = 6 placements. A three-by-three square has 1 × 2 = 2 placements. No larger square fits.
The total is 12 + 6 + 2 = 20 squares. Since the sixty rectangles include those twenty squares, the number of non-square rectangles is 60 − 20 = 40.
Worked example: four rows by five columns
Count square placements by side length. Side one gives twenty, side two gives twelve, side three gives six, and side four gives two. Total squares = 20 + 12 + 6 + 2 = 40.
All rectangles total ten horizontal boundary pairs times fifteen vertical boundary pairs, or 150. Hence there are 150 − 40 = 110 non-square rectangles. Counting rectangles and counting squares are related, but they need different size restrictions.
Worked example: a five-by-five grid
Square counts are 25 + 16 + 9 + 4 + 1 = 55. The outermost five-by-five square is easy to forget because the eye often focuses on smaller pieces. By listing side lengths from one to five, it receives its own final category.
The rectangle total is fifteen horizontal pairs times fifteen vertical pairs, or 225. The square total of fifty-five should not be confused with the twenty-five unit cells. Each answers a different question about the same grid.
Equal grid spacing is part of the square rule
Counting k rows by k columns gives a square only when the cells themselves are square with matching horizontal and vertical unit lengths. If a cell is twice as wide as it is high, a one-column, two-row shape may be physically square. In that situation, compare actual side lengths rather than row and column counts alone.
This boundary prevents a formula from becoming a visual guessing rule. Rectangle counting still uses perpendicular line pairs, but square counting needs equal side lengths.
5. Count only shapes that satisfy the extra condition
Suppose a four-row, five-column grid asks for rectangles of area six square units. The whole-number dimension pairs are 1 by 6, 2 by 3, 3 by 2, and 6 by 1. The first and last do not fit. The remaining two orientations have nine and eight placements respectively, giving seventeen rectangles.
The arithmetic six = two times three does not complete the solution. We must also check whether each orientation fits and how many positions it can occupy. A correct area does not specify a unique location.
Fixed width, any valid height
In a three-row, five-column grid, count rectangles exactly two cells wide. There are four possible pairs of vertical boundaries with that separation. Any of the six horizontal boundary pairs may be used. The total is 4 × 6 = 24.
This mixes a dimension restriction on one axis with unrestricted boundary selection on the other. The method is efficient because it matches the condition directly instead of listing every rectangle and discarding most of them afterward.
6. Rectangles containing a specified cell
Use a three-row, four-column grid and mark the cell in row two, column two. Number rows from the top and columns from the left. Count rectangles that contain the entire marked cell, not merely touch one of its corners.
The top boundary can be above row one or above row two: two choices. The bottom boundary can be below row two or below row three: two choices. The left boundary can be before column one or before column two: two choices. The right boundary can be after column two, three or four: three choices.
The number is 2 × 2 × 2 × 3 = 24. Each combination encloses the selected cell, and every enclosing rectangle has exactly one such boundary combination.
A corner cell gives a simpler case
For the top-left cell of the same grid, the top and left boundaries are forced. The bottom boundary has three choices and the right boundary four. Therefore twelve rectangles contain that corner cell.
The difference between twelve and twenty-four is about available boundary choices, not the marked cell’s area. A central cell can be included in more spanning rectangles because boundaries can extend in more directions.
Use the complement when exclusion is easier
How many rectangles avoid the row-two, column-two cell? There are sixty rectangles altogether, and twenty-four contain that cell. Because the grid-aligned boundaries cannot pass through the interior of a cell, every rectangle either contains that cell or avoids its interior. Thus sixty minus twenty-four gives thirty-six.
Here, “avoid” permits touching a boundary of the marked cell. If even boundary contact were forbidden, the answer would change. Define the condition before borrowing the subtraction method.
7. Missing lines are not the same as forbidden cells
Take a two-by-two grid and label its nine intersection points as follows. All adjacent horizontal and vertical segments are initially drawn.
A---B---C | | | D---E---F | | | G---H---I
The complete grid has nine rectangles and five squares. Now erase only the segment EH, from the centre to the bottom middle. All other segments remain, including the full outside boundary.
A rectangle is invalid only if its required boundary uses the missing segment. The two bottom unit squares fail. The two full-height, one-column rectangles also fail. Those are four invalid rectangles, leaving 9 − 4 = 5 valid rectangles.
List the surviving five to check completeness: the two top unit squares, the whole top row, the whole bottom row, and the outer two-by-two rectangle. The bottom-row rectangle remains valid because the missing segment lies inside it, not on its boundary.
Of the surviving shapes, the two top unit squares and the outer square are squares, giving three. Erasing an internal segment does not automatically erase every larger shape passing across that location.
Why the complete-grid formula cannot be used uncorrected
The line-pair formula assumes that every chosen side is fully drawn. After a segment is removed, some boundary choices no longer form complete rectangles. Either enumerate the valid cases directly or start from the complete total and subtract a carefully justified set of invalid cases.
With several missing segments, the invalid sets can overlap. A rectangle using two missing segments must still be removed only once. This is a genuine link to Inclusion–Exclusion, not merely a shared keyword.
8. A triangle requires three fully drawn sides
A grid made entirely of horizontal and vertical lines contains no triangles whose sides follow the drawn lines. Three non-degenerate sides cannot close a triangle using only two perpendicular directions. A learner who sees a diagonal connection in imagination has introduced an edge that the problem did not supply.
For triangles, identify three non-collinear vertices and check that every connecting side is drawn completely. A side may contain intermediate intersection points and still count as one straight side. Conversely, three points on one line do not form a triangle, however many segments connect them.
A square with one diagonal
Draw square ABCD in cyclic order and only diagonal AC. There are two triangles, ABC and ACD. A proposed triangle ABD would require diagonal BD, which is absent. Four corners alone do not make all four possible corner-triples valid.
A square with both diagonals
Now draw both AC and BD, intersecting at O. Four small triangles use O and two neighbouring corners: ABO, BCO, CDO and DAO. Four larger triangles use three corners: ABC, ABD, ACD and BCD. Total: eight.
An independent check selects three of the five points A, B, C, D and O. There are ten triples. Two are collinear, AOC and BOD, and therefore invalid. Every remaining triple has its three sides drawn, leaving eight. This check works for this particular complete set of segments; it is not a rule that all diagrams with five points contain eight triangles.
9. Triangular fans turn into pair counting
Place five distinct points B0 through B4 along one straight base, including its endpoints. Place apex A away from the base. Draw the entire base and every segment from A to each base point, with no additional lines.
Each triangle must use A as its apex and two different base points as its other vertices. Any two rays from A supply its sloping sides, while the continuous base supplies the third side. The number of triangles is therefore the number of unordered pairs of the five rays: 4 + 3 + 2 + 1 = 10.
The fan has only four smallest triangular regions, but ten triangles altogether. Larger triangles span several small regions. Counting only the subdivisions misses those combinations.
Grow the fan by one ray
A fan with six base points has fifteen triangles. Add one new base point and its ray. Every new triangle pairs the new ray with one of the six old rays. Exactly six new triangles appear, bringing the total to twenty-one.
This gives both a recursive description and a direct pair-count rule. With m rays, the count is m(m − 1) ÷ 2. The formula is justified because a triangle has one unique pair of rays, not because a few early totals happen to look familiar.
10. A complete list needs labels, not memory
For an irregular drawing, label vertices and organise candidates by a feature such as highest vertex, leftmost vertex or size. Write a triangle as ABC with its labels in a fixed order. BCA and CAB name the same triangle and should not be counted again.
Then check three separate conditions: the vertices are distinct, they are not collinear, and all three straight connecting sides are drawn. A clean-looking list can still contain invalid candidates. A correct list of small triangles can still omit large ones.
Choose the method that makes completeness easiest to explain. Full grids favour boundary pairs; squares favour side-length classes; fans favour ray pairs; irregular diagrams may require labelled enumeration. Forcing every picture into one memorised formula usually hides the very condition that needs checking.
11. Practice: 24 original questions
All grids below contain unit square cells with complete horizontal and vertical lines unless a missing segment is specified. Count different positions separately. Rectangles include squares. Do not add unshown diagonal sides.
Questions 1–8: Complete grids
- How many unit cells are in a two-row, three-column grid?
- How many rectangles of all sizes are in that grid?
- How many of those rectangles are squares?
- How many are not squares?
- Count all rectangles in a three-row, four-column grid.
- Count all squares in that grid.
- Count its non-square rectangles.
- In a four-row, five-column grid, count rectangles exactly two cells high and three cells wide.
Questions 9–16: Restricted sizes and positions
- In the same four-row, five-column grid, count rectangles three cells high and two cells wide.
- Count placements of a two-by-three rectangle in either orientation in that grid.
- How many rectangles in the four-row, five-column grid have area six square units?
- In a three-row, five-column grid, count rectangles exactly two cells wide and of any valid height.
- Count all rectangles in a five-by-five grid.
- Count all squares in that grid.
- In a three-row, four-column grid, count rectangles containing the entire top-left cell.
- In the same grid, count rectangles containing the entire cell in row two, column two.
Questions 17–24: Missing lines and triangles
- How many rectangles in Question 16 avoid the interior of that marked cell? Boundary contact is allowed.
- Use the labelled two-by-two grid in Section 7. Erase only segment EH. How many rectangles remain?
- How many of the surviving rectangles in Question 18 are squares?
- How many triangles follow only the horizontal and vertical lines of a complete three-row, four-column grid?
- A triangular fan has one apex, five distinct collinear base points, the complete base, and all five apex-to-base segments. Count all triangles.
- Repeat Question 21 with eight distinct base points and eight rays.
- A square has both diagonals drawn. Count all triangles formed by its sides and diagonals.
- A fan grows from six base points and rays to seven. How many new triangles are created, and why?
12. Worked solutions
Solutions 1–8
1. Six unit cells. Multiply two rows by three columns. This counts only the smallest cells, not the larger rectangles that combine several cells.
2. Eighteen rectangles. Three horizontal boundary lines give three pairs; four vertical lines give six pairs. Multiply 3 × 6 = 18. Alternatively sum twelve one-row-high and six two-row-high rectangles.
3. Eight squares. There are six unit squares and two two-by-two squares. No three-by-three square fits in only two rows. Total 6 + 2 = 8.
4. Ten. The eighteen rectangles already include the eight squares. Subtract: 18 − 8 = 10 non-square rectangles.
5. Sixty rectangles. Four horizontal boundaries give six pairs and five vertical boundaries give ten. Each pair selection produces one rectangle: 6 × 10 = 60.
6. Twenty squares. Count by side length: twelve unit squares, six two-by-two squares, and two three-by-three squares. Total 12 + 6 + 2 = 20.
7. Forty. Remove the twenty squares from the sixty inclusive rectangles. Do not subtract the unit cells alone, because larger squares also qualify.
8. Nine placements. The top of a two-row-high rectangle can occupy three positions within four rows. Its left side has three positions for a three-column width within five columns. Multiply 3 × 3.
Solutions 9–16
9. Eight placements. A three-row-high shape has two vertical positions, while a two-column-wide shape has four horizontal positions. Multiply 2 × 4 = 8.
10. Seventeen. Add the nine two-high, three-wide placements and eight three-high, two-wide placements. These are disjoint orientation categories because two and three differ.
11. Seventeen. Area six permits dimensions 1 × 6, 2 × 3, 3 × 2 or 6 × 1. Only the middle two fit a four-row, five-column grid, so the answer is the seventeen placements already counted.
12. Twenty-four. There are four possible left positions for a width of two. The four horizontal boundary lines provide six height spans. Thus 4 × 6 = 24.
13. 225 rectangles. Six horizontal boundaries give fifteen unordered pairs, as do the six vertical boundaries. Multiply 15 × 15 = 225.
14. Fifty-five squares. Sum placements by side length: 25 + 16 + 9 + 4 + 1 = 55. Including the final outer square completes the size list.
15. Twelve rectangles. The top and left boundaries are fixed at the grid’s top and left edges. Choose one of three bottom boundaries and one of four right boundaries: 3 × 4 = 12.
16. Twenty-four rectangles. Top and bottom each have two possible boundaries around row two. Left has two around column two; right has three. Multiply 2 × 2 × 2 × 3 = 24.
Solutions 17–24
17. Thirty-six. Of sixty rectangles, twenty-four contain the marked cell. The remaining 60 − 24 = 36 avoid its interior. The specified permission for boundary contact is important.
18. Five rectangles. The complete grid has nine. Removing EH destroys the two bottom unit rectangles and the two full-height, one-column rectangles. Four distinct invalid cases leave five.
19. Three squares. The two top unit squares and the outer two-by-two square remain. The missing internal segment destroys neither the outer boundary nor the top squares.
20. Zero. Horizontal and vertical lines alone cannot provide the three non-collinear sides of a triangle. A diagonal imagined by the viewer is not a drawn side.
21. Ten triangles. Every triangle uses the apex and one unordered pair of base points. Five points supply 4 + 3 + 2 + 1 = 10 pairs. Larger triangles spanning several small regions are included.
22. Twenty-eight triangles. Eight rays provide 8 × 7 ÷ 2 = 28 unordered pairs. Each pair encloses one valid triangle with the continuous base.
23. Eight triangles. Four small triangles meet the diagonal intersection and four larger triangles each occupy half the square. Equivalently, ten triples of the five intersection/corner points minus two collinear triples leave eight.
24. Six new triangles. Each new triangle must contain the new ray; pair it with any of the six existing rays. Existing triangles remain, so the increase is six and the new total is twenty-one.
13. Transfer: a larger grid without a longer search
A complete grid has four rows and six columns of unit squares. Find all rectangles, all squares and all non-square rectangles. Then consider a separate fan with seven base points and seven rays. Explain why its triangle count uses a different boundary choice.
Grid solution: five horizontal boundary lines provide ten pairs. Seven vertical lines provide twenty-one pairs. Therefore there are 10 × 21 = 210 rectangles. Squares contribute 24 + 15 + 8 + 3 = 50 placements, so non-square rectangles total 210 − 50 = 160.
Fan solution: choose two of seven rays, giving 7 × 6 ÷ 2 = 21 triangles. A fan triangle needs one pair of rays and the already drawn base. A grid rectangle needs both a horizontal pair and a vertical pair. The different multiplication structure comes from what uniquely specifies each shape.
14. Diagnose the first counting failure
If a learner reports only the unit-cell count, ask for one larger rectangle and then organise the shapes by height. If the learner counts the same triangle under several label orders, set a naming convention. If the learner invents a missing side, return to the requirement that every boundary be drawn.
If the learner knows the formula but uses row counts as line counts, draw one row between two boundaries. The difficulty is representational, not a need for more multiplication practice. The related Intervals, Fence Posts and Cuts guide develops exactly this difference between cells or gaps and their boundaries.
For a learner already counting accurately, ask for a completeness explanation. “I looked carefully” is not enough to establish that all cases were included. “Every possible height is one, two or three, and I counted each width within each height” gives an inspectable reason.
Choose a check that reorganises the same objects
Compare a size table with a line-pair total. Compare a triangle list with a classification by apex. Compare inclusive rectangles minus squares with a direct non-square size count. A check is more useful when it is unlikely to repeat the original omission.
Do not divide an irregular diagram’s count by a symmetry factor without explaining what is identified. If the problem treats different positions as different shapes, rotating the whole picture does not merge those positions. Symmetry may help organise equal counts, but it does not automatically change what counts as distinct.
A delayed return
After a gap, use a new grid size and a newly labelled fan. Ask the learner to predict which counts depend on rows, boundary lines, side lengths or ray pairs. Change only one condition at a time: remove a segment, forbid a cell, or exclude squares. This reveals whether the method follows the actual conditions.
The aim is not to accumulate ever larger totals. It is to make a finite search complete and auditable. When a learner can say what uniquely identifies one shape, a complicated-looking drawing becomes a collection of manageable choices.
Sources and scope
University of Cambridge NRICH — Hidden Rectangles is a related external exploration of different sizes and positions on a square grid. It includes boundary-selection and square-size approaches. This article develops its own examples, restrictions, triangle constructions and practice questions rather than reproducing that exercise set.
The MOE Primary curriculum and syllabus page is the official starting point for subject documents. Use school scope to decide which enrichment sections are appropriate. Neither completing this page nor using a counting formula certifies completion of a year-level programme.
Continue the worked-learning collection
Use Systematic Listing and Logical Counting for the broader no-omission, no-duplication method. Continue to Balance Scales and Weighing Puzzles for complete alternative-outcome reasoning, or Digit Sums and Arithmetic Error Checks to examine the limits of different verification methods.
Return to the BTT Primary Mathematics Learning Hub. A correct total should come with a reason: every valid shape has a place in the method, and no shape receives two places.
