Discrete Mathematics Math 6A Homework 9 Solution.

Slides:



Advertisements
Similar presentations
Mathematical Induction
Advertisements

Recursive Definitions and Structural Induction
Recursively Defined Functions
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Induction and Recursion. Odd Powers Are Odd Fact: If m is odd and n is odd, then nm is odd. Proposition: for an odd number m, m k is odd for all non-negative.
Induction and recursion
CSE115/ENGR160 Discrete Mathematics 04/03/12 Ming-Hsuan Yang UC Merced 1.
Congruence class arithmetic. Definitions: a ≡ b mod m iff a mod m = b mod m. a  [b] iff a ≡ b mod m.
Recursive Definitions Rosen, 3.4. Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
Discrete Structures Chapter 2 Part B Mathematical Induction
CSE115/ENGR160 Discrete Mathematics 03/31/11
1 Section 6.1 Recurrence Relations. 2 Recursive definition of a sequence Specify one or more initial terms Specify rule for obtaining subsequent terms.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank. Modified By Mingwu Chen Induction.
1 Section 3.4 Recursive Definitions. 2 Recursion Recursion is the process of defining an object in terms of itself Technique can be used to define sequences,
1 Section 3.3 Mathematical Induction. 2 Technique used extensively to prove results about large variety of discrete objects Can only be used to prove.
Properties of the Integers: Mathematical Induction
Induction and recursion
Discrete Mathematics Chapter 4 Induction and Recursion 大葉大學 資訊工程系 黃鈴玲 (Lingling Huang)
Applied Discrete Mathematics Week 9: Relations
Advanced Counting Techniques
MATH 224 – Discrete Mathematics
Discrete Mathematics CS 2610 March 26, 2009 Skip: structural induction generalized induction Skip section 4.5.
Induction and recursion
Discrete Mathematics, 1st Edition Kevin Ferland
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Mathematical Induction. F(1) = 1; F(n+1) = F(n) + (2n+1) for n≥ F(n) n F(n) =n 2 for all n ≥ 1 Prove it!
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Chapter 4: Induction and Recursion
CSE 311 Foundations of Computing I Lecture 15 Recursive Definitions and Structural Induction Autumn 2011 CSE 3111.
Section 5.3. Section Summary Recursively Defined Functions Recursively Defined Sets and Structures Structural Induction.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
Mathematical Induction Digital Lesson. Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 Mathematical induction is a legitimate method.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
1 Recursive Definitions and Structural Induction CS 202 Epp section ??? Aaron Bloomfield.
Agenda Lecture Content:  Recurrence Relations  Solving Recurrence Relations  Iteration  Linear homogenous recurrence relation of order k with constant.
ADVANCED ALGORITHMS REVIEW OF ANALYSIS TECHNIQUES (UNIT-1)
8.4 Mathematical Induction Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 Recursively defined sequences Write the first 5.
Inductive Proofs and Inductive Definitions Jim Skon.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Discrete Mathematics Lecture # 22 Recursion.  First of all instead of giving the definition of Recursion we give you an example, you already know the.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
6/12/2016 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(2) Mathematical Induction & Recursion Dr.Saad Alabbad Department of.
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
1 Recursive Definitions and Structural Induction CS/APMA 202 Rosen section 3.4 Aaron Bloomfield.
Section Recursion  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Mathematical Induction And Recursion Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Fall 2002CMSC Discrete Structures1 Chapter 3 Sequences Mathematical Induction Recursion Recursion.
CMSC Discrete Structures
Modeling with Recurrence Relations
Advanced Algorithms Analysis and Design
Recursively Defined Functions
Mathematical Induction Recursion
Chapter 5 Induction and Recursion
CSE 321 Discrete Structures
Applied Discrete Mathematics Week 9: Integer Properties
CMSC Discrete Structures
Applied Discrete Mathematics Week 7: Computation
Advanced Analysis of Algorithms
CMSC Discrete Structures
Mathematical Induction
Recurrence Relations Discrete Structures.
Mathematical Induction
Recursion.
Presentation transcript:

Discrete Mathematics Math 6A Homework 9 Solution

