← Kavach कवचCounting of Figures

Chapter 26

Counting of Figures

Count by size, tick as you go, and every figure gives up its total.

Counting questions look like a test of eyesight, but they are a test of method. A student who counts by eye in one sweep loses a figure or two every time. A student who counts by size, with a tick for every figure, gets the full count almost every time.

In this chapter we first fix what counts as a triangle, a square or a rectangle, and learn the master test of three lines and three corners. The types then follow in the order in which the exam asks them. Type 1 is the big one: composite and irregular figures, including figures that the paper only describes in words. Types 2 and 3 are squares and rectangles in a grid, Type 4 the box with diagonals, Type 5 circles. Types 6 to 8 are the triangle families: the fan from one corner with cross lines, the triangle grid, and lines from two or three corners. Type 9 holds stars, overlapping blocks and nested shapes. Type 10 counts cubes in a solid block, and Type 11 counts by choosing: points, lines and the diagonals of a polygon.

Such questions are regularly asked in SSC and Railway exams, and triangles are asked the most. Many pictures follow a fixed pattern, so a formula gives the answer in seconds. For the irregular pictures that no formula covers, you will learn to build a small size table and add it up. Finding a given small shape hidden inside a bigger one is a different skill, taught in the chapter on Embedded Figures. Here we only count. Understand the picture first, and the count follows.

What counts as a figure

Counting questions look like a game of eyes, but they follow strict logic. A triangle needs three straight sides, and each side must lie on a line that is really drawn. The three corners must be points where those lines actually meet. A bent line, made of two pieces at an angle, is not one side. A gap between two lines means there is no corner there.

[[fig:0]]

In the left picture all three sides are drawn and meet at the corners, so it is a triangle. On the right the bottom line stops short of both corners, so those three lines do not close up: no triangle. Curved outlines never form triangles or rectangles.

Two more points. First, a square is also a rectangle, so "rectangles" normally includes squares; "rectangles that are not squares" removes them. Read the stem every time. Second, a figure can be big: its sides can be made of several small pieces placed end to end, as long as they lie on one straight line. A side is a straight line, not a single drawn piece.

Lines, segments and the two-stage method

Two different questions are asked. "How many straight lines" means each full straight line counts once, even if other lines cross it. "How many line segments" means every piece between two points counts. In the picture the long line PS is crossed by two lines at Q and R. It is one line, but it holds the 6 segments PQ, PR, PS, QR, QS and RS (4 points give 4 × 3 ÷ 2 = 6). Unless the stem says "segments", count whole lines.

[[fig:0]]

Now the method that works for every figure. Stage 1: basic figures. Count the smallest figures you can see. Stage 2: extra figures. Count the ones made by joining two, three or more neighbouring cells, by size: first all two-cell figures, then three-cell, and so on, until nothing bigger forms. Never count by eye in one sweep; always by size class, and tick as you go.

Keep these two number tables in your head. They appear again and again in this chapter.

k12345678910
1 + 2 + … + k13610152128364555
1² + 2² + … + k²1514305591140204285385

Count basic first, then extra, by size class. Choosing 2 things from n is written C(n, 2) = n(n − 1)/2, and choosing 3 is C(n, 3).

Using the options wisely

Options are only a check, never the method. Count first. While counting, remember that totals only go up as you add bigger figures. If your running total has already passed every option except the largest one, the largest option is the answer, and you can stop.

Symmetry helps only when the figure is exactly symmetric, and even then a triangle sitting on the axis can break the "double it" idea. Do not assume. Use symmetry to check an answer, never to produce it.

Finally, never add or subtract a constant from a count that you remember from another question. Two figures can look alike and differ by one line. Each figure gets its own table of sizes.

Three lines, three corners: the master test

Every counting question, however strange the picture, can be turned into a question about lines. A triangle is made by three lines that are pairwise not parallel, that do not all pass through one point, and whose three meeting points all lie on the drawn parts of the lines. A rectangle is made by two pairs of parallel lines at right angles to each other, and a square is a rectangle whose two gaps are equal.

