Docsity

Induction, Lecture Notes - Computer Science, Study notes of Discrete Structures and Graph Theory

Partial preview of the text

Download Induction, Lecture Notes - Computer Science and more Study notes Discrete Structures and Graph Theory in PDF only on Docsity!

Induction

Zeph Grunschlag

Agenda

Mathematical Induction Proofs

Well Ordering Principle

Simple Induction

Strong Induction (Second Principle of

Induction)

Program Correctness

 Correctness of iterative Fibonacci program

So sequence of propositions is a

sequence of dominos.

… P (0) P (1) P (2) P (n) P (n+1)

When the domino falls, the corresponding

proposition is considered true:

P (n)

Suppose that the dominos satisfy two

constraints.

  1. Well-positioned: If any domino falls

(to right), next domino (to right) must

fall also.

  1. First domino has fallen to right P (0) true P (n) P (n+1)

Suppose that the dominos satisfy two

constraints.

  1. Well-positioned: If any domino falls

to right, the next domino to right must

fall also.

  1. First domino has fallen to right P (0) true P (n) P (n+1)

Then can conclude that all the dominos

fall!

… P (0) P (1) P (2) P (n) P (n+1)

Then can conclude that all the dominos

fall!

… P (0) P (1) P (2) P (n) P (n+1)

Then can conclude that all the dominos

fall!

P (0) …

true

P (1)

true P (2) P (n) P (n+1)

Then can conclude that all the dominos

fall!

P (2)

true

P (0) …

true

P (1)

true P (n) P (n+1)

Then can conclude that all the dominos

fall!

P (2)

true

P (0) …

true

P (1)

true P (n) true P (n+1)

Then can conclude that all the dominos

fall!

P (2)

true

P (0) …

true

P (1)

true P (n) true P (n+1) true

Example

EG: Prove  n  0 P(n) where P(n) = “The sum of the first n positive odd numbers is the n th

perfect square.”

n i

i n

1 2

Example.

Geometric interpretation. To get next

square, need to add next odd number: