Confusion : In a class there are 30 students. Is it possible that, 9 of them have 3 friends (in the class), 11 - have 4, and 10 - have 5 friends? Question : In a class there are 30 students. Is it possible that, 9 of them have 3 friends (in the class), 11 - have 4, and 10 - have 5 friends?
Solution : Let there be 30 vertices in the graph, 9 of which have degree 3, 11 - have degree 4, 10 - have degree 5. Meanwhile, in the graph, there are 19 odd vertices, which is against the "Handshake-Theorem", so it's not possible.
I didn't understand where is the statement "Meanwhile, in the graph, there are 19 odd vertices" from and by what do we get that information? I'm confused, please help me.
 A: You can represent the problem using a graph of 30 vertices, where every vertex represents a different student and each edge between two vertices means they are friends. Since there are $9$ vertices with $3$ edges and $10$ with $5$ edges, and the rest of vertices has an even number of edges, we conclude we have exactly $19$ vertices with odd number of edges.
Now, the Handshaking Lemma states that the sum of degrees of the vertices of a graph is twice the number of edges (to be said, the number of vertices with odd degree is even). Notice this lemma applies for finite undirected graphs, which is our case since we hace just 30 vertices and it's undirected because if $A$ is friend of $B$, then we assume $B$ is also friend of $A$.
But the sum of the degrees of the vertices in our problem is odd, because it's the sum of $19$ odd numbers (obviously odd) plus $21$ even numbers (leaving the result odd). Since it's odd, it can't be twice a natural number, so we conclude this situation is not possible.
A: Alternative approach.
Graph theory is not needed.
Every time that person $A$ is friends with person $B$, then you have that person $B$ is friends with person $A$.  Therefore, each distinct friendship results in $(2)$ "man-friends".
The idea is that if you have $n$ people, labeled #1, #2, ..., #n, and if you let $f(k)$ denote the number of friends that person #k has, among the $(n-1)$ other people, then you must have that
$$\left[\sum_{k=1}^n f(k)\right] ~\text{is an even number}.$$
If you review the statement of the question, the hypothetical $\left[\sum_{k=1}^n f(k)\right]$ would be an odd number, which is not possible.
