Handshake Problem Calculator: how many handshakes in a group?
Count the handshakes when everyone in a group shakes hands once: n(n − 1)/2, plus the reverse (people from handshakes), couples who skip their partner, two teams lining up, rounds needed and time taken, with steps and a table.
How it works
Handshakes = C(n, 2) = n × (n − 1) ÷ 2 · People from handshakes: n = (1 + √(1 + 8h)) ÷ 2 · Couples: C(2p, 2) − p = 2p(p − 1) · Two teams: A × B (+ C(A, 2) + C(B, 2) if teammates shake too) · Rounds = n − 1 (n even) or n (n odd)
Each handshake is a pair of two different people, and order does not matter (you shaking my hand is the same handshake as me shaking yours), so the count is the number of 2-element combinations, C(n, 2) = n(n − 1)/2. Another way to see it: each of the n people shakes n − 1 hands, giving n(n − 1), but that counts every handshake twice, once from each side, so you divide by 2. The answers are the triangular numbers 1, 3, 6, 10, 15, 21, 28, 36, 45 … and they grow with the square of the group: doubling the group roughly quadruples the handshakes. The same count gives the edges of a complete graph, the games in a single round-robin league and the lines joining n points; subtracting n gives the diagonals of an n-sided polygon. Switch the problem type to work backwards from a handshake count (only triangular numbers have an exact answer), to handle couples who skip their own partner, or to count a post-game handshake line between two teams. Under More options, set how long one handshake takes to estimate the time: one at a time, or in rounds where everyone pairs up at once.
Worked example
For 10 people: each person shakes 9 hands, 10 × 9 = 90 counted from both sides, and 90 ÷ 2 = 45 handshakes. At 3 seconds each, one at a time takes 135 seconds (2.3 minutes); if everyone pairs up at once it takes 9 rounds, 27 seconds. Ten points also have 45 − 10 = 35 diagonals as a decagon.
Sources: Combination — Wikipedia · Handshake problem — Wolfram MathWorld · Triangular number — Wikipedia
Frequently asked questions
Why divide by 2 in the handshake formula?
Multiplying n by (n − 1) counts each handshake twice, once for each of the two people involved. Dividing by 2 removes the double count, giving the true number of distinct pairs.
How is this related to combinations?
A handshake is a choice of 2 people from n where order does not matter, so it is exactly “n choose 2”, C(n, 2) = n(n − 1)/2. The same formula counts edges in a complete graph and matches in a single round-robin tournament.
How many handshakes for 100 people?
100 × 99 ÷ 2 = 4,950. For 20 people it is 190, for 30 people 435, and for 50 people 1,225.
If there were 66 handshakes, how many people were there?
Solve n(n − 1)/2 = 66: n = (1 + √(1 + 528)) ÷ 2 = (1 + 23) ÷ 2 = 12 people. Only triangular numbers (1, 3, 6, 10, 15 …) give a whole number.
How many handshakes if couples do not shake hands with their partner?
With p couples there are 2p people, so C(2p, 2) handshakes minus the p partner pairs: 2p(p − 1). Five couples make 45 − 5 = 40 handshakes, and each person shakes 8 hands.
How many handshakes after a game between two teams?
If every player on one team shakes every player on the other, it is A × B. Two soccer teams of 11 make 121 handshakes; two basketball teams of 5 make 25.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.