You are on page 1of 4

CS 173: Discrete Structures, Fall 2011

Homework 7 Solutions
This homework contains 2 problems worth a total of 42 points. It is due on Friday, October
21st at 4pm. Put your homework in the appropriate dropbox in the Siebel basement.

1. Graphs [12 points]


Find the chromatic numbers for the following graphs. Justify your answer.

G1: 1 G2:
B A C
4
D E

3 F G
5
2
6

Solution:
Part a:
χ(G1) = 4. There is a complete subgraph of size 4 in G1 (i.e. including vertices 1, 2,
3, and 4). So this graph cannot be colored with less than 4 colors. Following is a valid
coloring where colors (g)reen, (r)ed, (b)lue, (p)ink are used. This shows that the graph
has chromatic number 4.

G1: g

b
r
p
b

1
Part b:
The following coloring shows that χ(G2) = 4. We haven’t covered planar graphs yet
but, if you know about them, the fact that G2 is planar also implies that the chromatic
number is no larger than 4. G2 has complete subgraphs of size 3 in it so it cannot be
colored with less than 3 colors. Therefore 3 ≤ χ(G2) ≤ 4.

G2:
g b g

r r

b p

To show that the chromatic number is 4, we need to show that there is no way to color
the graph with 3 colors. Let’s pick the three colors to be r, g, b. The vertices A, B, and
D are all connected, so we need to assign them three different colors. Then F and A must
have the same color, giving us the following partial coloring:

G2:
g b [x]

r [y]

b [z]

Because they are adjacent to each other and to a vertex labelled b, the two missing colors
x and y must be r and g (in one or the other order). But then there is no choice for the
missing color z, because it is adjacent to vertices with all three colors r, g, b.

2. Proof by Induction [30 points]


Use induction to write the following proofs.

(a) The nth harmonic number Hn is defined by

X
n
1
Hn =
k
k=1

Prove that the following equality holds for all integers n ≥ 1:


H1 + H2 + · · · + Hn = (n + 1)Hn − n.

2
Solution:
Proof: Use induction on n.
P
Base Case: Consider n = 1. H1 = 1k=1 k1 = 1. And (n + 1)Hn − n = (2)H1 − 1 =
2 − 1 = 1. These are equal, so the claim holds for n = 1. This proves our base case.
Inductive Hypothesis: Assume that claim is true for n = m
i.e. H1 + H2 + · · · + Hm = (m + 1)Hm − m.
Induction Step: We need to show that claim is true for n = m + 1. i.e.
H1 + H2 + · · · + Hm + Hm+1 = (m + 2)Hm+1 − (m + 1).
1
Notice that Hm+1 = Hm + m+1 . Applying this fact, the inductive hypothesis and
some algebra, we get:

H1 + H2 + · · · + Hm + Hm+1 = (m + 1)Hm − m + Hm+1


1
= (m + 1)(Hm+1 − ) − m + Hm+1
m+1
= (m + 1)Hm+1 − 1 − m + Hm+1
= (m + 2)Hm+1 − (m + 1)

This is what we needed to show.


(b) For any integer n prove the following claim, in which i is the square root of −1.
(cos x + i sin x)n = cos(nx) + i sin(nx)
Hint: look up the formulas for the sin and cosine of the sum of two angles.
Solution:
Use induction on n.
Base Case: Consider n = 0 i.e. (cos x + i sin x)0 = cos(0) + i sin(0) = 1.
Inductive Hypothesis: Assume that claim holds for n = k i.e. (cos x + i sin x)k =
cos(kx) + i sin(kx)
Induction Step: We need to show (cos x+i sin x)k+1 = cos((k+1)x)+i sin((k+1)x).

(cos x + i sin x)k+1 = (cos x + i sin x)(cos x + i sin x)k


= (cos x + i sin x)(cos kx + i sin kx)
= cos kx cos x − sin kx sin x + i(cos kx sin x + sin kx cos x)
= cos((k + 1)x) + i sin((k + 1)x

The second equality above uses inductive hypothesis and the last equality is obtained
by applying the formulas for the sin and cos of the sum of two angles. Therefore our
claim holds on all natural numbers n.
(c) Show that the following inequality holds for all integers n ≥ 2:
1 1 1 3 1
+ + · · · + ≤ −
22 32 n2 4 n

3
Hint: For the middle of the induction step, you’ll probably want to sketch out your
algebra backwards, i.e. starting with the inequality that you need to show true and
reducing it to something that’s clearly correct. Remember to rewrite this into logical
order for the final version you submit.
Solution:
Base Case: Consider n = 2.
1
22
= 0.25 ≤ 3/4 − 1/2 = 0.25. This prove our base case.
Inductive Hypothesis:
Assume that claim is true for n = k i.e. 212 + 312 · · · + k12 ≤ 3/4 − 1/k
Induction Step: We need to show that 212 + 312 · · · + (k+1) 1
2 + ≤ 3/4 − 1/(k + 1)

1 1 1 1 1 1 1
2
+ 2 ···+ 2
= 2 + 2 ···+ 2 +
2 3 (k + 1) 2 3 k (k + 1)2
1 1
≤ 3/4 − +
k (k + 1)2
1 1
= 3/4 + 2

(k + 1) k
2
k +k+1
= 3/4 −
k(k + 1)2
k2 + k
≤ 3/4 −
k(k + 1)2
k+1
≤ 3/4 −
(k + 1)2
1
≤ 3/4 −
(k + 1)
(1)

This is what we needed to show.

You might also like