Maximum number of vertices Find the maximum number of vertices in a graph which has five components and $40$ edges.
I tried to use that the sum of the degrees is twice the number of edges which is $80$. but how do I relate this with the number of vertices? Also, since $40$ edges are in $5$ components, will it be true that each component has $8$ edges?
 A: We will get maximum number of vertices when we have trees (because they don't have cycles, which means when we add an edge, we also add a vertex). If we say $n$ is the number of vertices and $e$ is the number of edges, then for trees, we have $n = e+1$. Now, we have $5$ tree components, which is also called forest, say with $n_1$, $n_2$, $n_3$, $n_4$, $n_5$ vertices and $e_1$, $e_2$, $e_3$, $e_4$, $e_5$ edges. Then for each $i$ with $1 \le i \le 5$, we have $n_i = e_i+1$. So, we have $$n_1+n_2+n_3+n_4+n_5 = e_1+e_2+e_3+e_4+e_5+5$$
We know that $e_1+e_2+e_3+e_4+e_5 = 40$ so there can be $45$ vertices maximum.
A: You could use that a tree is the 'least' connecetd of all the connected graphs with $n$ vertices. So if $v_i$ and $e_i$, $1\leq i\leq 5$ denote the number of vertices and edges of each of the $5$ components then each component must have at least $v_i-1$ edges since they are connected.  So $$40=\sum_{i=1}^5e_i\geq \sum_{i=1}^5(v_i-1)$$$$\Rightarrow \sum_{i=1}^5 v_i\leq 45.$$
Now note that it is possible to draw a five component graph with $40$ edges and $45$ vertices. 
