This is a classic problem related to graph theory and the handshaking lemma.
Problem restatement:
At a party, many people shake hands with others. Each handshake involves exactly two people. We want to determine whether the number of people who shook hands with an odd number of people is even or odd.
Key insight:
Represent the situation as a graph:
- Each person is a vertex.
- Each handshake is an edge connecting two vertices.
The degree of a vertex is the number of edges incident to it, i.e., the number of handshakes that person participated in.
The handshaking lemma:
The sum of the degrees of all vertices in a graph is twice the number of edges:
[
\sum_{v \in V} \deg(v) = 2 \times (\text{number of edges})
]
Since the right side is twice an integer, the sum of all degrees is even.
What about the parity of degrees?
- Let (O) be the set of vertices with odd degree.
- Let (E) be the set of vertices with even degree.
We can write:
[
\sum_{v \in V} \deg(v) = \sum_{v \in O} \deg(v) + \sum_{v \in E} \deg(v)
]
- The sum of degrees of vertices in (E) is even (sum of even numbers).
- The sum of degrees of vertices in (O) is the sum of odd numbers.
Sum of odd numbers and parity:
- The sum of an even number of odd numbers is even.
- The sum of an odd number of odd numbers is odd.
Since the total sum of degrees is even, the sum of the degrees of vertices in (O) must be even.
Therefore, the number of vertices with odd degree must be even.
Answer:
The number of people who shook hands with an odd number of people is always even.
Summary:
- Model people as vertices and handshakes as edges.
- Sum of degrees = twice the number of edges → even.
- Sum of odd degrees must be even → number of odd-degree vertices is even.
This is a fundamental result in graph theory.