Video 2, chapter 24

The Party Handshake Puzzle

Why at every party of two or more people two guests know the same number of others, proved with the pigeonhole principle and the degree sequence of a simple graph, and which assumptions the proof needs.

  • Video 2, chapter 24
  • Turn a route into a graph

At a party some guests know each other and some do not. For each guest, count how many of the other guests they know. Could all these counts be different, or must two guests always end up with the same count? This page proves that two counts always agree at every party of at least two people, without knowing who knows whom, and shows which assumptions the proof cannot do without.

Key terms

Party handshake puzzle

Definition A party has nn guests, where n≥2n \ge 2. Any two different guests either know each other or do not. Knowing is mutual, so if one guest knows another, the second also knows the first, and nobody counts themselves. The count of a guest is the number of other guests they know. The puzzle asks us to show that some two different guests always have the same count, whatever the acquaintances are. Each count is one of the nn numbers 0,1,…,n−10, 1, \ldots, n - 1, since a guest can know at most the n−1n - 1 others. The counts 00 and n−1n - 1 cannot both occur, because a guest with count n−1n - 1 knows every other guest, so every other guest knows at least that one and has count at least 11. The counts that occur therefore all lie among 0,1,…,n−20, 1, \ldots, n - 2 or all among 1,2,…,n−11, 2, \ldots, n - 1. That leaves at most n−1n - 1 different values for nn guests, and by the pigeonhole principle two guests share a value. The same puzzle is often told with handshakes, where each pair of guests shakes hands at most once and each guest counts their own handshakes. It promises that some count is shared, not which one, and not that everyone has the same count.

In plain words If somebody knows no one, then nobody knows everyone. So the guests have fewer possible counts than there are guests, and two of them must share a count.

Example Take six guests. The possible counts 0,1,2,3,4,50, 1, 2, 3, 4, 5 are six values for six guests, so at first it looks as if each guest could have a different count. That would need one guest with count 55 and another with count 00, but the guest with count 55 knows the guest with count 00, which is impossible. In an actual party of six standing in a line, where each guest knows only the people right next to them, the counts are 1,2,2,2,2,11, 2, 2, 2, 2, 1. Several counts are shared here, and the argument above never needed to know which count would repeat.

Pigeonhole principle

Definition If NN objects are placed in kk boxes, where NN and kk are whole numbers with N>k≥1N > k \ge 1, then at least one box contains at least two objects. More generally, for any whole numbers N≥1N \ge 1 and k≥1k \ge 1, some box contains at least ⌈N/k⌉\lceil N/k \rceil objects, where ⌈x⌉\lceil x \rceil means the smallest whole number that is at least xx. The reason is a count. If every box held fewer than ⌈N/k⌉\lceil N/k \rceil objects, each would hold fewer than N/kN/k, and the kk boxes together would hold fewer than NN. The principle says that some box is shared, not which one, and when N≤kN \le k it promises nothing, since every object could then have a box of its own.

In plain words If there are more pigeons than holes, some hole gets at least two pigeons.

Example Among any 1313 people, two were born in the same month, since 1313 birthdays go into 1212 months. Among any 2525 people, some month holds at least ⌈25/12⌉=3\lceil 25/12 \rceil = 3 birthdays. Twelve people could all have different birth months, so the number 1313 cannot be lowered. In the party puzzle the guests are the objects and the counts that can actually occur are the boxes, nn guests in at most n−1n - 1 boxes.

Simple graph

Definition A simple graph consists of vertices and edges, where each edge joins two different vertices, any two vertices are joined by at most one edge, and edges have no direction. Two vertices joined by an edge are called neighbors, and the degree of a vertex is its number of neighbors. In a simple graph with nn vertices every degree is one of 0,1,…,n−10, 1, \ldots, n - 1, because a vertex can be joined only to the other n−1n - 1 vertices, and to each of them at most once. A party is a simple graph with the guests as vertices and an edge for each pair of guests who know each other, and the count of a guest is the degree of that vertex. The rules of the puzzle match the definition exactly. Mutual knowing means edges without direction, nobody counting themselves means no edge from a vertex to itself, and counting each pair at most once means at most one edge per pair.

In plain words Dots and lines, where every line joins two different dots, no two lines join the same pair, and the lines have no arrows.

Example Four guests PP, QQ, RR and SS, where PP knows QQ and RR, and RR knows SS, give a simple graph with the three edges PQPQ, PRPR and RSRS. The degrees are 22 for PP, 11 for QQ, 22 for RR and 11 for SS, each at most 33. The graph of the seven bridges of Königsberg is not simple, since two bridges join the island to each bank.

Degree sequence

