This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: MATH S104 Lecture 5 Inclass 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 welldefined 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
This note was uploaded on 05/12/2010 for the course APPLIED ST 2010 taught by Professor Various during the Spring '10 term at Universidad Nacional Agraria La Molina.
 Spring '10
 Various

Click to edit the document details