When each of n people shakes hands exactly once with every other person, every handshake is just a pair of people. So the number of handshakes is the number of ways to choose 2 people from n:

Handshakes = nC2 = n(n − 1)/2

The reasoning behind it: each person shakes n − 1 hands, giving n(n − 1), but that counts every handshake twice, once from each side. For more on choosing, see permutations and combinations.

Worked example 1: ten people

10 people, all shaking hands once: 10 × 9 ÷ 2 = 45 handshakes.

Questions often give the total and ask for n. Double the total and look for two consecutive numbers with that product.

Worked example 2: working back from 66

66 handshakes means n(n − 1) = 132 = 12 × 11, so there were 12 people.

If handshakes happen only between two groups, such as 5 men each shaking hands with 4 women but not with each other, the count is simply 5 × 4.

Worked example 3: two groups

5 men each shake hands with each of 4 women, and nobody else: 20 handshakes.

Joining any two vertices of an n-sided polygon gives nC2 lines. n of those are the sides; the rest are diagonals:

Diagonals = nC2 − n = n(n − 3)/2

The n − 3 comes from each vertex: it cannot join itself or its two neighbours by a diagonal.

Worked example 4: an octagon

8C2 − 8 = 28 − 8 = 20 diagonals.

Worked example 5: which polygon has 35 diagonals?

n(n − 3)/2 = 35 gives n(n − 3) = 70 = 10 × 7, so the polygon has 10 sides.

For interior and exterior angles of polygons, see polygon angles.

  • Single league (round robin): every team plays every other once, so matches = nC2.
  • Double league (home and away): twice that, n(n − 1).
  • Knockout: each match eliminates one team, and all but the winner must be eliminated, so matches = n − 1.

Worked example 6: eight teams in a league

8C2 = 28 matches in a single round robin.

Worked example 7: home and away

The same 8 teams playing home and away: 2 × 28 = 56 matches.

Worked example 8: a knockout

16 teams in a knockout: 15 matches (8 + 4 + 2 + 1).

Handshakes are unordered: A shaking hands with B is the same event as B shaking hands with A. Some questions describe ordered pairs instead, and then you must not halve the count.

Worked example 9: exchanging gifts

Each of 10 friends gives a gift to every other friend. A gift from A to B is different from one from B to A, so the count is 10 × 9 = 90 gifts, twice the 45 handshakes. Greeting cards, letters and phone calls "to each other" usually follow the same rule; read whether each pair acts once or each person acts separately.

Choosing three vertices of a polygon gives a triangle, so an n-sided polygon has nC3 triangles with its vertices as corners.

Worked example 10: triangles in an octagon

8C3 = 56 triangles can be drawn using the vertices of an octagon.

Worked example 11: triangles sharing no side with the octagon

A harder variant asks for triangles none of whose sides is a side of the polygon. The count is n(n − 4)(n − 5)/6, which for n = 8 gives 8 × 4 × 3 ÷ 6 = 16.

With n points and no three on a line, there are nC2 straight lines and nC3 triangles. If m of the points lie on one line, adjust:

  • Lines: nC2 − mC2 + 1. The mC2 lines joining collinear points are really just one line.
  • Triangles: nC3 − mC3. Three collinear points do not make a triangle.

Worked example 12: lines

10 points, 4 of them collinear: 45 − 6 + 1 = 40 lines.

Worked example 13: triangles

The same points: 120 − 4 = 116 triangles.

Common traps: forgetting to halve the handshake count, counting sides as diagonals, using nC2 for a knockout, and forgetting the "+ 1" when collinear points share a line.

Q1. At a meeting, each of 15 people shakes hands once with every other person. How many handshakes are there? easy

✅ Answer: (a) 105

💡 Explanation: Handshakes = 15C2 = 15 × 14 ÷ 2 = 105. 210 counts each handshake twice.

Q2. How many diagonals does a 12-sided polygon have? easy

✅ Answer: (b) 54

💡 Explanation: n(n − 3)/2 = 12 × 9 ÷ 2 = 54. 66 is 12C2, which wrongly includes the 12 sides.

Q3. There were 28 handshakes at a party, everyone shaking hands with everyone else once. How many people were there? medium

✅ Answer: (d) 8

💡 Explanation: n(n − 1)/2 = 28 gives n(n − 1) = 56 = 8 × 7, so n = 8.

Q4. In a league of 10 teams, each team plays every other team twice (home and away). How many matches are played? easy

✅ Answer: (c) 90

💡 Explanation: Single round = 10C2 = 45 matches; playing twice doubles it to 90.

Q5. 12 points lie in a plane, and exactly 5 of them are on one straight line. How many triangles can be formed using these points as vertices? hard

✅ Answer: (b) 210

💡 Explanation: 12C3 = 220, but any 3 of the 5 collinear points form no triangle: 5C3 = 10. So 220 − 10 = 210.

Why divide by 2 in the handshake formula?

Each person shakes n − 1 hands, so n(n − 1) counts every handshake twice: once from each person's side. Dividing by 2 gives each handshake once.

How many matches does a knockout tournament need?

One fewer than the number of teams. Every match knocks out exactly one team, and all but the champion must be knocked out, so n teams need n − 1 matches.

What if people shake hands only with the other group?

Then it is not nC2. With m people in one group and k in the other, each of the m shakes k hands, giving m × k handshakes in all.

All problems and solutions on this page are original. No outside facts are relied on; every numeric answer is recomputed by software before publishing.

How this page was prepared. Drafted with AI assistance (Claude (Anthropic AI model)) from the sources listed above. 18 calculations on this page were recomputed by software and matched. Automated checks also covered structure, internal links and duplicate text. Software checks cannot confirm facts.

Found an error? Report it and we will correct the page.