problems05-sol - MATH S-104 Lecture 5 In-class Problem...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: MATH S-104 Lecture 5 In-class Problem Solutions July 7, 2009 Problem 1 † : Find the first 5 terms of the following recursively defined function. G ( n ) = 1 if n is 1 1 + G ( n 2 ) if n is even G ( 3 n- 1 ) if n is odd and n > 1 G ( 1 ) = 1 G ( 2 ) = 1 + G ( 1 ) = 2 G ( 3 ) = G ( 8 ) = 1 + G ( 4 ) = 1 + 1 + G ( 2 ) = 4 G ( 4 ) = 1 + G ( 2 ) = 3 G ( 5 ) = G ( 14 ) = 1 + G ( 7 ) = 1 + G ( 20 ) = 1 + 1 + G ( 10 ) = 1 + 1 + 1 + G ( 5 ) G ( 5 ) uncovers a problem with the function. We get G ( 5 ) = 3 + G ( 5 ) , which means 0 = 3, a contradiction. So G is not a well-defined function. Problem 2 † : Consider the following recursively defined set S : Base step : λ ∈ S ( λ is the empty string) Recursive step : If s ∈ S , then a. bs ∈ S b. sb ∈ S c. saa ∈ S d. aas ∈ S e. asa ∈ S Form a conjecture about the strings in S , and prove it using structural induction. The strings in S all contain an even number of a ’s....
View Full Document

Page1 / 3

problems05-sol - MATH S-104 Lecture 5 In-class Problem...

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