Recursive Definitions - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Recursive Definitions

Description:

To define a function with the set of nonnegative integers as its domain ... definition of an where a is a nonzero real number and n is a nonnegative integer. ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 9
Provided by: mahmood5
Category:

less

Transcript and Presenter's Notes

Title: Recursive Definitions


1
Recursive Definitions
  • Section 4.3

2
Mathematical Induction (Recap)
  • A proof by mathematical induction that P(n) is
    true for every positive integer n consists of two
    steps
  • Basis step The proposition P(1) is shown to be
    true.
  • Inductive step The implication P(k)?P(k1) is
    shown to be true for every positive integer k.

3
Strong Induction(Recap)
  • To prove that P(n) is true for every positive
    integer n consists of two steps
  • Basis step The proposition P(1) is shown to be
    true.
  • Inductive step The implication P(1)?P(2)?
    ?P(k)?P(k1) is shown to be true for every
    positive integer k.

4
Mathematical Induction (Recap)
  • Use mathematical induction to prove that n3n is
    divisible by 3 whenever n is a positive integer.
  • Show that if n is an integer greater than 1, then
    n can be written as the product of primes.

5
Recursion
  • We can define a sequence, series, or function in
    terms of itself. This process is called
    recursion.
  • To define a function with the set of nonnegative
    integers as its domain
  • Specify the value of the function at zero
  • Give a rule for finding its value at an integer
    from its values at smaller integers

6
Example
  • The sequence of powers of 2 can be written
    explicitly as
  • an 2n
  • However, this sequence can also be defined using
    recursions as
  • a0 1, an1 2an

7
Example
  • Suppose that f is defined recursively by
  • f(0)3
  • f(n1) 2f(n)3
  • Find f(1), f(2), f(3), and f(4)

8
Example
  • Give a recursive definition of an where a is a
    nonzero real number and n is a nonnegative
    integer.
  • Give a recursive definition of the factorial
    function F(n) n!.
  • Give a recursive definition for the Fibonacci
    numbers 1 2 3 5 8 13 21 ...
Write a Comment
User Comments (0)
About PowerShow.com