Discrete Mathematics with Graph Theory (3rd Edition) 149

Discrete Mathematics with Graph Theory (3rd Edition) 149 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Section 5.3 147 Here is a solution for n = 3. A B C Initial position 1,2,3 * * Move 1 2,3 1 * Move 2 3 1 2 Move 3 3 * 1,2 Seven moves are required. Move 4 * 3 1,2 MoveS 1 3 2 Move 6 1 2,3 * Move 7 * 1,2,3 * (b) To transfer n discs from peg A to peg B, just mimic what we did for 2 and for 3, but with the top disk replaced by the top n - 1 disks: following: 1. Transfer the top n - 1 discs to peg C in a n -1 moves. 2. Transfer the remaining (largest) disc to peg B in one move. 3. Transfer the n - 1 smaller discs from peg C to peg B in another an-l moves. We obtain an = 2an-1 + 1. (c) We obtain easily that Pn = -1 is a particular solution to the recurrence relation an = 2an-1 + 1. The characteristic polynomial associated with an = 2an -l is x 2 - 2x with characteristic roots 0,2. Thus, qn
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: = c(2n) and Pn + qn = c(2n) -1. Since al = 1, C(21) - 1 = 1 and c = 1. We obtain an = 2 n -1. (d) If n = 8, we require 2 8 -1 = 255 seconds ~ 4 minutes. If n = 16, we require 2 16 -1 = 65535 seconds ~ 18 hr If n = 32, we require 2 32 -1 = 4294967295 sec ~ 136 yrs. If n = 64, we require 2 64 -1 sec ~ 5.8 x 1011 yr. 24. (a) Labelling the pegs A, B and C and numbering the disks 1,2, ... , n here is a solution for n = 2 with the tower initially on peg A (* denotes no disks). A B C Initial position 1,2 * * Four moves are required. By reversing these steps, we Move 1 2 1 * see that four moves also suffice when the tower is ini-Move 2 2 * 1 tially on the middle peg. Move 3 * 2 1 Move 4 * 1,2 * Here is a solution for n = 3, again assuming that the tower is initially on peg A....
View Full Document

Ask a homework question - tutors are online