So the question to ask of any picture is: which lines are drawn, and in how many directions? If there are only two directions, horizontal and vertical, the picture holds no triangle at all. If there are three or four directions, choose one line from each of three different directions and check the three meeting points. This is the idea behind most of the tricks in this chapter.

Count lines, not shapes: a figure is only the meeting of the lines you can see.

Type 1

Composite Figures: Basic + Extra [New Pattern: figure described in words]

What the exam asks. A figure and one question: "how many triangles are there?" It may be a picture of boxes, grids and diagonals, or, in the latest Steno papers, only a sentence: "a square divided into 9 equal smaller squares (3 × 3), and 2 diagonals are drawn in the outer square." When there is no picture, draw the figure yourself on rough paper first. This is the biggest type of the chapter. No single formula fits every picture, but one method never fails.

The logic. A triangle is just three drawn lines meeting in three different corners. So do not hunt for shapes with your eyes. Count in two stages, by size. Basic: the smallest triangles inside each cell. Extra: the bigger triangles that appear when neighbouring cells join. Tick each one as you count it.

[[fig:0]]

Take a strip of 3 boxes, each with both diagonals. Basic: every box gives 8 (4 small and 4 half-boxes, like the blue one), so 3 × 8 = 24. Extra: at each join the diagonals of the two boxes meet at the top of the join and make one big triangle above and one below, each two boxes wide (the orange one). Two joins give 4 more. Total 24 + 4 = 28.

Now the commonest picture of all: a square grid with the two long diagonals of the big square.

[[fig:1]]

Every triangle needs three lines, and here the lines run in only four directions: horizontal (H), vertical (V) and the two diagonals (D₁, D₂). Pick three lines from three different directions; they make a triangle unless all three pass through one point.

  • H + V + one diagonal gives a right-angled triangle (red).
  • H or V + both diagonals gives a triangle with its top at the centre (blue).

In an n × n grid there are n + 1 lines of each of H and V. For H + V + D₁ there are (n + 1)² choices, but n + 1 of them meet on the diagonal itself and are no triangle, which leaves n(n + 1); D₂ gives the same. For the centre-top type there are 2(n + 1) choices. For odd n the total is 2(n + 1)²; for even n, two lines pass through the centre and give nothing, so it is 2(n + 1)² − 2. For the 3 × 3 grid: 2 × 16 = 32.

Type 2

Squares in a Grid

What the exam asks. "How many squares are there in the figure?" The figure is a full grid, a chessboard, a grid with a few squares cut away or, in the latest papers, only a sentence: "a square with 4 equal horizontal and 4 equal vertical lines dividing it into a 5 × 5 grid." Many students count the small squares and stop. The question wants squares of every size.

The logic. A square is fixed by its side and by where its top-left corner sits. In a grid of m columns and n rows, a square of side k can be placed in (m − k + 1) positions across and (n − k + 1) positions down. So there are (m − k + 1)(n − k + 1) squares of side k. Add for k = 1, 2, 3, … until a factor becomes 0.

[[fig:0]]

In the 4 × 4 grid of the figure (blue: side 2, red: side 1) count by side:

side1234
number4 × 4 = 163 × 3 = 92 × 2 = 41 × 1 = 1

Total = 16 + 9 + 4 + 1 = 30. For an n × n grid this is 1² + 2² + … + n², and the table of this chapter gives 1, 5, 14, 30, 55, 91, 140, 204. A chessboard has 64 cells but 204 squares.

Squares = mn + (m − 1)(n − 1) + (m − 2)(n − 2) + … (stop when a factor becomes 0). A 6 × 4 grid gives 24 + 15 + 8 + 3 = 50.

Read the words carefully. "4 equal horizontal and 4 equal vertical lines" means 4 lines inside, so there are 5 columns and 5 rows: a 5 × 5 grid. The number of cells is always lines + 1.

Grid with a part missing. For each side k, count the positions in the full grid, then take away the positions that cover a missing cell. Never use the full-grid sum for a figure that has been cut.

