Test 1
CS291: Discrete Structures II
Spring 2018
March 21, Wednesday, 4:00pm-5:15pm
CLOSE BOOK, Your class roll number __________________
Last Name
______________________
First Name
________________________
There are 7 problems with a total of 100 points.
1 (10 points)
Solve the following
recurrence relation:
a
n
= 10
a
n
-1
- 25
a
n
-2
;
a
1
= 3,
a
2
= 20,
Solution:
Characteristic equation is
t
2
– 10
t
+ 25 = (
t
- 5)
2
= 0. It has one multiple root
t
= 5 with
multiplicity 2. Therefore, its total solution is
a
n
=
5
n
+
n
5
n
We use the initial condition to get
and
.
For
n
= 1, we get 3 = 5
+ 5
(1)
For
n
= 2, we get 20 = 25
+ 50
(2)
Solving (1) and (2), we get
=
2
5
and
=
1
5
.
Therefore, the answer is
a
n
=
2
5
×5
n
+
1
5
n
5
n
= 2
5
n
-1
+
n
5
n
-1
1

Two ways to tile a 1x1 board
Seven ways to tile a 1x2 board
Black
one red
one blue
two red
two blue
red blue
blue red
Green
white
2
(10 points)
Suppose we can only use 5 kinds of tiles to cover a 1
n
board:
(1) 1
1 size with red color,
(2) 1
1 size with blue color,
(3) 1
2 size with black color,
(4) 1
2 size with green color,
(5) 1
2 size with white color.
Let
W
(
n
) be the number of ways to tile the 1
n
board,
n
= 1, 2, ….
For example,
W
(1) = 2,
W
(2) = 7, as shown by the following figure.
Please find a recurrence relation for
W
(
n
) and solve it.
Solution:
The recurrence relation is:
The initial conditions are
W
(1) = 2,
W
(2) = 7,
When
n
> 2,
W
(
n
) = 2
W
(
n
-1) + 3
W
(
n
-2).
Its characteristic equation is
t
2
– 2
t
- 3 = 0. (
t
– 3)(
t
+1) = 0.

#### You've reached the end of your free preview.

Want to read all 12 pages?

- Fall '18
- Eric Swartz