Induction and Recursion. - PowerPoint PPT Presentation

About This Presentation
Title:

Induction and Recursion.

Description:

(x, z) Rk implies (x, z) T , because Rk T by IH. ... By IH any postage greater or equal then 12c and less or equal k ... 2) IH : Assume that for all n=5, ...k, ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 18
Provided by: ValuedGate992
Learn more at: http://www.cs.ucf.edu
Category:

less

Transcript and Presenter's Notes

Title: Induction and Recursion.


1
Induction and Recursion.
Recursive definition
Explicit definition
  • Factorial
  • Geometric progression
  • Power of relation on a set

2
  • The recursive definition of a function makes
    reference
  • to earlier versions of itself.
  • The main connection between recursion and
    induction is that
  • objects are defined by means of a natural
    sequence.
  • Induction is usually the best (possibly the
    only) way
  • to prove results about recursively defined
    objects.

3
How to find a closed form for a recursively
defined function?
In general there is no ready to use recipe.
Some simple cases are
  • Linear function of integer n g1(n) anb

g1(n1) a(n1)b g1(n) a
  • Quadratic function of integer n g2(n) an2bnc

g2(n1) a(n1)2b(n1)c g2(n) 2an(ab)
4
Example. Prove that for all positive integers m
and n,
Proof. Let m be arbitrary positive integer and
then prove by induction on n?1. 1) Basis. n1
(by recursive definition of
Rm1)
2) IH Assume that for some k ?1 we have
IS We need to prove that
5
Transitive closures again.
Theorem. The transitive closure of R is
ii) assume (x, y) ?S and (y, z ) ?S to prove
that (x, z) ?S.
(x, y) ?S implies that (x, y) ?Rn , n is some
integer, n?Z.
(y, z ) ?S implies that (y, z ) ?Rm, m is some
integer , n?Z.
(x, z) ?Rno Rm Rnm, by the previous Theorem.
(x, z) ?S , since Rnm?S
6
iii) Suppose T is any relation, satisfying
i) R?T and ii) T is transitive. and prove that S
? T .
1) Basis when n1, R1R?T by assumption.
2) IH Assume that for nk, where k is some
integer, k ?1, Rk ?T .
IS Need to prove Rk1 ?T
Suppose (x, y) ?Rk1Rko R (by definition of
composition). It implies that there exists some z
?A, that (x, z)?Rk and (z, y)?R. . (x, z)?Rk
implies (x, z)?T , because Rk ?T by IH. (z, y)?R
implies (z, y)?T , because R?T by
assumption. (x, z)?T and (z, y)?T imply (x, y)?T
by transitive property of T.
We proved by induction that for any n ?1, Rn ?
T.
7
Fibonacci Numbers
The sequence named for Fibonacci (1202) is
introduced in terms of rabbits. Suppose
that every month a breeding pair of rabbits
produce a pair of offspring. The offspring in
turn start breeding two months later, and so on.
Denote Fn the number of pairs in month n.
Suppose you buy a pair of rabbits in month 1
(F00, F11) then you still have one pair in
month 2 (F21), but in month 3 they start
breeding, F32. The sequence begins 0, 1, 1, 2,
3, 5, 8, 13, 21, You can observe, that in a
month n you have all pairs from the previous
month (n?1), plus offspring pairs for all pairs
from month (n?2), i. e.
8
So, Fibonacci numbers can be defined recursively
These numbers have numerous applications in CS,
mathematics, theory of games.
Proof by induction on n ? 0.
9
(No Transcript)
10
  • Sometimes we need stronger assumption to prove
    IS.
  • It happens when to prove IS for (n 1) you need
    to refer not only
  • to the previous n , but to smaller numbers.

Strong Induction Principle Let A?N denote a
subset that satisfies the following two
properties 1) 0?A 2) if 0, 1, k?A, then
k1?A. Then AN.
So, Strong Induction differs from Induction
Principle in step 2)
11
Example. Prove that every amount of postage of 12
cents or more can be formed using only 4 cent and
5 cent stamps.
We are going to prove by induction on n ? 12,
that any postage n 5i 4j, where integers i,
j ?0.
We can infer n1 5i 4j either from (n1)?5
5(i ?1) 4j or from (n1)?4 5i 4(j ?1)
We need to prove an extended basis here, that is
to prove the basis on more then one point.
12
Proof. 1) Basis (extended) check that we can
form postage of 12, 13, 14, and 15 cents using
only 4c and 5c stamps.
124?3 135 4?2 145?24 155?3.
2) IH Assume that any postage 12, k, where k
?15 can be made using 4c and 5c stamps (strong
induction)
IS Prove that conjecture is true for the postage
k 1.
By IH any postage greater or equal then 12c and
less or equal k can be formed using 4c and 5c
stamps. In particular it is true for k ?3.
Together with one more 4c stamp it gives k 1
postage.
13
Theorem. The following three principles are
equivalent (a) the Induction Principle (b)
the Strong Induction Principle and (c) the
Well-Ordering principle. Proof. It suffices to
prove (a)?(b), (b)?(c), and (c)?(a).
14
Proof of (a)?(b) Let A?N and A satisfies the two
properties (1) 0?A and (2) if 0, 1, k?A
then k1?A. We need to prove AN. To make use
of Induction Principle we define the auxiliary
set Cm m?N and 0, 1, m?A. Thus, C ? A ? N
(3). Since 0?A by (1), 0?C by the definition of
C. If k?C, that is, 0, 1, k?A, then by the
property (2) of the set A, k1?A, which implies
that k1?C, because 0, 1, k, k1?A. Thus, set C
satisfies the properties of the Induction
Principle, so CN. Therefore AN because of (3).
15
Proof of (b)?(c) Assume B?N and B?? (4).
Suppose the Well-Ordering Principle is false,
i.e. suppose B does not have the smallest
element (5). Prove that this leads to
contradiction to the Strong Induction Principle.
Let AN?B (6). By (5) 0?B, thus 0?A by (6). If
the numbers 0, 1, k?A, then these numbers do not
belong to B. Then k1 does not belong to B,
because otherwise it would be the smallest
element of B contradicting to (5). Thus, k1?A
and by the Strong Induction Principle AN, which
implies that B ? by (6), contradicting to (4).
So, (c) is proved.
16
(No Transcript)
17
Proof by induction on n ?5 that Fn1gt(3/2)n
1) Basis (extended) n5 F68gt(3/2)5
7.59375 n6 F7 13gt(3/2)6 11.390625
2) IH Assume that for all n5, k, where k is
some integer k ?6 we have Fn1gt(3/2)n (strong
induction).
IS We need to prove inequality Fn1gt(3/2)n for
n k 1, i. e. Fk2gt(3/2)k1
Write a Comment
User Comments (0)
About PowerShow.com