The Handshaking Theorem, also called the Handshaking Lemma or the Sum of Degree Theorem, is a fundamental result in graph theory.
In an undirected graph, the theorem states that the sum of degrees of all vertices equals twice the number of edges.

Let G = (V, E) be a finite undirected graph with vertex set V and edge set E. For each vertex v ∈ V let deg(v) denote its degree. Then
∑v∈V deg(v) = 2·|E|
Each edge in an undirected graph has two ends and contributes exactly 1 to the degree of each of its two incident vertices.
Therefore each edge contributes exactly 2 to the sum of degrees of all vertices.
Summing the contributions of all edges gives:
Sum of degrees of all vertices = 2 × Number of edges.
Given
Let the number of vertices be n.
By the Handshaking Theorem, the sum of degrees of all vertices equals 2 × number of edges.
Sum of degrees = n × 4.
Therefore, n × 4 = 2 × 24.
So, 4n = 48.
Hence, n = 48 ÷ 4 = 12.
Thus, the number of vertices is 12.
Given
Let the total number of vertices be n.
By the Handshaking Theorem, the sum of degrees of all vertices equals 2 × number of edges.
Sum of degrees = (3 × 4) + (n - 3) × 2.
Therefore, 12 + 2(n - 3) = 2 × 21.
So, 12 + 2n - 6 = 42.
Hence, 2n + 6 = 42.
Thus, 2n = 36.
Therefore, n = 18.
Thus, the total number of vertices is 18.
Given
Let the number of degree 2 vertices be n.
By the Handshaking Theorem, the sum of degrees of all vertices equals 2 × number of edges.
Sum of degrees = (4 × 5) + (5 × 4) + (4 × 3) + (n × 2).
Therefore, 20 + 20 + 12 + 2n = 2 × 35.
So, 52 + 2n = 70.
Hence, 2n = 18.
Therefore, n = 9.
Thus, the number of degree 2 vertices is 9.
Given
Let the number of vertices be n.
By the Handshaking Theorem, n × k = 2 × 24 = 48.
Therefore, k = 48 ÷ n.
Since k must be a non-negative integer (degree of a vertex), n must divide 48.
Check each option:
For n = 20, k = 48 ÷ 20 = 2.4 (not an integer) - not allowed.
For n = 15, k = 48 ÷ 15 = 3.2 (not an integer) - not allowed.
For n = 10, k = 48 ÷ 10 = 4.8 (not an integer) - not allowed.
For n = 8, k = 48 ÷ 8 = 6 (integer) - allowed.
Thus, option (d) 8 is correct.
The Handshaking Theorem gives a simple but powerful relation between vertex degrees and edge count: the total of vertex degrees equals twice the number of edges. From this follows useful parity results and many practical checks used in graph algorithms and combinatorial reasoning.