Tilted squares. If the points are dots (not lines) and tilted squares are allowed, a square whose corners are on dots can be tilted too. For n dots on each side the total is the sum of d × (n − d)² for d = 1 to n − 1. So 3 × 3 dots give 6 squares and 4 × 4 dots give 20.

Type 3

Rectangles in a Grid

What the exam asks. "How many rectangles are there in the figure?" The figure is a grid, a set of crossing lines or a block of boxes. Sometimes the stem says "rectangles that are not squares". Read this first, because a square is also a rectangle.

The logic. A rectangle is fixed by its four sides: two vertical lines and two horizontal lines. In a grid every vertical line and every horizontal line is available. So choose 2 of the vertical lines and 2 of the horizontal lines, and you get exactly one rectangle. Every choice gives a different rectangle, and none is missed.

[[fig:0]]

In the figure there are 4 columns and 3 rows, so 5 vertical and 4 horizontal lines. The two red lines and the two green lines make the blue rectangle.

  • Ways to choose 2 vertical lines out of 5: C(5, 2) = 10 = 1 + 2 + 3 + 4.
  • Ways to choose 2 horizontal lines out of 4: C(4, 2) = 6 = 1 + 2 + 3.
  • Rectangles = 10 × 6 = 60.

Rectangles (squares included) = [m(m + 1)/2] × [n(n + 1)/2] = T(m) × T(n), for m columns and n rows. Write 1 + 2 + … + m and 1 + 2 + … + n, then multiply. A single row of n cells gives T(n).

Squares or not. The 60 include the squares. The 4 × 3 grid has 12 + 6 + 2 = 20 squares (Type 2), so rectangles that are not squares number 60 − 20 = 40.

Lines with unequal gaps. Only the lines matter, not the gaps. With p vertical and q horizontal lines, all crossing, the answer is C(p, 2) × C(q, 2).

Lines missing. If some lines do not run across, the formula is not safe. Complete the grid in your mind and subtract, or count region by region, always asking: do all four sides of this rectangle really exist?

Type 4

Box with Diagonals and Mid-lines

What the exam asks. A square or a rectangle with its diagonals, sometimes with the lines joining the midpoints of opposite sides (the mid-lines), sometimes with a small square drawn inside. The question: how many triangles? This is the smallest member of the composite family, so the same ideas work, but the numbers are worth remembering.

The logic. The two diagonals meet at the centre O and cut the box into 4 small triangles. Each diagonal also cuts the box into two halves, and a half-box is a triangle too: 4 half-boxes. So 4 + 4 = 8 triangles, for a square and for any rectangle.

Now add the mid-lines. They also pass through O.

[[fig:0]]

In the figure the red triangle AOM is one of the small ones: the mid-lines cut each quarter triangle (such as AOB) into two. The quarters themselves are still triangles, and the blue triangle ABC is one of the 4 half-boxes cut by a diagonal. With both mid-lines the count becomes 16.

Here is the quick idea. Every line passes through the centre, so count the half-lines that start at O and run to the edge. Two diagonals give 4 half-lines. One mid-line adds 2 more, both mid-lines add 4 more.

Triangles = 2 × (number of half-lines from the centre). So 4, 6 and 8 half-lines give 8, 12 and 16 triangles.

The same answers come from the grid idea of Type 1: a box is a 1 × 1 grid with both diagonals (8), and a box with both mid-lines is a 2 × 2 grid with both diagonals (2 × 3² − 2 = 16).

Two warnings. The mid-lines alone make no triangle, because the sides and mid-lines run in only two directions, and a triangle needs three. And the doubling idea needs every line to pass through O. If the midpoints of the four sides are joined to make an inner square, those lines miss the centre, so count by size: that figure has 8 + 4 + 4 + 4 = 20 triangles.

Type 5

Circles

What the exam asks. "How many circles are there in the figure?" The picture shows circles in rows, in rings, inside one another, or overlapping. It is the easiest counting question, and the only way to lose it is to count carelessly.

