Docsity

Induction and Recursion in Discrete Structures - Prof. G. Baumgartner, Study notes of Programming Languages

Partial preview of the text

Download Induction and Recursion in Discrete Structures - Prof. G. Baumgartner and more Study notes Programming Languages in PDF only on Docsity!

Induction and Recursion

CSC-2259 Discrete Structures

Induction

Induction is a very useful proof technique

In computer science, induction is used

to prove properties of algorithms

Induction and recursion are closely related

  • Recursion is a description method for algorithms
  • Induction is a proof method suitable

for recursive algorithms

Inductive Step: Prove that P (^ k ^1 ) is true

Inductive Hypothesis:Assume P ( k ) is true

P ( k )  P ( k  1 )

In other words in inductive step we prove:

(for any positive integer k)

for every positive integer k

P ( k )  P ( k  1 ) P ( 1 )

True

True

P ( 1 )  P ( 2 )  P ( 3 )  P ( 4 )  

Inductive basis Inductive Step

Proposition true for all positive integers

7

n n P nn Inductive Basis: 2 1 ( 1 1 ) ( 1 ): 1  P  Inductive Hypothesis: 2 ( 1 ) ( ): 1 2     k k P kk Inductive Step: K. Busch - LSU Theorem: Proof: 2 ( 1 )(( 1 ) 1 ) ( 1 ): 1 2 ( 1 )          k k P kk k We will prove assume that it holds

2

( 1 )(( 1 ) 1 )

2

( 1 ) 2 ( 1 )

( 1 )

2

( 1 )

( 1 ): 1 2 ( 1 )

  

  

 

    

k k

k k k

k

k k

P kk k

Inductive Step:

(inductive

hypothesis)

End of Proof

Theorem:

2

n

H

n

Proof:

n  0

Inductive Basis:

1 2 2

0

n

H H H

n

n  0

Inductive Hypothesis: n^  k

2

k

H

k Suppose it holds:  

Inductive Step: nk ^1

1

2

k

H

k We will show:

Theorem: (^) H n n

2

Proof:

n  0

Inductive Basis:

H H H n n

1 2 2

0

n  0

Inductive Hypothesis: n^  k

H k k

2

Suppose it holds:

Inductive Step: nk ^1

1 2

H k k

We will show:

H n

n

n

2

We have shown:

It holds that:     k k

H H H k

log log

2 2

 

H k

k

k

1 log

log

H (log k ) k

hole

hole

hole

2 2

3 3

Triominos

Inductive Hypothesis: n^  k

k k

Hole can be anywhere

Assume that a checkerboard

can be tiled with the hole anywhere

k k

Inductive Step: nk ^1

1 1

 

k k