Discrete Math Suggested Practice Problems With Answer For Final Exam
Discrete Math Suggested Practice Problems With Answer For Final Exam
Discrete Math Suggested Practice Problems With Answer For Final Exam
2. Draw the intersection (simple) graph of with the vertex set {A1 , A2 , . . . , A6 }
where there is an edge between Ai and aj iff Ai Aj 6= .
A1 = {x | x < 0}, A2 = {x | 1 < x < 0}, A3 = {x | 0 < x < 1}, A4 = {x| 1 <
x < 1}, A5 = {x | x > 1}, A6 = R.
3. Draw the acquaintanceship graph that represents Tom and Pat, Tom and Hope,
Tom and Sandy, Tom and Amy, Tom and Marika, Jeff and Pat, Jeff and Mary,
Pat and Hope, Amy and Hope, and Amy and Marika know each other, but none
of the other pairs of people listed know each other.
4. Describe a graph model that represents a subway system in a large city. Should
edges be directed or undirected? Should multiple edges be allowed? Should
loops be allowed?
Section 10.2: Graph terminology
1. Consider the following graph G.
e
a
c
G
b
a
d
e
f
G
10. Determine whether there is a graph with the following degree sequence. If such
a graph exists, draw it. (a) (3, 3, 3, 3, 2) (b) (5, 4, 3, 2, 1).
11. How many vertices does a regular graph of degree 4 with 10 edges?
12. Find the number of edges of the following graphs and describe them: Kn , Km,n , Cn , Qn .
13. Suppose the simple graph G has e edges with the degree sequence (d1 , d2 , . . . , dn ).
(a) Find the number of edges of G in terms of n and e.
(b) Find the degree sequence of G.
14. Show that if a bipartite graph has n vertices and e edges, then e n2 /4.
Section 10.3: Matrices for Graphs and Graph Isomorphism
1. What is the sum of entries in a row (column) of the adjacency matrix A of an
undirected simple graph G? What if G is directed?(Solved in class notes)
2. What is the sum of entries in a row and column of the incidence matrix M of
an undirected simple graph G? (Solved in class notes)
3. Determine whether G and H are isomorphic. Exhibit an isomorphism or provide
a rigorous argument that none exists. (Solved in class notes)
v4
u4
v5
v3
u5
u3
v1
v2
u1
u2
v2
v3
v4
v5
v7
v6
u1
v8
u2
u3
u4
u7
v3
v1
v2
G
3
u6
u8
u5
v3
e4
e3
e1
e2
v1
v2
v5
G
8. Draw a simple graph undirected graph
0
1
A=
0
0
1 0 0
0 1 0
.
1 0 1
0 1 0
0 1 0 0
0 0 1 0
A=
0 1 0 0 .
0 0 1 0
Section 10.4: Connectivity
1. Consider the following graph (Solved in class).
a
c
e
c
e
d
G
d
H
(a) Are the graphs strongly connected? Are the graphs weakly connected?
(b) If weakly connected, find its strongly connected components.
2. Consider the following graph (Solved in class).
e
c
b
G
(c) Determine which of the following inequalities in (G) (G) min deg(v)
v
are strict?
4
a
b
f
G
(c) Determine which of the following inequalities in (G) (G) min deg(v)
v
are strict?
4. Construct a graph G with (G) = 1, (G) = 2 and min deg(v) = 3.
v
e
c
d
e
d
G
c
H
(a) Do the above graphs have a Euler circuit? If so, find such a circuit. Otherwise give an argument why no such circuit exists.
(b) Do the above graphs have a Euler path? If so, find such a path. Otherwise
give an argument why no such path exists.
2. Consider the following graphs.
a
c
e
d
e
d
G
c
H
(a) Do the above graphs have a Hamilton circuit? If so, find such a circuit.
Otherwise give an argument why no such circuit exists.
(b) Do the above graphs have a Hamilton path? If so, find such a path. Otherwise give an argument why no such path exists.
Section 10.7: Planar Graphs
5
B
A
C
D
E
G
a
c
b
e
f
T
(a) Which vertex is the root?
(b) What is the level of e?
(c) Which vertices have level 3?
(d) What is the height of T ?
G
4. Consider the following graph G. (Solved in class)
a
c
b
G
(a) Use depth-first search to produce a spanning tree T for the above graph G.
Choose a as the root of T and maintain the alphabetical order of vertices
in T .
7
(b) Use breadth-first search to produce a spanning tree T for the above graph
G. Choose a as the root of T .
5. Consider the following graph G.
a
c
b
G
Use depth-first search to produce a spanning tree T for the above graph G.
Choose a as the root of T and maintain the alphabetical order of vertices in T .
6. Consider the following graph G.
a
c
b
G
Use breadth-first search to produce a spanning tree T for the above graph G.
Choose a as the root of T .
Section 11.5: Minimum Spanning Trees
1. Consider the following graph G.
1
a
4
2
3
3
3 e 2
G
(a) Use Prims algorithm to find a minimum spanning tree of G.
(b) Use Kruskals algorithm to find a minimum spanning tree of G.
2. Consider the following graph G.
10
a
f
4
8
7
6
9
5
8
2 e 9
2
c
1
G
8
Answers
8.2
1. (a) linear, homogeneous, with constant coefficients; degree 2
(b) linear with constant coefficients but not homogeneous
(c) not linear
(d) linear, homogeneous, with constant coefficients; degree 3
(e) linear and homogeneous, but not with constant coefficients
(f) linear with constant coefficients, but not homogeneous
(g) linear, homogeneous, !
with constant coefficients;
degree 7
n
!n
1
1+ 5
1 5
1
2. (a) fn =
2
2
5
5
n
n
(b) an = 2 (2)
(c) an = 6 2n 2n 2n
(d) an = 6 2(1)n 2n
(e) an = 5 + 3(2)n 3n
(f) an = 5 2n + 2n 2n + 26n2 2n
10.1
1. G is a multigraph, H is neither a multigraph nor a simple graph, H is a simple
graph.
2. The intrsection graph G has vertex set {A1 , A2 , A3 , A4 , A5 , A5 , A6 } and edges are
{A6 , Ai }, i = 1, 2, 3, 4, 5, {A5 , Ai }, i = 1, 2, 3, 4, {A4 , Ai }, i = 1, 2, 3, , {A2 , A1 }}.
3. Easy
4. Take the subway stations as the vertices where an edge from station u to station
v if there is a train going from u to v without stopping. It is quite possible that
some segments are one-way, so we should use directed edges. (If there are no one-way
segments, then we could use undirected edges.) There would be no need for multiple
edges, unless we had two kinds of edges, maybe with different colors, to represent
local and express trains. In that case, there could be parallel edges of different colors
between the same vertices, because both a local and an express train might travel the
same segment. There would be no point in having loops, because no passenger would
want to travel from a station back to the same station without stopping.
10.2
1. (a) V (G) = {a, b, c, d, e}, E(G) = {{a, b}, {a, c}, {b, c}, {d, c}}, degree sequence
(3, 2, 2, 1, 0)
(b) For G, V (G) = {a, b, c, d, e}, E(G) = {{a, e}, {b, e}, {c, e}, {d, e}, {d, a}, {d, b}}
The induced subgraph of G on {b, c, d, e} has edge set {{b, c}, {c, d}} and similar for
other sets of 4 vertices.
2. Not bipartite. We try color all the vertices by two colors, say red and blue, so that
adjacent vertices get different colors. Suppose assign red to vertex b. Then vertices c
and f get blue. But f and c are adjacent. So we need more than 2 colors to color all the
vertices of G so that adjacent vertices get different colors. Thus G is not 2-colorable,
hence not bipartite.
3. No. By the Handshaking theorem, the number of edges = 21 the degree-sum
10
= 12 (15 5) = 37.5
4. (Use pigeonhole principle) Suppose a simple graph G has n 2 vertices. Each
vertex has degree 0, 1, . . . , n 2 or n 1. Note that a vertex has degree n-1 iff no
vertex has degree 0.
Case 1. There is no vertex of degree 0.
The possibilities of degree of n vertices are n-1 numbers 1, 2, . . . , n 1. So by pigeonhole principle there are two vertices of the same degree.
Case 2. There is a vertex of degree 0.
In this case no vertex has degree n-1. Then the possibilities of degree of n vertices are
n-1 numbers 0, 1, . . . , n 2. So by pigeonhole principle there are two vertices of the
same degree.
5. Draw by the definition of Kn , Km,n , Cn , Wn , Qn .
6. K2 , C are bipartite for all even n. Qn is bipartite for all n. Wn not bipartite for all
n.
7. |E(Kn )| = (n2 n)/2, |E(Cn )| = n, |E(Wn )| = (2n 2), |E(Km,n )| = mn and
|E(Qn )| = n2n1 .
8. (3, 3, 3, 3), (2, 2, 2, 2), (3, 3, 3, 3), (3, 3, 2, 2, 2), (3, 3, 3, 3, 3, 3, 3, 3).
9. The number of vertices = 6 and the number of edges = 21 (5 + 2 + 2 + 2 + 2 + 1) = 7.
10. (a) yes (b) no
11. the number of edges 10 = 21 (4n). So n = 5.
n
12. |E(Kn )| = 0, |E(Km,n )| = m+n
mn,
|E(C
)|
=
n and |E(Qn )| =
n
2
2
2n
n1
n2
.
2
13. (a) n2 e (b) (n 1 d1 , n 1 d2 , . . . , n 1 dn ).
14. Suppose the number of vertices of two vertex sets in a bipartite graph are x and
2
n x. So the number of edges is e = x(n x) = n4 (x n2 )2 . Thus e n2 /4.
10.3
1. If G is an undirected simple graph, then the sum of entries of row (column) i of A
is the degree of the vertex vi . If G is a directed graph, then the sum of entries of row
i of A is the out-degree of the vertex vi and the sum of entries of column i of A is the
in-degree of the vertex vi .
2. If G is an undirected simple graph, then the sum of entries of row i of M is the
degree of the vertex vi and the sum of entries of column i of M is 2 (the number of
vertices ei is incident with).
3. Consider the function f : VG VH such that f (v1 ) = u1 , f (v2 ) = u3 , f (v3 ) =
u5 , f (v4 ) = u2 and f (v5 ) = u4 . It can be checked that {vi , vj } EG if and only if
{f (vi ), f (vj )} EH . Thus G and H are isomorphic.
4. Suppose there is a graph isomorphism f : VG VH . Since deg(v1 ) = 1 and
deg(u1 ) = deg(u7 ) = deg(u8 ) = deg(u6 ) = 1, f (v1 ) is one of u1 , u6 , u7 and u8 . Note
that v1 is adjacent to v2 which has degree 2. But none of u1 , u6 , u7 and u8 is adjacent
to a degree 2 vertex. Thus G and H are not isomorphic. Note that G and H have the
same degree sequence (3, 3, 2, 2, 1, 1, 1, 1).
5. There are many. Eg. C6 and C3 C3 have the degree sequence (2, 2, 2, 2, 2, 2). The
following G and H have the same degree sequence (3, 3, 2, 2, 1, 1, 1, 1).
11
v1
v2
v3
v4
v5
v7
u1
v6
1
0
1
0
0
0
1
0
0
1
1
1
0
1
0
0
1
1
0
0
u4
u5
u6
u8
G
0
1
1
0
1
1
1
0
0
0
u3
u7
v8
u2
0
0
1
0
1
0
0
1
1
0
1
0
0
1
0
8.
v1
v2
v3
v4
v3
v1
v2
v4
9.
10.4
1. (a) G is strongly connected and hence weakly connected. H is not strongly connected, but weakly connected. (b) Strongly connected component of G is G. Strongly
connected components of H are a; b and (b, c), (c, d), (b, d).
2. (a) {b}, {b, a}, {b, e}, {b, c}, {b, d} are vertex cuts of size at most 2. {{b, c}, {b, d}}, {{b, a}, {b, e}}
are edge cuts of size at most 2.
(b) (G) = 1, (G) = 2 and min deg(v) = 2.
v
b
R1
R3
R2
R4
c
d
2. 6.
3. 12.
4. See class notes.
10.8
1. 2.
2. at most 4.
(
(
2 if n is even
4 if n is even
3. (Kn ) = n, (Cn ) =
., (Wn ) =
., (Pn ) =
3 if n is odd
3 if n is odd
(Sn ) = (K(
m,n ) = 2.
(
n
1
if
n
is
even
2 if n is even 0
4. 0 (Kn ) =
. 0 (Cn ) =
. (Pn ) = 2.
n
if n is odd
3 if n is odd
5. 4.
B
C
D
E
G
11.1
1. 99.
2. n t.
3. There are many answers. So see the definition and do it.
4. (a) a, (b) 2, (c) f and g, (d) 3, (e) full 2-ary tree (f) a,b,e, (g) c,d,f,g, (h) b, (i) d,e.
11.4
1. e n + 1.
2. Trees.
a
b
e
d
h
Spanning tree of G
3.
c
e
d
h
Spanning tree of G
13
e
d
h
Spanning tree of G
e
c
f
Spanning tree T of G
f
c
6. a
e
h
b
Spanning tree T of G
e
h
b
Spanning tree T of G
d
g
f
(b) a
f
Spanning tree T of G
c
b
a
5.
e
d
h
Spanning tree of G
a
4. (a)
11.5
1. Prims and Kruskals algorithms give the same minimum spannning tree of G.
1
2
e 2
c
b
8
2 e
g
2
14