Recursion and induction - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Recursion and induction

Description:

Step 1 Basic building blocks (atoms) Step 2 Construct complex from ... (inductive hypothesis) n(n 1)/2 (n 1) = (basic algebra) (n 1)(n 2)/2 (end of proof) ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 8
Provided by: MOL52
Category:

less

Transcript and Presenter's Notes

Title: Recursion and induction


1
Recursion and induction
  • definition of a (universal) set by induction
    (recursion)
  • definition of an operation (given a universe) by
    induction (recursion)
  • proof of a property by induction
  • Recursive definitions
  • Step 1 Basic building blocks (atoms)
  • Step 2 Construct complex from simpler
  • Step 3 There is nothing else (only for sets,
    not for operations)
  • Inductive proof
  • Step 1 Prove for atoms
  • Step 2 Reduce (proof of) complex to
    simpler (other direction as inductive
    definitions)

2
Recursive definitions
  • Example 1 Suppose we take U N.
  • We can define the set E of even naturals by
  • 0 ? E (the atom is 0)
  • If n ? E, then n2 ? E.
  • Nothing else is in E.
  • E is the smallest subset of U containing the
    atoms and closed under the operations. Without
    smallest, e.g. E 0,2,4,5,6,7,8, would
    also satisfy the first two clauses.
  • Example 2 Suppose U 1, 2, 3, 4, 5.
  • Let f U ? U be given by f(n) 6-n.
  • What subset do we get from the recursive
    definition below?
  • Our only atom is 3
  • If n belongs to the subset, so does f(n)
  • It is the smallest subset containing 3 and
    closed under f.

3
More recursive definitions
  • Example 3 Suppose we take U N.
  • Let s N ? N be given by s(n) n1 (the
    successor function). What subset is recursively
    defined if we specify
  • the atom is 113
  • whenever k belongs to it, so does s(k)?
  • Example 4 Suppose U N?N.
  • What subset of N?N do we get from the recursive
    definition below?
  • atom is 0, 0.
  • If m, n belongs, so does s(m), s(s(n))
  • Example 5 Take U N?N. The points on the line
    y 3x
  • The atom is 0, 0.
  • If x, y belongs, so does s(x), s(s(s(y))) .

4
Defining functions recursively
  • We have recursively defined subsets of N?N. We
    now define functions (operations) on N.
  • Example The factorial function is defined by
  • 0! 1
  • (n1)! (n1) ?n!
  • In the usual function notation, we have defined a
    function Fact N ? N by stipulating that
  • Fact(0) 1 Fact(s(n)) s(n)?Fact(n).
  • Or in yet other words, we define the subset of
    N?N called Fact by specifying that
  • our atom is 0, 1
  • if n, k ? Fact then s(n), s(n)?k ? Fact.
  • (And nothing else is in Fact)

5
Induction
  • For every recursively defined set there is a
    corresponding induction principle.
  • Lets focus on N.
  • N can be described as the smallest subset of R
    containing atom 0 and closed under s.
  • So if a subset X of N has the properties
  • 0 ? X
  • if n ? X, then s(n) n1 ? X
  • then that subset must be the whole of N.
  • Principle of induction for N
  • Let X ? N. If
  • 0 ? X and
  • for every n ? X, s(n) ? X,
  • then X N.
  • Similarly for other atoms and recursive
    operations!

6
Examples of inductive proofs
  • Prove that, for every n ?? N,
  • 0 1 2 n n(n1)/2.
  • Proof
  • Basis 0 0(01)/2
  • Induction 0 1 2 n (n1) (inductive
    hypothesis) n(n1)/2 (n1) (basic
    algebra) (n1)(n2)/2 (end of proof)
  • Prove that, for every finite set X and n ? N,
  • if X n, then ?(X) 2n
  • Proof (see book)

7
Variations on induction
  • 1. Other recursively defined sets.
  • A 4, 5, 6, may be defined by saying that 4
    ? A and that if n ? A, then s(n) ? A.
  • Prove that, for every n 4,
  • n! gt 2n.
  • 2. Other formulations of the principle.
  • Suppose X ? N and X has the property that
  • if 0?X, 1?X, 2?X, , n?X then s(n)?X.
  • Then X N.
  • This is generally called strong induction (for
    the natural numbers, similarly for other
    inductively defined sets)
  • Prove that every integer k gt 1 is a product of
    prime numbers.
Write a Comment
User Comments (0)
About PowerShow.com