The logic. Circles that touch or overlap never join to form a new circle. The gap between three touching circles is not a circle, because its sides are curved. A lens-shaped overlap is a region, not a circle. And a big circle that exists only in your imagination is not in the figure. So the answer is simply the number of drawn circles, each counted once.

[[fig:0]]

Method. Number every circle as you meet it, row by row. In the figure the circles are numbered 1 to 6, and the last number is the answer: 6. Numbering stops you from counting the same circle twice or skipping one.

Number the circles 1, 2, 3, … on the figure; the last number is the answer.

When the circles are in rows, add the rows. A pyramid with 5, 4, 3, 2 and 1 circles in its rows has 5 + 4 + 3 + 2 + 1 = 15 circles. When a circle is drawn inside another, both are counted: a big circle holding a centre circle and 6 small circles around it has 1 + 1 + 6 = 8 circles. When the circles have different sizes, count each size group separately and add.

A circle is a flat figure and a sphere is a solid. A question about balls stacked in layers is a 3D counting question, not this type.

Type 6

Fan from One Corner, with Cross Lines

What the exam asks. A triangle ABC with several lines drawn from the top corner A down to the base BC, and sometimes one or two lines running across the fan, parallel to the base. The question: how many triangles are there, and sometimes how many four-sided figures (quadrilaterals)? It looks like a pyramid built in layers.

The logic. Every triangle in the fan has A as its top corner and its base on BC. So a triangle is fixed by choosing two of the lines that meet at A; the base between them follows automatically. If the base BC is cut into n parts, then n + 1 lines meet at A (the two sides and the lines between), and the number of ways of choosing two is C(n + 1, 2) = n(n + 1)/2.

[[fig:0]]

In the figure the base has 4 parts, so 5 lines meet at A. Choose any two, say AD₁ and AD₃ (shaded), and one triangle is formed: 4 × 5 ÷ 2 = 10. By size it is 4 + 3 + 2 + 1, the triangles standing on one, two, three and four parts.

Now add cross lines. The base BC is itself a cross line, because it cuts every fan line.

[[fig:1]]

Choose any two fan lines and one cross line: together they bound exactly one triangle with its corner at A (red in the figure). Choose two fan lines and two cross lines and you get a four-sided figure between the two cross lines (blue). So every pair of fan lines can be used with every cross line.

Triangles = n(n + 1)/2 × h. Quadrilaterals = n(n + 1)/2 × h(h − 1)/2. Here n is the number of parts on the base and h is the number of cross lines with the base included. A fan with no cross line has h = 1. In the figure n = 3 and h = 2, so 6 × 2 = 12 triangles and 6 × 1 = 6 quadrilaterals.

Take care with n. It is one more than the number of points marked inside BC: three points make 4 parts. If the question gives the total number of lines at A (the sides included), then n = lines − 1.

Type 7

Triangle Grid (Equal Divisions)

What the exam asks. A big triangle whose sides are cut into n equal parts, with lines drawn parallel to all three sides, so it breaks into n² small triangles. The question: how many triangles in all? Sometimes only the triangles that point up, or only those that point down.

The logic. Besides the triangles that point the same way as the big one, there are triangles that point the opposite way. Most mistakes come from forgetting the second family. So count in two families, by size.

[[fig:0]]

In the figure n = 3. The blue triangle (size 2) points the same way as the big one. The red one points the opposite way.

  • Same direction, size k: (n − k + 1)(n − k + 2)/2 triangles.
  • Opposite direction, size k: (n − 2k + 1)(n − 2k + 2)/2 triangles, but only while 2k ≤ n.

For n = 4:

size1234total
same way1063120
opposite way61––7

Total = 20 + 7 = 27. Doing this for n = 1 to 8 gives the sequence 1, 5, 13, 27, 48, 78, 118, 170, and it fits one formula:

Triangles = n(n + 2)(2n + 1) ÷ 8, and drop the fraction part when n is odd.

The same-direction family has its own short formula, n(n + 1)(n + 2)/6, which gives 1, 4, 10, 20, 35, 56. The opposite family is then the total minus this. For n = 6: 78 − 56 = 22.

