Suppose you are in a room full of people. If every person shakes hands with all of the other people, how many different handshakes are possible?
Two people
One handshake
Three people
Three handshakes
Four people
Six handshakes
Five people
Ten handshakes
You maybe already recognize our solution for the Triangular Numbers in the above visualization of the first four scenarios of the handshake problem. If there are n people who need to shake hands with everyone else, we can make sure that the first person shakes hands with everyone else. Then, since the second person has already shaken the hand of the first person, they can shake hands with everyone else, and so on. This picture shows us that we can count the number of handshakes by finding the number of cells in an array that is n by n + 1 and dividing by 2.
Do you also see ways to think about this problem in terms of the perspectives we've used to think about the other patterns we've explored so far?
We've seen how the solution to the handshake problem connects to the solution to the Triangular Numbers problem by the way we visualized the handshakes above. What about the other problems?
Maximum Intersections: If we imagine each person as a line, then each intersection represents a handshake that person has with every other individual.
Flight Paths: Every person represents an airport. A handshake is like having an airway between airports.
Picking Winners: If everyone shakes everyone else's hand, then we need all possible combinations of 2 people out of a group of n people to shake hands.