ics141-lecture20-Recursion

ics141-lecture20-Recursion - 20-1ICS 141 Discrete...

Info iconThis preview shows pages 1–10. 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 Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: 20-1ICS 141: Discrete Mathematics I (Spr 2008University of HawaiiICS141: Discrete Mathematics for Computer Science IDepartment of Information and Computer SciencesUniversity of HawaiiStephen Y. Itoga20-2ICS 141: Discrete Mathematics I (Spr 2008University of HawaiiLecture 20Chapter 4. Induction and Recursion4.3 Recursive Definitions and Structural Induction4.4 Recursive Algorithms20-3ICS 141: Discrete Mathematics I (Spr 2008)University of HawaiiSome material in these slides were taken/adapted from the slides made by Prof. Michael P. Frank and Prof. Jonathan L. Gross which are provided through the publisher of “Discrete Mathematics and Its Applications” written by Kenneth H. Rosen.Some slides were done by Prof. Baek.20-4ICS 141: Discrete Mathematics I (Spr 2008)University of HawaiiRecursive DefinitionsIn induction, we proveall members of an infinite set satisfy some predicate Pby:proving the truth of the predicate for larger members in terms of that of smaller members.In recursive definitions, we similarly definea function, a predicate, a set, or a more complex structure over an infinite domain (universe of discourse) by:defining the function, predicate value, set membership, or structure of larger elements in terms of those of smaller ones.In structural induction, we inductively prove properties of recursively-defined objects in a way that parallels the objects’ own recursive definitions.20-5ICS 141: Discrete Mathematics I (Spr 2008)University of HawaiiThe Fibonacci NumbersThe Fibonacci numbersfn≥0is a famous series defined by:f= 0, f1= 1, fn≥2= fn−1+ fn−21123581320-6ICS 141: Discrete Mathematics I (Spr 2008)University of HawaiiInductive Proof about Fibonacci NumbersTheorem: fn<2n.Proof:By inductionBase cases: f= 0 <2= 1f1= 1 <21= 2Inductive step: Use 2ndprinciple of induction Note use of base cases ofrecursive definitionImplicitly for all n∈N20-7ICS 141: Discrete Mathematics I (Spr 2008)University of HawaiiA Lower Bound on Fibonacci NumbersTheorem.For all integers n≥3, fnαn−2, where α= (1+51/2)/2 ≈ 1.61803.Proof.(Using strong induction.)Let P(n) = (fnαn−2).Base cases: For n=3, note thatαn−2=α<2 = f3. For n=4, αn−2=α2= (1+2·51/2+5)/4 = (3+51/2)/2 ≈ 2.61803 <3 = f4.Inductive step: For k≥4, assume P(j) for 3≤j≤k, prove P(k+1). fk+1= fk+ fk−1αk−2+ αk−3(by 20-8ICS 141: Discrete Mathematics I (Spr 2008)University of HawaiiMore Easy ExamplesWrite down recursive definitions for:i+n(iinteger, nnatural) using only s(i) = i+1.a·n(areal, nnatural) using only additionan(areal, nnatural) using only multiplication∑0≤i≤nai(for an arbitrary series of numbers {ai})∏0≤i≤nai (for an arbitrary series of numbers {ai})∩0≤i≤nSi(for an arbitrary series of sets {Si})20-9ICS 141: Discrete Mathematics I (Spr 2008)University of HawaiiRecursively Defined SetsAn infinite set Smay be defined recursively, by giving:A small finite set of baseelements of S....
View Full Document

{[ snackBarMessage ]}

Page1 / 30

ics141-lecture20-Recursion - 20-1ICS 141 Discrete...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online