Be careful with a popular shortcut, "2 × small triangles − 5". It happens to work for n = 3 and 4 only. For n = 5 it gives 45, but the true answer is 48.

Type 8

Lines from Two or Three Corners

What the exam asks. A triangle ABC in which lines are drawn from two corners (say B and C) to the opposite sides, or one line from each of the three corners (medians, for example). The lines cross inside the triangle and make a net. The question: how many triangles?

The logic. In the one-corner fan of Type 6 the lines never cross. Once a second corner sends lines, the lines from B cross the lines from C, and new triangles appear whose corners are the crossing points. So the "choose two lines at A" idea no longer covers everything.

Two corners. Start with the simplest case: one line BE from B, one line CF from C, crossing at X.

[[fig:0]]

List the triangles. The whole triangle ABC: 1. Triangles with a corner of ABC and a drawn line: ABE, CBE, ACF, BCF: 4. Triangles that use the crossing point X: BXC, BXF, CXE: 3. Total = 1 + 4 + 3 = 8.

For bigger figures let p = (lines drawn from B) + 1 and q = (lines drawn from C) + 1. This has been checked by counting for every case up to 5 lines from each corner.

Triangles = p × q × (p + q) ÷ 2. With p = q = n it becomes n³ (8, 27, 64). The condition: no line may be drawn from the third corner A.

Three corners. Now one line from each corner, AD, BE and CF. Count in bundles.

  • The whole triangle: 1.
  • Each of the three lines splits the triangle in two (such as ABD and ACD): 3 × 2 = 6.
  • Take any two of the three lines (3 pairs). Each pair, with the sides, makes 3 triangles (for AD and BE: ABX, BDX and AEX): 3 × 3 = 9.

That is 1 + 6 + 9 = 16, when the three lines meet at one point.

[[fig:1]]

If the three lines do not meet at one point, their crossings make a small central triangle, and the total becomes 17.

[[fig:2]]

Look at the centre before you write the answer: one meeting point is 16, a tiny triangle in the middle is 17. For any other number of lines from three corners, do not guess a formula; build a size table.

Type 9

Stars, Overlaps and Nested Shapes

What the exam asks. Three kinds of pictures that do not fit a grid: a star drawn with straight lines, two grids or blocks laid over each other so that they overlap, and shapes drawn one inside another. The question is "how many triangles" (stars, nested triangles) or "how many small squares" (overlapping blocks).

Stars. The triangles of a star come in two families: the point triangles at the tips, and the large triangles made when a tip triangle joins the inner part of the star.

[[fig:0]]

The five-pointed star made from five long lines (no outline) has 5 narrow triangles, one at each point. It also has 5 wide triangles: each long line joins two tips, and with a corner of the small inner pentagon it forms one wide triangle. Total 5 + 5 = 10. The six-pointed star (two big triangles laid over each other) has 6 point triangles and the 2 big triangles: 6 + 2 = 8. The eight-pointed star made by two squares has only its 8 point triangles; the two squares are not triangles. Triangles = point triangles + large triangles.

These counts are for the pure star. If the outline joining the tips is also drawn, many more triangles appear: the five-pointed star with its outer pentagon has 35, and the six-pointed star with its hexagon has 32. Do not carry one number to the other picture.

Overlapping blocks. If you count each block separately and add, the shared cells are counted twice. So add the blocks and subtract the shared cells once each.

[[fig:1]]

In the figure two 3 × 3 blocks overlap in a 2 × 2 block: 9 + 9 − 4 = 14. Total cells = (sum of the blocks) − (cells counted twice). Always count the shared cells from the picture.

Nested shapes. A triangle whose midpoints are joined to make a second triangle gives 4 + 1 = 5 triangles. Joining the midpoints of the middle triangle again splits it into 4 and adds 4 more: 9, then 13. Each new inner triangle adds 4. Check that the picture really shows midpoints joined, and never carry this pattern to a nested square.

