lecture25 - Lecture 25 Recursive Definitions Announcement...

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

View Full Document Right Arrow Icon
Lecture 25 Recursive Definitions
Background image of page 1

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

View Full DocumentRight Arrow Icon
Announcement Quiz on Friday Chapters: three (excluding 3.7 and 3.8) and four (including 4.1, 4.2, 4.3) But of course you should know basic definitions from earlier chapters (e.g. sets, functions, etc.)
Background image of page 2
Recursive Functions We can define a function recursively by specifying: Basis: the value of the function at the smallest element of the domain. E.g.: f(0) = 1 Recursive step: A rule for finding the value of the function at an integer from its values at smaller integers E.g: f(n+1) = 2*f(n) Many common functions can be defined recursively.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Examples F(n) = n! recursively: F(0) = 1 F(n) = n*F(n-1) F(n) = 1 + 2 + … + n F(1) = 1 F(n+1) = (n+1) + F(n)
Background image of page 4
Fibonacci Numbers F(0) = 0 F(1) = 1 F(n) = F(n-1) + F(n-2) 0 5000 10000 15000 20000 25000 30000 35000 40000 45000 50000 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 Fibonacci Numbers
Background image of page 5

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

View Full DocumentRight Arrow Icon
Let = (1+ 5)/2 = 1.61803… For n 3, F(n) > n-2 Proof by induction. Hint for the inductive step:
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/21/2011 for the course CSCI 2011 taught by Professor Staff during the Spring '08 term at Minnesota.

Page1 / 16

lecture25 - Lecture 25 Recursive Definitions Announcement...

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

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