Definition The degree sequence of a graph is the list of the degrees of its vertices, usually written from largest to smallest. The degree sequence of a simple graph with n≥2n \ge 2 vertices has three properties. Every entry is between 00 and n−1n - 1. The entries add up to twice the number of edges, since each edge adds 11 to the degrees of both of its ends, so the sum is even and the number of odd entries is even. Finally, the entries 00 and n−1n - 1 never both appear. These conditions are necessary only. A list can have all three properties and still not be the degree sequence of any simple graph.

In plain words Write down how many people each guest knows. Not every list can occur, and the restrictions on the list are what force two counts to agree.

Example The six guests in a line have degree sequence (2,2,2,2,1,1)(2, 2, 2, 2, 1, 1), with sum 1010, twice the 55 acquainted pairs. The list (3,3,1,1)(3, 3, 1, 1) for four guests has all three properties, since its entries lie between 00 and 33, its sum 88 is even, and it contains no 00. Still no party has these counts. Two guests with count 33 each know all three others, so each of the remaining two guests knows both of them and has count at least 22, not 11.

Vertices of equal degree

Definition Every simple graph with at least two vertices has two different vertices of the same degree. Both conditions matter. A graph with one vertex has no pair to compare, and when edges may repeat or have a direction, the degrees can all be different, as the example and the questions below show. The theorem guarantees at least one pair of equal degrees, but it does not say which degree repeats, and it does not say that all the degrees are equal. In fact, for every n≥2n \ge 2 there are simple graphs with nn vertices in which exactly two vertices share a degree and all the other degrees are different.

In plain words In any network of mutual connections among two or more members, with at most one connection between any two members and nobody connected to themselves, at least two members have the same number of connections.

Example Following someone on a social network is not mutual, and there the conclusion fails. Put nn people in a row and let each one follow everyone later in the row. The first follows n−1n - 1 people, the next n−2n - 2, and so on down to the last, who follows nobody, so the nn follow counts n−1,n−2,…,1,0n - 1, n - 2, \ldots, 1, 0 are all different. The proof for parties breaks at the step that ruled out 00 and n−1n - 1 together. The first person follows the last, but the last person does not have to follow back.

Check yourself

  1. List every possible pattern of counts at a party of three guests, and check that two counts always agree.
Show the answer

Three guests form three pairs, and any number of these pairs from 00 to 33 can be acquainted. With no acquainted pair the counts are 0,0,00, 0, 0. With one pair, the two guests in it have count 11 and the third has count 00, giving 1,1,01, 1, 0. With two pairs, one guest belongs to both and has count 22, and the other two have count 11, giving 2,1,12, 1, 1. With all three pairs every guest has count 22. In each of the four cases two counts agree, as the theorem says, and the counts 00 and 22 never appear together.

  1. Suppose the guests count handshakes, and two guests are now allowed to shake hands more than once. Must two guests still have the same count? Which step of the proof breaks?
Show the answer

No. Take three guests PP, QQ and RR, where PP and QQ shake hands twice and QQ and RR shake hands once. The counts are 22 for PP, 33 for QQ and 11 for RR, all different. The proof used the fact that a count is at most n−1n - 1, here 22, because a guest can shake hands with each of the others at most once. With repeated handshakes the guest QQ reaches 33, so the counts are no longer limited to the values 0,1,…,n−10, 1, \ldots, n - 1, there are no longer fewer available counts than guests, and the pigeonhole principle has nothing to say. In graph language, the drawing has two edges between PP and QQ, so it is not a simple graph.

  1. At a party of five, can it happen that exactly two guests share a count while the other three counts are different from each other and from the shared one? If so, which count is shared?
Show the answer

It can happen, and the shared count is always 22. In such a party the five counts take exactly four different values. They lie between 00 and 44 and do not include both 00 and 44, so the four values are 0,1,2,30, 1, 2, 3 or 1,2,3,41, 2, 3, 4. Call the shared value xx. The sum of all five counts is twice the number of acquainted pairs, so it is even.

With the values 1,2,3,41, 2, 3, 4 the sum is 10+x10 + x, so xx is even, which means 22 or 44. If x=4x = 4, two guests know everybody, so each of the other three guests knows both of them and has count at least 22, and nobody could have count 11. So x=2x = 2.

With the values 0,1,2,30, 1, 2, 3 the sum is 6+x6 + x, so xx is 00 or 22. If x=0x = 0, two guests know nobody, so each of the other three guests can know only the other two of those three and has count at most 22, and nobody could have count 33. So again x=2x = 2.

Both cases really occur. Let the guests be PP, QQ, RR, SS and TT, let PP know everyone, and let QQ also know RR and SS. The counts are 44 for PP, 33 for QQ, 22 for RR and SS, and 11 for TT. In the opposite party, where two guests know each other exactly when they did not before, each count cc becomes 4−c4 - c, giving 0,1,2,2,30, 1, 2, 2, 3. In both, only the count 22 is shared.