Problem
(Fulton's Algebraic Topology: A First Course, Exercise 10.15) If $X$ is a finite graph with $v$ vertices and $e$ edges, and $X$ has $k$ connected components, show that $H_1X$ is a free abelian group with $e-v+k$ generators.
Thoughts
First, WLOG, we could assume that $k=1$, i.e. $X$ is connected, and choose a spanning tree $T$ of $X$. Obviously, $T$ is contractible, therefore $H_0T=\mathbb Z$ and $H_1T=0$, and we're done when $e=v-1$. Now induction on $e$. Choose an edge $K$ of $X$ with the midpoint $p$. Let $U=X\setminus\{p\}$, and $V=\operatorname{Int}K$, the interior of $K$. The Mayer-Vietoris sequence for $U,V$ should be \begin{align*} 0&\to H_1(U\cap V)\to H_1(U)\oplus H_1(V)\to H_1(U\cup V)\\ &\to H_0(U\cap V)\to H_0(U)\oplus H_0(V)\to H_0(U\cup V)\to0 \end{align*} and we can (by induction) obtain that \begin{align*} &H_1(U\cap V)=0,H_0(U\cap V)\cong\mathbb Z^{\oplus 2}\\ &H_1(U)\cong H_1(X\setminus V)\cong\mathbb Z^{\oplus(e-v)},H_1(V)=0\\ &H_0(U)\oplus H_0(V)\cong\mathbb Z^{\oplus 2},H_0(U\cup V)=\mathbb Z \end{align*} However, I don't know how to make use of these information.
Any idea? Thanks!
Postscript: I don't know whether reduced homology could be used to conclude, but I prefer a proof without it since it's subsequently introduced in Problem 10.17.