lecture25

# lecture25 - Lecture 25 Recursive Definitions Announcement...

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

Lecture 25 Recursive Definitions

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

View Full Document
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.)
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.

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

View Full Document
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)
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

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

View Full Document
Let = (1+ 5)/2 = 1.61803… For n 3, F(n) > n-2 Proof by induction. Hint for the inductive step:
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
Ask a homework question - tutors are online
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}