Euler Hall — free maths guides

Count the diagonals of an n-gon and recover the side count from a stated number of diagonals

Count the diagonals of an n-gon with n(n-3)/2 and say why the halving is exact. The idea in plain words, a worked example, and a check with the answers shown — part of the free Geometry guides.

Count from one vertex, then notice you counted everything twice

A diagonal is a segment joining two vertices that are not next to each other.

Count them in two steps, and the second step is the whole trick.

Step 1, from one vertex. A vertex has two neighbours, and a segment to a neighbour is a side, not a diagonal. So from one vertex you can draw a diagonal to each of the othern−3n - 3 vertices.

Step 2, from every vertex. There arenn vertices, so naivelyn(n−3)n(n-3) diagonals. But each diagonal has two ends, so this count has counted every diagonal exactly twice — once from each endpoint. Divide by two:

D=n(n−3)2D = \frac{n(n-3)}{2}

|nn | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 12 | |---|---|---|---|---|---|---|---|---| | diagonals | 0 | 2 | 5 | 9 | 14 | 20 | 35 | 54 |

A triangle has none, because every pair of its vertices is already joined by a side. A quadrilateral has two, and they are the two you can see in a rectangle.

Reading the formula backwards is the other half of this skill: givenDD, findnn. That is a quadratic,n2−3n−2D=0n^2 - 3n - 2D = 0, so

n=3+9+8D2n = \frac{3 + \sqrt{9 + 8D}}{2}

and the answer only counts if it comes out a whole number of at least three sides.

Why the halving is not a fudge

The countn(n−3)n(n-3) is a count of ordered pairs: (this vertex, that vertex). A diagonal fromAA toDD and a diagonal fromDD toAA are the same segment written two ways, and they appear as two different ordered pairs. Dividing by two is not a correction for overcounting in the sloppy sense; it is the exact conversion from ordered pairs to segments.

The same shape of argument gives the handshake count in a room ofnn people,n(n−1)/2n(n-1)/2, and the count of edges in a complete graph. It is worth recognising because it recurs constantly: whenever the objects you are counting come in unordered pairs, count the ordered version and halve it.

Two checks on the formula, both worth doing before trusting it. Atn=3n = 3 it gives00, which is right: a triangle has no diagonal. Atn=4n = 4 it gives22, which is right: the two diagonals of a quadrilateral. A formula that fails one of those is wrong, and both are one line to check.

A worked example: a decagon, both ways

A regular decagon has1010 sides.

(a) How many diagonals can be drawn from one vertex? (b) How many diagonals does it have in total? (c) A different polygon has3535 diagonals. How many sides does it have?

(a)10−3=710 - 3 = 7. The two neighbours are joined by sides, so seven vertices remain.

(b)10×72=35\dfrac{10 \times 7}{2} = 35.

(c) Solven(n−3)2=35\dfrac{n(n-3)}{2} = 35, son2−3n−70=0n^2 - 3n - 70 = 0, so(n−10)(n+7)=0(n-10)(n+7) = 0, son=10n = 10. The rootn=−7n = -7 is discarded because a polygon cannot have a negative number of sides.

The check. Multiply back:10×7/2=3510 \times 7 / 2 = 35. Always substitute thenn you found into the original formula rather than trusting the quadratic alone.

By the end you can
  • Count the diagonals of an n-gon with n(n-3)/2 and say why the halving is exact
  • Count the diagonals from a single vertex
  • Recover the number of sides from a stated number of diagonals
  • Reject a non-integer or too-small root when solving backwards
Check yourself
  1. 1. How many diagonals does a pentagon have?
  2. 2. How many diagonals can be drawn from one vertex of annn-gon?
  3. 3. Why is the total divided by two?
  4. 4. A polygon has 14 diagonals. How many sides?
Answers
  1. 1.5×2/2=55 \times 2/2 = 5.
  2. 2.n−3n - 3: all the other vertices except the two neighbours.
  3. 3. Because each diagonal is counted once from each of its two endpoints.
  4. 4.n(n−3)/2=14n(n-3)/2 = 14 givesn2−3n−28=0n^2 - 3n - 28 = 0, son=7n = 7.
Work out where to start — free, no accountAnswer six real questions — free, no account