You are here

Riddle of All Around Handshakes in a Dinner Party

Riddle of All Around Handshakes in a Dinner Party

12 guests in a dinner party, 4 couples and 4 persons without spouses, shake hands with each other except their spouses. How many handshakes were there?

The riddle of all around handshakes in a dinner party

Four married couples and 4 persons without their spouses meet for dinner. Everybody shakes hands with everybody else, but as is the custom, nobody shakes hands with the person to whom they are married.

How many handshakes were there?

Time to solve: 5 minutes.

Part 2: How many ways can you solve it? No time limit for this part.

Solution to the riddle of all around handshakes in a dinner party

Four married couples make 8 persons and 4 more persons without their spouses make 12 persons in total.

If we ignore the constraint for a moment, each of these 12 persons shakes hands with the other 11 persons, for a total number of 12 x 11 = 132 handshakes between 12 persons.

But as each handshake has been between two persons, in this method of counting each handshake is counted twice.

So the number of handshakes without constraint is half of 132, equal to 66.

Now we apply the constraint of each of the four married couples not shaking hands with spouse. Number of handshakes reduces by 4, one each for each of the couples.

So the final number of handshakes is, 66 - 4 = 62.

The logic above is all in mind. In virtual space.

But, you can see the handshakes better if you draw a graph with nodes as people and an edge between two nodes as a handshake.

This is the second way to solve the puzzle.

Solution to the riddle of handshakes representing handshakes as connected graph of nodes and edges

The handshakes as nodes and edges of a graph shown.

Symbolic representation of hand shakes whole view

A node represents a person, and an edge between two nodes represents a handshake between two persons (as nodes).

If you label each node by the name of a guest, and connect two nodes by edges without violating the constraint, you will have all the valid handshakes. Count the edges and you will get the total number of handshakes.

Domain mapping: Handshakes from a virtual domain of a dinner party are mapped onto a graph of nodes connected by edges.

In the figure above, the nodes for married couples numbered 1 to 8 are colored white. Nodes for four persons without spouses are colored black.

For simplicity, only the handshakes from first node 1 are shown. Node 1 represents one spouse of a married couple. Count 10 edges from the node to all other nodes. Constraint of no handshake with spouse eliminates the edge between node 1 and 2 as they are a married couple.

The total number of edges will be half of 12 times 11 minus 4 because of constraint. It will be 62 as before.

You can see now in your mind’s eye, the edges as handshakes and counting is easier.

We'll now solve the puzzle in a different way.

Solution to the riddle of handshakes as a connected graph of two groups

Instead of all persons in a single group, we will consider the group of married couples and the group of 4 persons without spouses separately.

The handshakes confined within each group shown.

Symbolic representation of hand shakes in parts

In the married couple’s group, each member shakes hands 6 times. Total number of handshakes in the group will be half of 6 x 8 = 48 equal to 24.

Members of the 4 person group, though will shake hands with each other with no constraint and the total number of handshakes in the group will be half of 3 x 4 = 12 equal to 6.

Combined number of handshakes confined within the two groups will be 24 + 6 = 30.

Time to count the handshakes between the two groups shown in the figure.

Symbolic representation of hand shakes between groups

For 4 members of the ‘Without Spouses’ group, the number of edges connecting to the members of the ‘With Spouses’ group will by 4 x 8 = 32.

No dividing by 2, as these connections are between two independent groups of members and no edge is counted twice. Members of two independent groups are connected with each other.

Combine the two results to get, 30 + 32 = 62 edges representing 62 handshakes.

Three ways to visualize and count the handshakes at the dinner party,

  • First, logically, in mind,
  • Second, as a graph of constrained edges between 12 nodes in one group,
  • Third, as edges within the two groups and then between the two groups.

End note

Graphical representation as nodes and edges aids visualization greatly. This is the subject of Graph theory.

As a mature field of study, it helps to unravel mysteries of real-world problems wherever entities have relationships with other entities in a large network.


Do you want to know how to solve difficult problems easily without wasting time on random attempts?

Our new ebook on puzzle solutions by innovative methods will show you just that.

Puzzles for Adults eBook

Puzzles for Adults: 50 Brain Teasers with Step-by-Step Solutions: Boost Your Power of Problem Solving

(Universal link for Apple books, Barnes & Noble, Rokuten Kobo, Angus & Robertson and others)

You may buy the Paperback at Amazon and eBook at Amazon or at Google Play book store.

Puzzles you may enjoy

Easy to hard brain teasers with systematic solutions

Challenging brain teasers with solutions: Long list.

This will always be the most up-to-date full list with the brain teasers classified into categories that can be browsed separately.

You may also click on the category term link below to enjoy the brain teasers that are classified in the present category.

For example, if the category term link shown below is "Riddle", click on it to go through all the Riddles.