Solutions To Exercises 8: Discrete Mathematics Lent 2009 MA210
Solutions To Exercises 8: Discrete Mathematics Lent 2009 MA210
Solutions To Exercises 8: Discrete Mathematics Lent 2009 MA210
MA210
Solutions to Exercises 8
(1) Suppose that G is a graph in which every vertex has degree at least k, where k 1, and in
which every cycle contains at least 4 vertices.
(a) Show that G contains a path of length at least 2k 1.
Solution. Take the longest path v
1
, v
2
, . . . , v
2
So, in how many ways we can assign labels from {1, 2, 3, 4, 5} to the trees above so that
each time we get a different edge set?
For the rst rst tree, which a path P
5
, each such an assignment is simply an ordering
of {1, 2, 3, 4, 5} to the line. There are 5! = 120 orderings, but some of them represent the
same graph. Which one are these? If we take any ordering, say 1, 2, 3, 4, 5, and ip it (to
5, 4, 3, 2, 1), then these two sequences represent the same path (in this particuar example,
its edges are 12, 23, 34, 45). Hence, there are 5!/2 = 60 trees on V of this type.
For the second tree, any assignment of labels is uniquely determined by the labels on
vertices of degree 3, 2 and on the leaf attached to a vertex of degree 2. We have 5 possible
labels for the vertex of degree 3. After choosing this label, we have 4 labels for the vertex
of degree 2, and, after that selection is made, we have 3 choices for the leaf attached to the
vertex of degree 2. By the Multiplication Rule, there are 5 4 3 = 60 trees on V of this
type.
Finally, for the star K
1,4
, any assignment of labels is uniquely determined by the labels
on the vertex of degree 3. We have 5 options for this, so there are 5 trees of this type on V .
Altogether, there are 60 + 60 + 5 = 125 different trees on V .
(3) Prove that if G is a connected graph with n vertices and n 1 edges, then G is a tree.
Solution. We proceed by induction on n. For n = 1, the only graph with 1 vertex and
0 edges is K
1
, which is a tree.
Suppose that every connected graph with n 1 vertices and n 2 edges is a tree. Let G
be a connected graph with n vertices and n 1 edges. First we claim that G has a vertex v
of degree 1. Indeed, we see that
2(n 1) = 2e(G) =
vV (G)
deg(v).
If every vertex had degree at least 2, then the right-hand side of the above equation would
be at least 2n and that is not possible. Since G is connected, every vertex has degree at least
1 and, therefore, there must be a vertex v of degree 1. Let u be the only neighbor of v in G.
We claim that G v (the graph obtained from G by removing v and the edge vu) is
connected. Indeed, let x and y be two vertices in G v. Since G is connected, there is a
path from x to y in G. Can this path contain v? If it did, then v would not be the endpoint
3
of this path (x and y are the endpoints) and so the degree of v would have to be at least 2.
However, v has degree 1 so we would get a contradiction. So, a path connecting x and y in
G does not contain v, therefore, it is also a path in Gv. Hence, any two vertices in Gv
are connected by some path in Gv, i.e., Gv is connected.
Now, Gv has n1 vertices, n2 edges, and it is connected. By induction assumption,
it must be a tree. Hence, G v does not contain a cycle. By adding v and vu back, we
cannot create a cycle. (Such a cycle would have to contain v, forcing it to have degree at
least 2. However, v has degree 1.) Also, G is connected by assumption, so G must be a
tree.
(4) Let G be a graph. Prove that G is a tree if and only if for every pair of vertices u and v,
there is a unique path between u and v.
Solution. We have two implications to prove.
Let G be a graph in which for every pair of vertices u and v, there is a unique path
between u and v.
In order to show that G is a tree, we must verify that G is connected and G has no cycle.
G must be connected because we are given that for every pair of vertices u and v, there
is a path between u and v.
Suppose now that there is a cycle in G with vertices v
1
, v
2
, . . . , v
k
and edges v
1
v
2
,
v
2
v
3
, . . . , v
k1
v
k
, v
k
v
1
. Then there are two paths between v
1
and v
k
, namely, v
1
, v
k
and
v
1
, v
2
, . . . , v
k
. This is a contradiction with our assumption that between every two vertices
there is a unique path connecting them. Hence, G contains no cycles.
Suppose that G is a tree, that is, G is connected and acyclic. Since G is connected,
there is a path between every two vertices of G. We mus prove that such a path is unique.
Suppose there are two vertices, u and v, for which there are two different paths from u
to v. Let the vertices of the rst path be u = x
1
, x
2
, . . . , x
k1
, x
k
= v and let the vertices
of the second path be u = y
1
, y
2
, . . . , y
1
, y
= v.
We also assume that u and v are chosen in such a way that k + (the sum of lengths of
these two paths) is as small as possible among all the pairs of vertices which have at least
two paths in between them.
4
If x
i
= y
j
for all 1 < i < k and 1 < j < , then the two paths together form a cycle in G
and that is not possible because G is a tree.
Otherwise, we must have x
i
= y
j
= w for some 1 < i < k and 1 < j < . What now?
(a) If u = x
1
, x
2
, . . . , x
i1
, x
i
= w and u = y
1
, y
2
, . . . , y
j1
, y
j
= w are two different
paths between u and w, then the sum of lengths of these paths i + j is smaller than
k + . Thus, we have a contradiction with our initial choice of u and v.
(b) In the same way we obtain a contradiction if w = x
i
, x
i+1
, . . . , x
k1
, x
k
= v and
w = y
j
, y
j+1
, . . . , y
1
, y
(5) Suppose that G is a forest with n vertices and c components. Prove that G has n c edges.
Solution. Let G
1
, . . . , G
c
be all the components of G. Each component is then connected
and with no cycle, i.e., every G
i
is a tree. If we denote by n
i
the number of vertices in
component G
i
, then we have e(G
i
) = n
i
1 and n = n
1
+ n
2
+ + n
c
.
As we have no edges between two components, we also have e(G) = e(G
1
) + e(G
2
) +
+ e(G
c
), and therefore
e(G) = e(G
1
) + e(G
2
) + + e(G
c
) = (n
1
1) + (n
2
1) + + (n
c
1) = n c.
(6) Prove by induction that every tree is a bipartite graph. (Do not use the theorem about the
characterization of bipartite graphs from lectures. This problem is easy to prove directly.)
Solution. We will use the property that every tree T contains a vertex v of degree 1, and
that T v is also a tree. (Why is this true?)
Now we proceed by induction on the number n of vertices of a tree T. For n = 1, 2,
the only trees are K
1
and K
2
and both are bipartite. Suppose that any tree on less than n
vertices is bipartite and let T be a tree on n vertices.
5
Let v be a vertex of degree 1 in T and let u be its only neighbor. We know that T v is
a tree with n 1 vertices, so, by induction assumption, T v has bipartition X, Y . (This
means that every edge in T v has one endpoint in X and the other one in Y .)
Now, if u X, then X, Y {v} is a bipartition of T. However, if u Y , then Y, X{v}
is a bipartition of T.
(7) (a) How many spanning trees does the graph P
n
have?
Solution. P
n
is a tree itself; removing any of its edges disconnects it (resulting graph
has n 2 edges, so it cannot be a tree). Hence, there is only one spanning tree of P
n
.