Docsity

Recurrence Relation - Discrete Mathematics - Homework, Slides of Discrete Mathematics

Toggle sidebar
bg1
CS173: Discrete Mathematical Structures
Spring 2006
Homework #11
Due 04/23/05, 8a
1. In the Tower of Hanoi puzzle, suppose our goal is to transfer all n disks from peg
1 to peg 3, but we cannot move a disk directly between pegs 1 and 3. Each move
of a disk must be a move involving peg 2. As usual, we cannot place a disk on
top of a smaller disk.
a. Find a recurrence relation for the number of moves required to solve the
puzzle for n disks with this added restriction.
b. Solve this recurrence relation to find a formula for the number of moves
required to solve the puzzle for n disks.
c. How many different arrangements are there of the n disks on three pegs so
that no disk is on top of a smaller disk?
d. Use your answers to parts b and c to argue that every allowable
arrangement of the n disks occurs in the solution of this variation of the
puzzle.
2. Solve the following recurrences exactly:
a. an=2anโˆ’1+2n2, a1=4 .
b. an= โˆ’anโˆ’1+2anโˆ’2+2nโˆ’1, a0=a1=1.
c. an=9an
2
+n2,a1=0.
d. an=9an
4
+n2, a1=0, a2=1.
e. an
=
5an
3
โˆ’
6an
9
โˆ’
3, a1
=
0, a3
=
1, a9
=
2.
3. Given the function an=k3
k=1
n
โˆ‘
a. Prove that the sequence an provides a solution to the linear
nonhomogeneous recurrence an=anโˆ’1+n3 with a base case of a1=1.
b. Solve the recurrence using annihilators.
4.
a. Find the general solution for T(n) = 2T(n-1) + 15T(m-2) + 3*2m.
b. Transform b(n) = 2b(n/2) + 15b(n/4) + 3n into the linear recurrence above.
c. Give the general solution for b(n).
Docsity.com
pf2

Partial preview of the text

Download Recurrence Relation - Discrete Mathematics - Homework and more Slides Discrete Mathematics in PDF only on Docsity!

CS173: Discrete Mathematical Structures

Spring 2006

Homework

Due 04/23/05, 8a

  1. In the Tower of Hanoi puzzle, suppose our goal is to transfer all n disks from peg 1 to peg 3, but we cannot move a disk directly between pegs 1 and 3. Each move of a disk must be a move involving peg 2. As usual, we cannot place a disk on top of a smaller disk. a. Find a recurrence relation for the number of moves required to solve the puzzle for n disks with this added restriction. b. Solve this recurrence relation to find a formula for the number of moves required to solve the puzzle for n disks. c. How many different arrangements are there of the n disks on three pegs so that no disk is on top of a smaller disk? d. Use your answers to parts b and c to argue that every allowable arrangement of the n disks occurs in the solution of this variation of the puzzle.
  2. Solve the following recurrences exactly:

a. an = 2 an โˆ’ 1 + 2 n^2 , a 1 = 4. b. an = โˆ’an โˆ’ 1 + 2 an โˆ’ 2 + 2 n^ โˆ’^1 , a 0 = a 1 = 1. c. an = 9 an 2

  • n^2 ,a 1 = 0.

d. an = 9 an 4

  • n^2 , a 1 = 0, a 2 = 1.

e. an = 5 an 3

โˆ’ 6 an 9

โˆ’ 3, a 1 = 0, a 3 = 1, a 9 = 2.

  1. Given the function an = k^3 k = 1

n

a. Prove that the sequence an provides a solution to the linear nonhomogeneous recurrence an = an โˆ’ 1 + n^3 with a base case of a 1 =1. b. Solve the recurrence using annihilators.

a. Find the general solution for T(n) = 2T(n-1) + 15T(m-2) + 3* 2 m. b. Transform b(n) = 2b(n/2) + 15b(n/4) + 3n into the linear recurrence above. c. Give the general solution for b(n).

Docsity.com

  1. Give an asymptotic solution to the following recurrence (that is, provide a ฮ˜ bound for the solution).

an =

3 an โˆ’ 1 5 an โˆ’ 2

, ai โ‰  0.

Docsity.com