Counting Figures: Triangles, Squares and Rectangles Formulas
Counting figures — how many triangles, squares or rectangles are in a diagram — is a regular non-verbal question in SSC CGL, CHSL and MTS. Diagrams get dense quickly, and the main risk is missing a shape or counting one twice. Two habits fix this: use a formula when the figure is a standard pattern (a grid, or a triangle with lines from one corner), and label every point and count systematically when it is not.
Squares in an n × n grid
Count squares of every size: n² of size 1, (n − 1)² of size 2, and so on down to 1 of size n.
Rectangles in an m × n grid
A rectangle is fixed by choosing two of the m + 1 vertical lines and two of the n + 1 horizontal lines. Note that squares are also rectangles and are included in this count.
Triangles with lines from a vertex
If a triangle has lines from the top vertex dividing the base into k parts, every pair of lines from the vertex (including the two sides) forms a triangle: k(k + 1)/2 triangles. If h horizontal lines cut across (including the base), multiply by h.
Label and count
For irregular figures, label every intersection with a letter. Count triangles by smallest first, then those made of two parts, three parts and so on, writing each as three letters (ABE, BCE). Writing the names prevents double counting.
Figures with overlapping shapes
Some figures are made of two overlapping squares or a star inside a pentagon. Count the regions in each shape separately, then count the shapes formed only by combining parts of both, and finally make sure you have not counted the shared region twice. Working shape by shape keeps the count manageable.
Shortcuts and tricks
- Squares in a 3 × 3 grid = 9 + 4 + 1 = 14; in a 4 × 4 grid = 30.
- Rectangles in a 3 × 2 grid = C(4,2) × C(3,2) = 6 × 3 = 18.
- A square with both diagonals has 8 triangles: 4 small and 4 made of two small ones.
- Triangle with 3 lines from the apex to the base (4 base parts): 4 × 5 / 2 = 10 triangles.
- When a figure is symmetric, count one half carefully, double it, then add the shapes crossing the centre.
Worked examples
How many squares are there in a 4 × 4 grid of unit squares?
Solution
16 (1 × 1) + 9 (2 × 2) + 4 (3 × 3) + 1 (4 × 4) = 30 squares.
How many rectangles (including squares) are there in a grid 3 units wide and 2 units tall?
Solution
Vertical lines: 4, choose 2 = 6. Horizontal lines: 3, choose 2 = 3. Rectangles = 6 × 3 = 18.
A triangle has three lines drawn from its apex to the base, dividing the base into four parts. How many triangles are there?
Solution
There are 5 lines from the apex in total (two sides plus three inner lines). Any two of them with the base form a triangle: C(5, 2) = 10. Using the formula, 4 × 5 / 2 = 10.
In the same triangle, one horizontal line is drawn across, parallel to the base. How many triangles are there now?
Solution
The horizontal line acts as a second base. Each base level gives 10 triangles, so 10 × 2 = 20 triangles.
How many squares are there in a 5 × 5 grid?
Solution
Using the sum of squares: 25 + 16 + 9 + 4 + 1 = 55, or n(n + 1)(2n + 1)/6 = 5 × 6 × 11 / 6 = 55.
Practice questions
How many squares are there in a 3 × 3 grid of unit squares?
- 9
- 14
- 13
- 10
Show answer & explanation
Answer: B. 14
There are 9 unit squares, 4 squares of size 2 × 2 and 1 square of size 3 × 3, which adds up to 14.
How many rectangles, including squares, are there in a 3 × 3 grid?
- 14
- 24
- 36
- 30
Show answer & explanation
Answer: C. 36
There are 4 vertical and 4 horizontal lines. Choosing two of each gives C(4,2) × C(4,2) = 6 × 6 = 36.
A triangle has two lines drawn from the apex to the base, dividing the base into three parts. How many triangles are there?
- 3
- 5
- 4
- 6
Show answer & explanation
Answer: D. 6
With three base parts the formula k(k + 1)/2 gives 3 × 4 / 2 = 6. Equivalently, there are four apex lines and C(4,2) = 6 pairs.
How many triangles are formed in a square when both diagonals are drawn?
- 8
- 4
- 6
- 10
Show answer & explanation
Answer: A. 8
The diagonals create 4 small triangles. Each half of the square cut by one diagonal is also a triangle, adding 4 more, for 8 in total.
How many squares are there in a 2 × 2 grid of unit squares?
- 4
- 5
- 6
- 8
Show answer & explanation
Answer: B. 5
There are four 1 × 1 squares and one large 2 × 2 square, making five squares in all.
FAQs
Is it better to use formulas or count directly?
Use formulas when the figure matches a standard pattern exactly, because they are faster and error-free. For irregular figures, label points and count systematically by size. Many SSC figures combine a standard part with extra lines, so use the formula for the standard part and count the extra shapes separately.
How can I avoid double counting triangles?
Name every triangle by its three corner letters in alphabetical order (ABE rather than BEA). Write each name as you count. If a name repeats, you have counted it twice. This takes a little longer but is far more reliable on crowded figures.