given that,
in a graph there are
n vertices , and k disjoint trees
first approach : directly take examples and find .
second approach : find by using properties of graph and tree
concept: βin a tree having V vertices we know number of edges is V-1 as tree is an connected acyclic graphβ
so, there are k connected components in given graph where each connected component is a tree,
let $n_{1}$,$n_{2}$,$n_{3}$β¦β¦β¦.$n_{k}$ be number of vertices in first connected component,second connected componentβ¦β¦.β¦...$k_{th}$ connected component respectively.
as each connected component is a tree hence number of edges in first connected component, second connected component,β¦β¦β¦β¦...$k_{th}$ will be
$n_{1}-1$, $n_{2}-1$, $n_{3}-1$, β¦β¦β¦β¦β¦β¦..,$n_{k}-1$ respectively.
so total number of edges in graph = ($n_{1}-1)$+ ($n_{2}-1)$+($n_{3}-1$) +β¦β¦β¦β¦β¦β¦..+ ($n_{k}-1$)
= ($n_{1}+$ $n_{2}+$$n_{3}$ β¦β¦β¦β¦β¦β¦..$n_{k}$) -1-1-1-1β¦β¦.k times
= n-k