{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Problem_Set_03

# Problem_Set_03 - ArsDigita University Month 2 Discrete...

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

ArsDigita University Month 2: Discrete Mathematics - Professor Shai Simonson Problem Set 3 – Recursion and Induction 1. Solve the Chinese Rings Puzzle, also called the Patience Puzzle, ( http://johnrausch.com/PuzzleWorld/patience.htm ). This will prepare you for recursion, recurrence equations, proofs by induction and graph representations. 2. Consider the variation of the Towers of Hanoi Problem where you have four pegs instead of three. For simplicity you may assume that n is a power of two. Sloppy Joe designs this solution: In order to move n disks from From to To , using Using1 and Using2 : If n equals 1, then move a disk from From to To, otherwise do the three recursive steps: Move n/2 disks from From to Using1 , using To and Using2; Move n/2 disks from From to To , using Using1 and Using2; Move n/2 disks from Using1 to To , using From and Using2; a. Explain why Sloppy Joe’s solution does not work. b. Fruity Freddie suggests changing the second line: Move n/2 disks from From to To , using Using1 and Using2; to Move n/2 disks from From to To , using Using2 and Using1; Explain why the algorithm still does not work in general. c. Code the algorithms in Scheme and report what happens for n = 4, and n = 8.

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.

{[ snackBarMessage ]}

### Page1 / 3

Problem_Set_03 - ArsDigita University Month 2 Discrete...

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

View Full Document
Ask a homework question - tutors are online