

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Discrete Structures; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2007;
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Solutions: 1.1) Base case: n=1. f^21 = f 1 f 2 12 = 1* IH: for all k<=n, f^21 +f^22 +... +f^2 n =fn fn+1 holds. Step: nn+ f^21 +f^22 +... +f^2 n +f^2 n+1 =[IH]= fn fn+1 +f^2 n+1= fn+1 (fn +fn+1)= fn+1 fn+
1.2) Base case n=0. f 0 f 1 =f^20 1= n=1 (not really needed) f 0 f 1 +f 1 f 2 =f^22 01+11=1* IH: for all k<=n, f 0 f 1 +f 1 f 2 +f 2 f 3 +...+f2n-1f2n=f^2 2n holds. Step: nn+ (f 0 f 1 +f 1 f 2 +f 2 f 3 +...+f2n-1f2n)+f2nf2n+1+f2n+1f2n+1 =[IH]= f^2 2n+f2nf2n+1+f2n+1f2n+2= f2n(f2n+f2n+1)+f2n+1f2n+2= f2nf2n+2+f2n+1f2n+2= f2n+2 (f2n+f2n+1) = f^2 2n+
Solution: Base case: 4=22. IH: Assume that any non-prime number x<n can be written as a product of primes. We need to prove that if the IH holds and n is non-prime, n can be written as a product of primes. Since n is non-prime, it can be written as a product of two numbers n=ab, where a,b≠1,n. Therefore, a,b<n. Since both a and b can be written as a product of primes (by IH), n can be written too by just multiplying the prime factorizations of a and b.
Solution: 3.1) {1,2,3,4}∈S For any i∈S, i+5∈S. 3.2) (1,1) ∈S For any (a,b)∈S, (a+2,b) and (a,b+2) and (a+1,b+1) ∈S.
is a complete binary tree of height n+1. Prove the following:
Solution: 4.1) Base case: for n=1, we have n=1 node, and n-1=0 edges. IH: Each tree of with k<n nodes has k-1 edges. Step: prove for k=n