3.4-2 f(0) = 3 a)f(1)=-2f(0)=-2*3=-6 f(2)=-2f(1)=-2*-6=12 f(3)=-2f(2)=-2*12=-24 f(4)=-2f(3)=-2*-24=48 f(5)=-2f(4)=-2*48=-96 b) f(1)=3f(0)+7 = 3*3 + 7 = 16 f(2)=3f(1)+7 = 3* = 55 f(3)=3f(2)+7 = 3* = 172 f(4)=3f(3)+7 = 3* = 523 f(5)=3f(4)+7 = 3* = 1576 c) f(1) = f(0)^2 - 2f(0) -2 = 3^2 – 2*3 -2 =1 f(2) = f(1)^2 - 2f(1) -2 = 1^2 – 1*3 -2 = -3 f(3) = f(2)^2 - 2f(2) -2 = -3^2 – 2*-3 -2 = 13 f(4) = f(3)^2 - 2f(3) -2 = 13^2 – 2*13 -2 = 141 f(5) = f(4)^2 - 2f(4) -2 = 141^2 – 2* = 19,579

d) f(1)=3^{f(0)/3} = 3^{3/3} = 1 = f(0). In the same manner, f(n) = 3 for all n f(0) = -1, f(1) =2 a) f(2) = f(1) + 3f(0) = 2 + 3*(-1) = -1 f(3) = f(2) + 3f(1) = *2 = 5 f(4) = f(3) + 3f(2) = 5 + 3*(-1) = 2 f(5) = f(4) + 3f(3) = 2 + 3*5 = 17 b) f(2) = f(1)^2*f(0) = 2^2 *(-1) = -4 f(3) = f(2)^2*f(1) = (-4)^2*2 = 32 f(4) = f(3)^2*f(2) = 32^2 *(-4) = f(5) = f(4)^2*f(3) = (-4096)^2 *32 = 536,870,912 c)f(2) = 3f(1)^2 - 4f(0)^2 = 3*2^2 - 4*(-1)^2 = 8 f(3) = 3f(2)^2 - 4f(1)^2 = 3*8^2 - 4*2^2 = 176 f(4) = 3f(3)^2 - 4f(2)^2 = 3*176^2 - 4*8^2 = 92,672 f(5) = 3f(4)^2 - 4f(3)^2 = 3*92672^2 - 4*176^2 = 25,764,174,8484 d) f(2) = f(0)/f(1) = -1/2 f(3) = f(1)/f(2) = 2/(-1/2) = -4 f(4) = f(2)/f(3) =(-1/2)/(-4) = 1/8 f(5) = f(3)/f(4) =(-4)/(1/8) = -32

Prove that f1+f3+...+f2n-1 = f2n whenever n is a pos. int. We prove this by induction. The base case is n=1, and in that case the statement to be proved in just f1=f2; this is true since both values are 1. Next we assume that inductive hypothesis, that f1+f3+...+f2n-1 = f2n, and try to prove the corresponding statement for n+1, namely, f1+f3+...+f2n-1+f2n+1 = f2n+2. We have f1+f3+...+f2n-1+f2n+1 = f2n + f2n+1 (by the inductive hypothesis) = f2n+2 (by the def. of the Fibonacci numbers) Show that the set S defined by 1  S and s+t  S whenever s  S and t  S is the set of pos. ints. Clearly only pos. int. can be in S, since 1 is a pos. int. and the sum of two pos ints. is again a pos. int. To see that all pos. ints. are in S, we proceed by induction. Obviously 1  S. Assuming that n  S, we get that n+1 is in S by applying the recursive part of the def. w/ s=n and t=1. Thus S is precisely the set of pos. ints Give a recursive def. of the set of pos. ints. that are multiples of 5. We can define the set S={x|x is a pos. int. and x is a multiple of 5} by the base case requirement that 5  S and the recursive requirement that if n  S, then n+5  S. Alternatively we can mimic Example 7, making the recursive part of the definition that x+y  S whenever x and y are in S.