Type 10

Cubes and Cuboids in a Block [3D]

What the exam asks. A solid block made of small cubes (for example 27 or 64 of them) and the question "how many cubes of all sizes can be counted in it?" Sometimes the question is about cuboids of every shape. You can recognise it from the words "made of small cubes" and "of all sizes".

The logic. A solid block made of unit cubes hides cubes of many sizes, exactly as a grid hides squares of many sizes. The idea is the same as Type 2, now in three directions.

Take a block of a × b × c unit cubes. A cube of side k can be placed in (a − k + 1) positions along the length, (b − k + 1) along the breadth and (c − k + 1) along the height. So there are (a − k + 1)(b − k + 1)(c − k + 1) cubes of side k. Add for k = 1, 2, … up to the smallest of a, b, c.

[[fig:0]]

In the figure there is a 3 × 3 × 3 block. The blue face shows the base of one 2 × 2 × 2 cube. Count by side:

side123
number3 × 3 × 3 = 272 × 2 × 2 = 81 × 1 × 1 = 1

Total = 27 + 8 + 1 = 36. For an n × n × n block the answer is (1 + 2 + … + n)². So 3 × 3 × 3 gives 6² = 36, and 4 × 4 × 4 gives 10² = 100.

Cubes of all sizes in an a × b × c block = Σ (a − k + 1)(b − k + 1)(c − k + 1).

If the question asks for cuboids of every shape (cubes included), choose 2 planes in each of the three directions: T(a) × T(b) × T(c), where T(k) = k(k + 1)/2. For a 3 × 3 × 3 block this is 6 × 6 × 6 = 216.

Do not mix "total cubes" with "visible cubes". How many cubes you can see from outside is a different question, and stack counting by column heights is done in the Dice and Cube chapter.

Type 11

Choosing: Points, Lines and Polygon Diagonals

What the exam asks. Little or no drawing. There are three kinds of questions. (1) "n points are marked, some of them on one straight line; how many triangles can be formed by joining them?" (2) "How many straight lines are there in the figure?", or "every pair of points is joined; how many lines?" (3) "How many diagonals does a polygon with n sides have?", or the reverse: "a polygon has 54 diagonals; how many sides?"

The logic. All three are one idea: choose points. Two points fix a line. Three points fix a triangle, unless they lie on one line. A diagonal joins two corners that are not neighbours. So count the ways of choosing, and then throw away the choices that do not work.

Triangles from marked points. Any three points that are not on one line make a triangle. With n points there are C(n, 3) triples. A group of k points on one line gives C(k, 3) triples that are not triangles.

[[fig:0]]

Triangles = C(n, 3) − C(k, 3) for every group of k points in a line. In the figure there are 5 points and A, B, C are in a line: 10 − 1 = 9. Useful values: C(5, 3) = 10, C(6, 3) = 20, C(7, 3) = 35, C(8, 3) = 56, C(9, 3) = 84, C(10, 3) = 120.

Straight lines. In a drawn figure, count by families: horizontal, vertical, slanting. A long line crossed by other lines is still one line; cutting it into pieces gives "line segments", which is a different question.

[[fig:1]]

In the figure: 3 horizontal + 4 vertical + 1 slanting = 8. A grid of m columns and n rows has (m + 1) + (n + 1) horizontal and vertical lines. When points are given, any two points fix a line: with n points and no three in a line, C(n, 2) lines. If k of the points are in one line, they would have given C(k, 2) lines but really give only 1, so Lines = C(n, 2) − C(k, 2) + 1.

Diagonals of a polygon. From each corner there are n − 3 diagonals (the two neighbours are sides). Every diagonal has two ends, so divide by 2.

[[fig:2]]

In the hexagon the three red lines are all the diagonals from A: 6 × 3 ÷ 2 = 9. Diagonals = n(n − 3) ÷ 2.

sides45678910
diagonals25914202735

For the reverse question, double the diagonals and find two numbers that differ by 3 and multiply to that product: 27 diagonals give 54 = 9 × 6, so n = 9.