HW4_sol

HW4_sol - CSE21 FA11 Homework#4 4.1 Sketch of proof Recall...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework #4 (10/17/11) 4.1. Sketch of proof. Recall that we showed in class that n k =1 k = n ( n +1) 2 for all n 1 . We will prove that by induction n k =1 k 3 = n 2 ( n +1) 2 4 . We assume that n k =1 k 3 = n 2 ( n +1) 2 4 for some fixed n 1. Note that n +1 X k =1 k 3 = n X k =1 k 3 + ( n + 1) 3 = n 2 ( n + 1) 2 4 + ( n + 1) 3 (by induction) = ( n + 1) 2 ( n 2 + 4 n + 4) 4 = ( n + 1) 2 (( n + 1) + 1) 2 4 = ± ( n + 1)( n + 1) 2 ² 2 = n +2 X k =1 k ! 2 which completes the proof. 4.2. Solution. We define the minimum number of steps to move n discs from A to C (or from B to A ; or from C to A ) by f 2 ( n ). Similarly, we define the minimum number of steps to move n discs from A to B (or from B to C ; or from C to A ) by f 1 ( n ). Then, we have the following recurrence relations for f 1 ( n ) and f 2 ( n ). f 2 ( n ) = f 2 ( n - 1) (move the top n - 1 discs from A to C ) +1 (move the n -th disc from A to B ) + f 1 ( n - 1) (move the top n - 1 discs from C to A ) +1 (move the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/02/2012 for the course CSE 21 taught by Professor Graham during the Fall '07 term at UCSD.

Page1 / 3

HW4_sol - CSE21 FA11 Homework#4 4.1 Sketch of proof Recall...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online