Give a recursive definition of a)the set of even integers. Since we can generate all the even ints. by starting w/ 0 and repeatedly adding or subtracting 2, a simple recursive way to define this set is as follows: 0  S; and if x  S then x+2  S and x-2  S. b) the set of pos. ints congruent to 2 modulo 3. The smallest pos. int. congruent to 2 mod 3 is 2. so we declare 2  S. All the others can be obtained by adding multiples of 3, so our inductive step is that if x  S, then x+3  S. c) the set of pos. ints not divisible by 5. The pos. ints. not divisible by 5 are the ones congruent to 1,2,3, or 4 mod 5. Therefore we can proceed just as in part (b), setting 1  S, 2  S, 3  S, and 4  S as the base cases, and then declaring that if x  S, then x+5  S.

a)If we apply each of the recursive step rules to the only element given in the basis step, we see that (0,1), (1,1), and (2,1) are all in S. If we apply the recursive step to these we add (0,2), (1,2), (2,2), (3,2) and (4,2). The next round gives us (0,3),(1,3), (2,3), (3,3), (4,3), (5,3), and (6,3). And the fourth set of applications adds (0,4),(1,4),(2,4),(3,4),(4,4),(5,4),(6,4),(7,4), and (8,4). b) Let P(n) be the statement that a  2b whenever the (a,b)  S is obtained by n applications of the recursive step. For the basis step, P(0) is true, since the only element of S obtained w/ no applications of the recursive step is (0,0), and indeed 0  2*0. Assume the strong inductive hypothesis that a  2b whenever (a,b)  S is obtained by k or fewer applications of the recursive step, and consider an element obtained w/ k+1 applications of the recursive step. Since the final application of the recursive step to an element (a,b) must be applied to an element obtained w/ fewer application for the recursive step, we know that a  2b. So we just need to check that this inequality implies a  2(b+1), a+1  2(b+1), and a+2  2(b+1). But this is clear, since we just add 0  2, 1  2, and 2  2, respectively, to a  2b yields a  2(b+1), a+1  2(b+1), and a+2  2(b+1). c) Structural Induction: This holds for the basis step, since 0  0. If this holds for (a,b), then it also holds for the elements obtained from (a,b) in the recursive step, since adding 0  2, 1  2, and 2  2, respectively, to a  2b yields a  2(b+1), a+1  2(b+1), and a+2  2(b+1).

a) Since the number of bacteria triples every hour, the recurrence relation should say that the number bacteria after n hours is 3 times the number of bacteria after n-1 hours. Letting bn denote the number of bacteria after n hours, this statement translates into the recurrence relation bn=3bn-1 b) The given statement is the initial condition b0=100. We solve the recurrence relation by iteration: bn = 3bn-1 = 3 2 bn-2 =... = 3 n bn-n = 3 n b0. Letting n=10 and knowing that We are letting an be the population, in billion of people, n years after a)an=1.013a n-1 with a0=6.2 b)an = 6.2(1.013)^n c)a20 = 6.2(1.013) 20  8.0 billion people

the number of bit strings of length n that contain a pair of consecutive 0's a) Let a n be the number of bit string of length n containing a pair of consecutive 0's In order to construct a bit string of length n containing a pair of consecutive 0's, we could start with 1 and follow with a string of length n-1 containing a pair of consecutive 0's, or 01 and follow with a string of length n-2 containing a pair of consecutive 0's, or 00 and follow with any string of length n-2 containing a pair of consecutive 0's These three cases are mutually exclusive and exhaust the possibilities for how the string might start. From this analysis we can immediately write down the recurrence relation, valid for all n  2: a n =a n-1 + a n n-2. (Recall that there are 2 k bit strings of length k) b) There are no bit strings of 0 or 1 containing a pair of consecutive 0's, so the initial conditions are a 0 = a 1 = 0 c) We will compute a 2 through a 7 using the recurrence relation: a2 = a1 + a0 + 2^0 = = 1 a3 = a2 + a1 + 2^1 = = 8 a4 = a3 + a2 + 2^2 = = 9 a5 = a4 + a3 + 2^3 = = 19 a6 = a5 + a4 + 2^4 = = 43 a7 = a6 + a5 + 2^5 = = 94 Thus there are 94 bit strings of length 7 containing two consecutive 0's

