HW4_sol

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

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

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 ﬁxed 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 deﬁne 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 deﬁne 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

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

View Full Document
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
Ask a homework question - tutors are online