You are on page 1of 28

# Induction Prooí

0ord0ring
A set S is well ordered iI every subset has a least element.
1| is not well ordered since (1| has no least element.
Examples:
is well ordered (under the A relation).
Any coutably inIinite set can be well ordered.
The least element in a subset is determined by a biiection (list)
which exists Irom to the countably inIinite set.
can be well ordered but it is not well ordered under the
A relation.
has no smallest element.
The set oI Iinite strings over an alphabet using
lexicographic ordering is well ordered.
,th02,tic, Induction
et P(x) be a predicate over a well ordered set S.
In the case that S ÷ the natural numbers the
principle has the Iollowing Iorm.
P()
P(n) F P(n ¹1)
(x P(x)
The hypotheses are

1
: P() (Basis Step)

: P(n) F P(n ¹1) Ior n arbitrary. (Induction Step)
ow It orks
irst prove that the predicate is true Ior the smallest
element oI the set S ( iI S ÷ N).
Then show iI it is true Ior an element (n iI S÷N) 2508
it is true Ior the 'next¨ element in the set (n ¹ 1 iI S÷N).
Meaning
nowing it is true Ior the Iirst element means it must be
true Ior the element Iollowing the Iirst or the second
element
nowing it is true Ior the second element implies it is
true Ior the third and so Iorth.
ThereIore induction is equivalent to 2odus ponens
applied an countable number oI times!!
utin0 oí Induction Prooí
State what P(n) is.
asis:
Prove that P() is true.
Induction hypothesis:
Assume that P(n) is true Ior an arbitrary n.
Induction step:
Prove that P(n¹1) is true using P(n). (Usually direct
prooI)
,250
Prove:%
n
i ÷ n(n ¹1)/

In logical notation we wish to show
n %
n
i ÷ n(n ¹1)/ |

ence P(n) is %
n
i| ÷ n(n ¹1)/

,88
Prove 1: P(0). ÷( ¹1)/
Induct4n Hyp4the8e8
Assume P(n) is true Ior n arbitrary.
Now use this and anything else you know to establish that P(n¹1)
must be true.
,250
Induct4n 8tep rite down the assertion P (n¹1)
P(n ¹ 1) is the assertion %
n¹1
i ÷ (n¹1)((n ¹1)¹1)/

%
n¹1
i ÷ %
n
i ¹n¹1
i÷ i÷
÷ n(n ¹1)/ ¹ n¹1 (Irom induction hypothesis)
÷ (n(n ¹1) ¹ (n¹1) )/
÷ (n¹1)(n¹)/
÷ (n¹1)((n ¹1)¹1)/
Q.E.D.
or0 G0n0r, Ru0
Suppose we wish to prove Ior some speciIic
integer x xK FP(x)|
Now we merely change the basis step to P() and
continue.
,250
Prove 3n ¹ 5 is in O(n

).
Definition. f(n) is in O(g(n)) iI there are constants c~
and such that f(n)Accg(n) Ior n K .
Proof.
e must Iind C and such that 3n ¹ 5 A Cn

Ior n K (or
n ~ -1).
II we try C ÷ 1 then the assertion is not true until k ÷ 5.
ence we prove by induction that 3n ¹ 5 A n

Ior all n K 5.
The assertion becomes nn K 5F 3n ¹ 5 A n

|
and the predicate P(n) is 3n ¹ 5 A n

.
,250
,88 8tep
P(5): 3L5 ¹ 5 ÷ A(5)

.
Induct4n hyp4the88
Assume P(n): 3n 5 An

is true Ior arbitrary n.
Induct4n 8tep Prove P(n¹1): 3(n 1)5 A(n 1)

rom 3n 5 An

we have (3n 5) 3 An

¹3.
Now we must show that n

¹ 3 A(n ¹ 1)

÷ n

¹ n ¹ 1
which is true iII 3 An ¹ 1
which is true iII n K1.
ut we have already restricted n K5 so n K1 must hold.
That is nn K5F3n 5 An

| i.e. 3n ¹ 5 is in O(n

).
Q.E.D.
oub0 Ou,iíi0r
In doubly quantiIied assertions oI the Iorm
2nP(2n)|
we oIten assume m (or n ) is arbitrary to
eliminate a quantiIier and prove the remaining
result using induction.
\$trong Induction
1: P()
: P() P(1) ... P(n) F P(n ¹1)
(xP(x)
The two rules are equivalent but sometimes the
second is easier to apply.
,250
or any integer n~1 n can be written as a product oI
primes.
Proof.
et P(n) be the predicate n can be written as a product oI
primes.
,88
P(): can be written as a product oI which is a prime.
Induct4n hyp4the88
or any integer An can be written as a product oI
primes.
,250
Induct4n 8tep
Prove n¹1 can be written as a product oI primes.
II n¹1 is a prime then it can be written as a product oI
itselI only (by deI. oI primes).
II n¹1 is not a prime then there exist integers p and q
such that pcq÷n¹1 (by deI. oI primes) and p and q are
less than n¹1.
Since p and q are less than n¹1 p and q can be written
as products oI primes (by induction hypothesis).
Thus n¹1 can be written as a product oI primes that
make p and q. Q.E.D.
R0cursi·0 or Inducti·0 0íinitions
Basis step
or sets
State the basic building blocks (s) oI the set.
or Iunctions
State the values oI the Iunction on the s.
Inductive or recursive step.
or sets
Show how to build new things Irom old with some
construction rules.
or Iunctions
Show how to compute the value oI a Iunction on the new
things that can be built knowing the value on the old things.
R0cursi·0 or Inducti·0 0íinitions
xtre2al clause.
or sets
II you cant build it with a Iinite number oI applications oI steps . and
. then it isnt in the set.
or Iunctions
A Iunction deIined on a recursively deIined set does not require an
extremal clause.
OIten omitted.
To prove something is in the set you must show how to
construct it with a Iinite number oI applications oI the
basis and inductive steps.
To prove something is not in the set is oIten more
diIIicult.
,250
A recursive deIinition oI
Basis.
is in is the ).
Induction.
iI n is in then so is n ¹ (how to build new obiects
Irom old: 'add one to an old obiect to get a new
one¨).
xtre2al clause.
II you cant construct it with a Iinite numberoI
applications oI the basis and induction it is not in
,250
iven the recursive deIinition oI N we can give
recursive deIinitions oI Iunctions on N:
f()÷1
The initial condition or the value oI the Iunction on the s.
fn¹1)÷(n¹1)cf(n)
The recurrence equation how to deIine f on the new obiects
based on its value on old obiects.
f is the factorial functionf(n) ÷ n!
Note how it Iollows the recursive deIinition oI N.
ProoI oI assertions about inductively deIined obiects
usually involves a prooI by induction.
Prooí guid0in0
Prove the assertion is true Ior the s in the
basis step.
Prove that iI the assertion is true Ior the old
obiects it must be true Ior the new obiects you
can build Irom the old obiects.
Conclude the assertion must be true Ior all
obiects.
,250
e deIine a
n
inductively where n is in N.
asis: a
0
÷ 1
Induction: a
(n¹1)
÷ a
n
ca
%he47em 2 n a
2
a
n
a
2n
(
ProoI:
Since the powers oI a have been deIined inductively we
must use a prooI by induction somewhere. et rid oI the
Iirst quantiIier on 2 by Universal Instantiation:
Assume 2 is arbitrary.
Now prove by induction the remaining quantiIied
assertion
n a
2
a
n
a
2n
(
,250
,88 8tepShow it holds Ior n÷.
The leIt side becomes a
2
a
0
a
2
(1)a
2
The right side
becomes a
2¹0
a
2

ence the two sides are equal to the same value.
Induct4n hyp4the88
Assume the assertion is true Ior na
2
a
n
a
2n

Induct4n 8tep Now show it is true Ior n¹1
(a
2
a
n¹1
a
2n¹1
)
a
2
a
n¹1
÷a
2
a
n
a (by inductive step in the deIinition oI
a
n
)
a
2
a
n¹1
÷ a
2
a
n
a (by associativity oI multiplication)
a
2
a
n¹1
÷ a
2n
a (by the induction hypothesis)
a
2
a
n¹1
÷ a
2n¹1
(by inductive step in the deIinition oI
Root0d 1r00s
The set oI rooted trees where a rooted tree consists oI a set oI
vertices containing a distinguished vertex called the root and
edges connecting these vertices can be deIined recursively as
Iollows:
asis step:
A single vertex r is a rooted tree.
Recursive step:
II T
1
T

. T
n
are rooted trees with roots r
1
r

. r
n

espectively the graph Iorm by starting with a root r which is not
in any oI T
1
T

. T
n
and adding an edge Irom r to r
1
r

. r
n
is also a rooted tree.
t0nd0d Bin,rv 1r00s
The set oI extended binarv trees can be deIined recursively as
Iollows:
asis step:
The empty set is an extended binary tree.
Recursive step:
II T
1
and T
2
are extended binary trees there is an extended binary
tree denoted by T
1
cT
2
consisting oI a root r together with edges
connecting the root to the root oI the leIt subtree T
1
and the right
subtree T
2
when these trees are not empty.
u Bin,rv 1r00s
The set oI full binarv trees can be deIined recursively as Iollows:
asis step:
A single vertex r is a Iull binary tree.
Recursive step:
II T
1
and T
2
are Iull binary trees there is an Iull binary tree
denoted by T
1
cT
2
consisting oI a root r together with edges
connecting the root to the root oI the leIt subtree T
1
and the right
subtree T
2
.
0ight oí 1r00s
The eigt oI a Iull binary tree T denoted by (T) can be deIined
as Iollows:
asis step:
The height oI a Iull binary tree T consisting oI a single vertex r is
(T)÷.
Recursive step:
II T
1
and T
2
are Iull binary trees the height oI a Iull binary tree T
÷ T
1
cT
2
is (T)÷1¹max((T
1
) (T
2
)).

u2b0r oí od0s in , u Bin,rv 1r00
Theorem: II T is a Iull binary tree the number oI nodes in T. denoted
by n(T) is not more than
(T)¹1
-1.
ProoI:
asis step:
or a Iull binary tree T oI height T is consisted oI one vertex.
Then n(T)÷1 and
(T)¹1
-1 ÷
0¹1
-1÷1. Thus n(T)A
(T)¹1
-1.
Induction hypothesis:
Assume n(T)A
(T)¹1
-1 Ior any Iull binary tree T oI the height less
than .
Induction step:
II T
1
and T
2
are Iull binary trees oI the height less than the
number oI nodes in a Iull binary tree T ÷ T
1
cT
2
is 1¹n(T
1
)¹n(T
2
).
u2b0r oí od0s in , u Bin,rv 1r00
n(T) ÷ 1¹n(T
1
)¹n(T
2
) (Irom the construction oI T)
A 1 ¹ (
(T
1
)¹1
-1) ¹ (
(T
2
)¹1
-1) (Irom induction hypothesis)
1 ¹ (
(T
1
)¹1
-1) ¹ (
(T
2
)¹1
-1) ÷
(T
1
)¹1
¹
(T
2
)¹1
-1
A cmax(
(T
1
)¹1

(T
2
)¹1
) -1
cmax(
(T
1
)¹1

(T
2
)¹1
) -1 ÷ c(
max((T
1
)¹1. (T
2
))¹1
) -1
÷ c
(T)
-1
÷
(T)¹1
-1
That is n(T) A
(T)¹1
-1.
Q.E.D.

0
47/073 
809\$8047/070/10;078:-809,8,0,89002039 
(8349047/070/83.0 (,8340,89002039 

,2508  8047/070/ :3/0790A 70,943 3.4:9,-31390809.,3-0047/070/ 
%00,890020393,8:-8098/0907230/-,-0.943 89  .08981742 9490.4:39,-31390809 

.,3-0047/070/-:998349047/070/:3/0790 A 70,943 
,83482,089002039

%0809411390897384;07,3,5,-09:83 0.47,5.47/0738047/070/

902.809..88\$905 3/:.943\$905 .7-97.047/070/809\$ 390.9:7.904.50.3/:..7  .89014431472 ! ! 3 F ! 3  (!  %05490808.07.9\$  903.3:2-078 90 573.570/.9.70 !  ! 3 F ! 3  1473 ...943 09!  -0.

33 3439897:014790178900203920.943806:..990570/.3002039 3 1\$ 2508 9897:014790 309 002039390809 3 1\$ 0..49478 789 574.3/841479 %0701470 3/:.3892:89-0 97:0147900020391443901789479080.-03:2-07419208 .4:39.90897:01479082.0399424/:8543038 .09.3.43/002039250898 97:01479097/.550/.089 0020394190809\$ 1\$ %03 8419897:0147.43/ 002039 3439897:01479080.

9! 897:0 3/:.9! 3  897:0 :83! 3  &8:.3.90.09.9! 3 8 .09. /70.943!7441 \$9.88 !74.943549088 88:209.9 57441 .9! 3 897:0 147.73 3/:.7-97.:930413/:.9438905 !74.

250 !74..0%  3 3  .

  3 34.943089484 3 3%   3 3  .349..

0 ! 3 8% ( 3 3  .(  03.

  3 .0!     .88 !74.

7 4:8098. 3/:.9! 3  2:89-097:0 .3/.7-97.3930804:3494089.-89.9435490808 88:20! 3 897:01473 .

8807943! 3  ! 3  890.8807943% 3   3  3   .250 3/:..9438905790/4390.

  % 3    %  3  3 1742 3/:.943 549088  3 3  .

 3   3 3    3   .

  3  3  .

  3  3   .

 "   .

3/ .88890594!  . 39007 KF!  ( 402070..3090-.4700307.01478420850.4393:0 .1.#:0 \$:554800894574.

4389.0-3/:.8807943-0.00574.3 K  %0.  .c 3 1473 K  !7441 02:8913/ .3/ 8:..8807943834997:0:39 03.398.90! 3 83 A 3 .70.91 3 A.250 !74.3/90570/..93 A 3 1473 K  47 3   1097  90390.9.9439.9.93 A 3 147.3/ 8:.03 83 3 013943 1 3 83  3 19070.420833K F 3 A 3 ( .

250 .7-97.0 3   A3  402:89849./70897.73 3/:.0 ! 3   3  A 3   7423 A3 0.0..93 A 3   3 3  .897:011A3  .70..943549088 88:20! 3 3 A3 897:0147.888905 !  L  A   3/:..9438905 !74.98 33KF3 A3 (  0 3 83 3  "   .897:0113 K :90.90/3K843K2:894/ %.

39107.3/574.4:-0":.33 708:9:833/:.794 023.8807943841901472 23! 2 3 ( 041903.6:.107 3/4:-6:.943 .090702.7-97.90.88:202 473 8.3910/.

43/80.039-:98420920890 80.55  .80794..\$97433/:.7006:.943 ! !  !    ! 3 F ! 3  (!  %0947:08.

574/:.250 47.943549088 47.3-079903.3-079903..574/:.3-079903.574/:.88 !  .941 57208 .903 ..8.5720 3/:.8.941 .3-079903.3390073 3.941 57208 !7441 09! 3 -090570/.574/:...941 57208 ..8..8.339007A3  .8.

.574/:..941 980143 -/01 4157208 13 8349.3/6 ..3/5 .3/6 8:..250 3/:.3/6 .33  \$3.700889.33  5 .9438905 !74.3-079903 .9.8.3-079903.574/:.70 0889.984157208 -3/:.95c63  -/01 4157208 .5720 9039.943549088 %:8 3 .574/:.3/6 .3/6 "   .8574/:.8.8.3-079903.941572089.05 .05 .5720 90390700893900785 .9 2.94157208 13 8..03 .3-079903.

:041.08905 478098 \$4494-:/3093817424/98420 .00139438 .9438 \$9.:78.9434390 8 3/:.943439030 9389.-:/3-4...9090.9..9.#0.9.8  8 4190809 471:3.:0841901:3.04770.8.:043904/938 .3-0-:934390.9090-.425:9090.9438 \$4494..888905 478098 \$9.:78.43897:.1:3.9437:08 471:3.0473/:.

:80 478098 14:.43897:.943/0130/43..3 09702..88.9.13903:2-0741.94384190 -.084209383493908098419032470 /11.:80 190342990/ %4574.3/3/:..9438 1:3.:78.:78.55..089058 %4574.00139438 9702.:9 .0473/:.9.13903:2-0741.0/0130/809/408349706:70.#0.999.94384189058 .70..3/  903983 9390809 471:3.55.3 9-:/99.084209383908094:2:8984494 ...

3 9..943 13 83 9038483  494-:/304-0.30 430 9702.3/3/:.55..:78.99409..999.943 983493 .94384190-..34/4-0.88 83 890 3/:.13903:2-0741 .0/01394341 .//43094.43897:..250 70.98 17424/ .:80 14:.88 .

943 494/01301 4390304-0.98 1 8901.4.9434390 8 1 3   3  c1 3  %070.08.:041901:3.3.:78.:0434/4-0.80/4398.0/01394341 0.947.98 -.250 ..039070....0 70.3..43/9434790.88079438.98 :8:.:78.0/0139438411:3.006:.943 .0/0130/4-0.9431 3 3 4904914489070.1:3.9.:7703.0/01394341 !744141.-4:93/:.57441-3/:.943843 1  %039.:78..

3-:/1742904/4-0.888905 !74.:/090.9892:89-097:014790304-0.090.98 43.8807943897:0147904/ 4-0. 4-0.88079432:89-097:0147.98 .8807943897:0147908390 -.09.9190..984: .!7441:/030 !74.

0 -3/:.943 88:2028.3.8807943 3.2.250 0/0130.0 0 2:89:80.9.2 3( !7441 \$3.57441-3/:.389.9.2 3( .  3/:..943 90702.7  4574.3910/ .943 .. 3  .078.88 ..0-003/0130/3/:.39.0905407841.00703 83 .9438420070 097/4190 17896:.2.33/:.336:.3.3c.7-97.39107432-&3. %0470223.

2.3 .4208.8807943897:01473..2 3  .3 .9412:95.7006:.888905\$494/81473 %00198/0-0.3.9.3 .08905390/01394341 .94389054849897:01473  .3 .9.20.2.3.943549088  .:0 3/:.2  .9.2.250 .884.3 .2.  -3/:.2 3 3/:.3  .2  03.08905390/01394341 .2 .2 3  -3/:.2. - 903/:.4208.3 .2.94908..0 90948/08.2.2 ..2 3.2.943549088 88:2090.943 . -. .2 %0798/0 -0..

439.08 .74497 .51472-89.#4490/%7008 %080941 74490/97008 070.888905 830.30/017427 947 7  73 8.8349 3.079.0790..8 1448 .3/..079.3-0/0130/70.74490/9700 .08.7939.07907 8.0/907449 .:78.:78.9.84.939080.//3.341% %  %3 .74490/9700 #0./893:80/.08905 1% %  %3 .80941 .0 907.74490/9700.0.4330.43889841.7074490/970089744987 7  73  0850.33.3/ 0/08.

939074499490744941900198:-9700% .4330.:78.30903/0/-3.30903/0/-3.:78.797008 .3/% .703490259 .7%7008 %0809410903/0/-3..43889341.3/9079 8:-9700% 03908097008.8 1448 .0.3-0/0130/70.7 9700 /03490/-%c% .797008 90708.79700 #0.888905 %002598098.74497 94090790/08 .903/0/3.08905 1% .700903/0/-3.

.4330.1:-3.08905 1% .888905 830.939074499490744941900198:-9700% .43889341.797008 90708.797008 .81448 .:78.79700 #0.3/% .3-0/0130/70.07907 8.7%7008 %0809411:-3.701:-3.3/9079 8:-9700% .:3.79700  /03490/-%c% .0.:78.31:-3.74497 94090790/08 .

1:-3.1:-3.830.797008 900941.701:-3.81448 .79700% /03490/- % .3-0/0130/ .  %  %   .07907 8  %  #0..79700% .43889341.08905 1% .:78.1:-3.3/% .888905 %00941.79700% %c% 8 %  2.0941%7008 %009 41.

3 3/:.7%700 %047021% 8.3/ %     %:8 3 % A  %   3/:.9438905 1% .943549088 88:203 % A  %  147.79700 903:2-074134/083% /03490/ -3 % 834924709.3 90 3:2-074134/083.1:-3.3/% .79700% 4109 % 8.0790  %03 3 %  .888905 47.79700%419009088 9.7970084190090889.:3.1:-3.438890/41430.3 %   !7441 .79700% %c% 8 3 % 3 % .31:-3.:2-07414/083.701:-3.1:-3.

98 3 % A  %   "   .  %   % c2.43897:.:3.  %      %    c 2.  % c %   %     %    %.:2-07414/083.943549088    %      %     %   %   A c2.94341% A    %      %   17423/:.7%700 3%   3 % 3 % 174290.