the number of bit strings of length n that contain three consecutive 0's a) Let an be the number of bit string of length n containing a pair of consecutive 0's In order to construct a bit string of length n containing a pair of consecutive 0's, we could start with 1 and follow with a string of length n-1 containing three consecutive 0's, or 01 and follow with a string of length n-2 containing three consecutive 0's, or 001 and follow with a string of length n-3 containing three consecutive 0's 000 and follow with any string of length n-3 containing a pair of consecutive 0's These four cases are mutually exclusive and exhaust the possibilities for how the string might start. From this analysis we can immediately write down the recurrence relation, valid for all n  3: a n =a n-1 + a n-2 + a n n-3. b) There are no bit strings of 0, 1 or 2 containing three consecutive 0's, so the initial conditions are a0 = a1 = a2 = 0 c) We will compute a3 through a7 using the recurrence relation: a3 = a2 + a1 + a0+ 2^0 = = 1 a4 = a3 + a2 + a1+ 2^1 = = 3 a5 = a4 + a3 + a2+ 2^2 = = 8 a6 = a5 + a4 + a3+ 2^3 = = 20 a7 = a6 + a5 + a4+ 2^4 = = 47 Thus there are 47 bit strings of length 7 containing three consecutive 0's

6.2-3 a)r-2=0, r=2, a n =  2 n, (by Theorem 3 with k=1), a0=3, 3 =  2^0,  =3, Therefore a_n=3*2^n b)r-1=0, r=1, a_n=  1^n= , a0=2,  =2, Therefore an=2 for all n c)r^2 – 5r +6 = 0, r=2, 3, an=  1 2^n +  2 3^n, a0=1, 1=  1 +  2, since a1=0 0=2   2,  1=3  2=-2. Therefore an=3*2^n – 2*3^n d)r^2-4r+4=0, r=2, an=  1 2 n +  2 n2 n, since a0=6 and a1=8  1=6, 8=2   2.  2=-2. Therefore an=6*2^n – 2*n*2^n e)r^2+4r+4=0, r=-2, an=  (-2) n +  n(-2) n, a0=0 and a1=1,  1=0, 1=-2   2,  2=- 1/2, Therefore an=(-1/2)n(-2) n = n(-2) n-1 f)r^2 -4 = 0, r=2, -2, an=  1 2 n +  2 (-2) n, 0=  1 +  2, and 4=2   2,  1=1,  2=-1. Therefore an=2^n – (-2)^n. g)r^2-1/4=0, r=1/2, -1/2. an=  1(1/2)^n +  2(-1/2)^n. 1=  1+  2 and 0=  1 /2 -  2 /2.  1=  2=1/2 Therefore an=(1/2)(1/2)^n + (1/2)(-1/2)^n = (1/2) n+1 – (-1/2) n+1

6.2-4 a) r^2-r-6 = 0, r=2,3, an=  1(-2)^n +  2*3^n, 3=  1+  2, 6= -2  1+3  2,  1=3/5,  2=12/5. Therefore an=(3/5)(-2)^n + (12/5)3^n b) r^2-7r+10 = 0, r=2,5, an=  1(2)^n +  2*5^n, 2=  1+  2, 1= 2  1+5  2,  1=3,  2=- 1. Therefore an=3*2^n – 5^n c) r^2-6r+8 = 0, r=2,4, an=  1(2)^n +  2*4^n, 4=  1+  2, 10= 2  1+4  2,  1=3,  2=1. Therefore an=3*2^n + 4^n d) r^2-2r+1 = 0, r=1,1, an=  1(1)^n +  2*n*1^n =  1 +  2*n, 4=  1, 1=  1+  2,  1=4,  2=-3. Therefore an=4 – 3n e) r^2-1 = 0, r=-1,1, an=  1(-1)^n +  2*1^n =  1(-1)^n +  2, 5=  1+  2, -1= -  1+  2,  1=3,  2=2. Therefore an=3*(-1)^n + 2 f) r^2 + 6r + 9 = 0, r=-3,-3, an=  1(-3)^n +  2*n*(-3)^n, 3=  1, -3= -3  1-3  2,  1=3,  2=-2. Therefore an=3(-3)^n – 2n(-3)^n = (3-2n)(-3)^n g) r^2+4r-5 = 0, r=-5, 1, an=  1(-5)^n +  2*1^n =  1(-5)^n +  2, 2=  1+  2, 8= - 5  1+  2,  1=-1,  2=3. Therefore an=-(-5)^n + 3