Mathematical Induction - West Virginia...

116
Outline Mathematical Induction K. Subramani 1 1 Lane Department of Computer Science and Electrical Engineering West Virginia University 11 January, 2011 Subramani Proofs and Recursion

Transcript of Mathematical Induction - West Virginia...

Page 1: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

Outline

Mathematical Induction

K. Subramani1

1Lane Department of Computer Science and Electrical EngineeringWest Virginia University

11 January, 2011

Subramani Proofs and Recursion

Page 2: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

Outline

Outline

1 First Principle of Induction

Subramani Proofs and Recursion

Page 3: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

Outline

Outline

1 First Principle of Induction

2 Second Principle of Induction

Subramani Proofs and Recursion

Page 4: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction

Motivation

Reaching arbitrary rungs of a ladder.

Subramani Proofs and Recursion

Page 5: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction

Motivation

Reaching arbitrary rungs of a ladder.

Note

Can only be applied to a well-ordered domain, where the concept of “next” isunambiguous, e.g., positive integers.

Subramani Proofs and Recursion

Page 6: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction

Motivation

Reaching arbitrary rungs of a ladder.

Note

Can only be applied to a well-ordered domain, where the concept of “next” isunambiguous, e.g., positive integers.

Principle

Assume that the domain is the set of positive integers.

Subramani Proofs and Recursion

Page 7: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction

Motivation

Reaching arbitrary rungs of a ladder.

Note

Can only be applied to a well-ordered domain, where the concept of “next” isunambiguous, e.g., positive integers.

Principle

Assume that the domain is the set of positive integers.

1 P(1) is true.

Subramani Proofs and Recursion

Page 8: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction

Motivation

Reaching arbitrary rungs of a ladder.

Note

Can only be applied to a well-ordered domain, where the concept of “next” isunambiguous, e.g., positive integers.

Principle

Assume that the domain is the set of positive integers.

1 P(1) is true.2 (∀k)[P(k) → P(k + 1)]

Subramani Proofs and Recursion

Page 9: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction

Motivation

Reaching arbitrary rungs of a ladder.

Note

Can only be applied to a well-ordered domain, where the concept of “next” isunambiguous, e.g., positive integers.

Principle

Assume that the domain is the set of positive integers.

1 P(1) is true.2 (∀k)[P(k) → P(k + 1)]

P(n) is true, for all positiveintegers n.

Subramani Proofs and Recursion

Page 10: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction

Motivation

Reaching arbitrary rungs of a ladder.

Note

Can only be applied to a well-ordered domain, where the concept of “next” isunambiguous, e.g., positive integers.

Principle

Assume that the domain is the set of positive integers.

1 P(1) is true.2 (∀k)[P(k) → P(k + 1)]

P(n) is true, for all positiveintegers n.

Note

(i) Showing that P(1) is true is called the basis step.

Subramani Proofs and Recursion

Page 11: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction

Motivation

Reaching arbitrary rungs of a ladder.

Note

Can only be applied to a well-ordered domain, where the concept of “next” isunambiguous, e.g., positive integers.

Principle

Assume that the domain is the set of positive integers.

1 P(1) is true.2 (∀k)[P(k) → P(k + 1)]

P(n) is true, for all positiveintegers n.

Note

(i) Showing that P(1) is true is called the basis step.

(ii) Assuming that P(k) is true, in order to show that P(k + 1) is true is called theinductive hypothesis.

Subramani Proofs and Recursion

Page 12: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 .

Subramani Proofs and Recursion

Page 13: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Subramani Proofs and Recursion

Page 14: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Subramani Proofs and Recursion

Page 15: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i

Subramani Proofs and Recursion

Page 16: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i

= 1

Subramani Proofs and Recursion

Page 17: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i

= 1

RHS =1 · (1 + 1)

2

Subramani Proofs and Recursion

Page 18: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i

= 1

RHS =1 · (1 + 1)

2

=1 · (2)

2

Subramani Proofs and Recursion

Page 19: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i

= 1

RHS =1 · (1 + 1)

2

=1 · (2)

2

=2

2

Subramani Proofs and Recursion

Page 20: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i

= 1

RHS =1 · (1 + 1)

2

=1 · (2)

2

=2

2

= 1

Subramani Proofs and Recursion

Page 21: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction (contd.)

Example

Show that the sum of the first n integers is n·(n+1)2 . Formally,

Pni=1 i = n·(n+1)

2 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i

= 1

RHS =1 · (1 + 1)

2

=1 · (2)

2

=2

2

= 1

Thus, LHS = RHS and P(1) is true.

Subramani Proofs and Recursion

Page 22: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

Subramani Proofs and Recursion

Page 23: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true,

Subramani Proofs and Recursion

Page 24: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

Subramani Proofs and Recursion

Page 25: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

Subramani Proofs and Recursion

Page 26: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

= 1 + 2 + 3 + . . . + k + (k + 1)

Subramani Proofs and Recursion

Page 27: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

= 1 + 2 + 3 + . . . + k + (k + 1)

= (1 + 2 + 3 + . . . + k) + (k + 1)

Subramani Proofs and Recursion

Page 28: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

= 1 + 2 + 3 + . . . + k + (k + 1)

= (1 + 2 + 3 + . . . + k) + (k + 1)

=k · (k + 1)

2+ (k + 1), using the inductive hypothesis

Subramani Proofs and Recursion

Page 29: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

= 1 + 2 + 3 + . . . + k + (k + 1)

= (1 + 2 + 3 + . . . + k) + (k + 1)

=k · (k + 1)

2+ (k + 1), using the inductive hypothesis

=k + 1

2(k + 2)

Subramani Proofs and Recursion

Page 30: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

= 1 + 2 + 3 + . . . + k + (k + 1)

= (1 + 2 + 3 + . . . + k) + (k + 1)

=k · (k + 1)

2+ (k + 1), using the inductive hypothesis

=k + 1

2(k + 2)

=(k + 1) · (k + 2)

2

Subramani Proofs and Recursion

Page 31: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

= 1 + 2 + 3 + . . . + k + (k + 1)

= (1 + 2 + 3 + . . . + k) + (k + 1)

=k · (k + 1)

2+ (k + 1), using the inductive hypothesis

=k + 1

2(k + 2)

=(k + 1) · (k + 2)

2

= RHS.

Subramani Proofs and Recursion

Page 32: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

= 1 + 2 + 3 + . . . + k + (k + 1)

= (1 + 2 + 3 + . . . + k) + (k + 1)

=k · (k + 1)

2+ (k + 1), using the inductive hypothesis

=k + 1

2(k + 2)

=(k + 1) · (k + 2)

2

= RHS.

Since, LHS=RHS, we have shown that P(k) → P(k + 1).

Subramani Proofs and Recursion

Page 33: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i =

k · (k + 1)

2.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i =

(k+1)·(k+2)2 .

LHS =

k+1X

i=1

i

= 1 + 2 + 3 + . . . + k + (k + 1)

= (1 + 2 + 3 + . . . + k) + (k + 1)

=k · (k + 1)

2+ (k + 1), using the inductive hypothesis

=k + 1

2(k + 2)

=(k + 1) · (k + 2)

2

= RHS.

Since, LHS=RHS, we have shown that P(k) → P(k + 1).

Applying the first principle of mathematical induction, we conclude that the conjecture is true.

Subramani Proofs and Recursion

Page 34: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Principles

Main Ideas

Subramani Proofs and Recursion

Page 35: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Principles

Main Ideas

(i) Mathematicize the conjecture.

Subramani Proofs and Recursion

Page 36: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Principles

Main Ideas

(i) Mathematicize the conjecture.

(ii) Prove the basis (usually P(1) and usually easy.)

Subramani Proofs and Recursion

Page 37: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Principles

Main Ideas

(i) Mathematicize the conjecture.

(ii) Prove the basis (usually P(1) and usually easy.)

(iii) Assume P(k).

Subramani Proofs and Recursion

Page 38: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Principles

Main Ideas

(i) Mathematicize the conjecture.

(ii) Prove the basis (usually P(1) and usually easy.)

(iii) Assume P(k).

(iv) Show P(k + 1).

Subramani Proofs and Recursion

Page 39: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Principles

Main Ideas

(i) Mathematicize the conjecture.

(ii) Prove the basis (usually P(1) and usually easy.)

(iii) Assume P(k).

(iv) Show P(k + 1). (The hard part.

Subramani Proofs and Recursion

Page 40: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Principles

Main Ideas

(i) Mathematicize the conjecture.

(ii) Prove the basis (usually P(1) and usually easy.)

(iii) Assume P(k).

(iv) Show P(k + 1). (The hard part. Use mathematical manipulation.)

Subramani Proofs and Recursion

Page 41: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 ,

Subramani Proofs and Recursion

Page 42: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 , i.e., show that

Pni=1 i2 =

n·(n+1)·(2n+1)6 .

Subramani Proofs and Recursion

Page 43: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 , i.e., show that

Pni=1 i2 =

n·(n+1)·(2n+1)6 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i2

Subramani Proofs and Recursion

Page 44: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 , i.e., show that

Pni=1 i2 =

n·(n+1)·(2n+1)6 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i2

= 1

Subramani Proofs and Recursion

Page 45: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 , i.e., show that

Pni=1 i2 =

n·(n+1)·(2n+1)6 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i2

= 1

RHS =1 · (1 + 1) · (2 · 1 + 1)

6

Subramani Proofs and Recursion

Page 46: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 , i.e., show that

Pni=1 i2 =

n·(n+1)·(2n+1)6 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i2

= 1

RHS =1 · (1 + 1) · (2 · 1 + 1)

6

=1 · (2) · (3)

6

Subramani Proofs and Recursion

Page 47: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 , i.e., show that

Pni=1 i2 =

n·(n+1)·(2n+1)6 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i2

= 1

RHS =1 · (1 + 1) · (2 · 1 + 1)

6

=1 · (2) · (3)

6

=6

6

Subramani Proofs and Recursion

Page 48: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 , i.e., show that

Pni=1 i2 =

n·(n+1)·(2n+1)6 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i2

= 1

RHS =1 · (1 + 1) · (2 · 1 + 1)

6

=1 · (2) · (3)

6

=6

6

= 1

Subramani Proofs and Recursion

Page 49: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Another Induction Example

Example

Show that the sum of the squares of the first n integers is n·(n+1)·(2n+1)6 , i.e., show that

Pni=1 i2 =

n·(n+1)·(2n+1)6 .

Proof.

BASIS (P(1)):

LHS =

1X

i=1

i2

= 1

RHS =1 · (1 + 1) · (2 · 1 + 1)

6

=1 · (2) · (3)

6

=6

6

= 1

Thus, LHS = RHS and P(1) is true.

Subramani Proofs and Recursion

Page 50: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

Subramani Proofs and Recursion

Page 51: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true,

Subramani Proofs and Recursion

Page 52: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i2 =

(k+1)·(k+2)·(2·(k+1)+1)6 .

LHS =

k+1X

i=1

i2

Subramani Proofs and Recursion

Page 53: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i2 =

(k+1)·(k+2)·(2·(k+1)+1)6 .

LHS =

k+1X

i=1

i2

= 12+ 22

+ 32+ . . . + k2

+ (k + 1)2

Subramani Proofs and Recursion

Page 54: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i2 =

(k+1)·(k+2)·(2·(k+1)+1)6 .

LHS =

k+1X

i=1

i2

= 12+ 22

+ 32+ . . . + k2

+ (k + 1)2

= (12+ 22

+ 32+ . . . + k2

) + (k + 1)2

Subramani Proofs and Recursion

Page 55: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i2 =

(k+1)·(k+2)·(2·(k+1)+1)6 .

LHS =

k+1X

i=1

i2

= 12+ 22

+ 32+ . . . + k2

+ (k + 1)2

= (12+ 22

+ 32+ . . . + k2

) + (k + 1)2

=k · (k + 1) · (2k + 1)

6+ (k + 1)

2, using the inductive hypothesis

Subramani Proofs and Recursion

Page 56: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i2 =

(k+1)·(k+2)·(2·(k+1)+1)6 .

LHS =

k+1X

i=1

i2

= 12+ 22

+ 32+ . . . + k2

+ (k + 1)2

= (12+ 22

+ 32+ . . . + k2

) + (k + 1)2

=k · (k + 1) · (2k + 1)

6+ (k + 1)

2, using the inductive hypothesis

=k + 1

6(k · (2k + 1) + 6 · (k + 1))

Subramani Proofs and Recursion

Page 57: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i2 =

(k+1)·(k+2)·(2·(k+1)+1)6 .

LHS =

k+1X

i=1

i2

= 12+ 22

+ 32+ . . . + k2

+ (k + 1)2

= (12+ 22

+ 32+ . . . + k2

) + (k + 1)2

=k · (k + 1) · (2k + 1)

6+ (k + 1)

2, using the inductive hypothesis

=k + 1

6(k · (2k + 1) + 6 · (k + 1))

=k + 1

6(2k2

+ k + 6k + 6)

Subramani Proofs and Recursion

Page 58: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i2 =

(k+1)·(k+2)·(2·(k+1)+1)6 .

LHS =

k+1X

i=1

i2

= 12+ 22

+ 32+ . . . + k2

+ (k + 1)2

= (12+ 22

+ 32+ . . . + k2

) + (k + 1)2

=k · (k + 1) · (2k + 1)

6+ (k + 1)

2, using the inductive hypothesis

=k + 1

6(k · (2k + 1) + 6 · (k + 1))

=k + 1

6(2k2

+ k + 6k + 6)

=k + 1

6(2k2

+ 7k + 6)

Subramani Proofs and Recursion

Page 59: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction example (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1i2 =

k · (k + 1) · (2k + 1)

6.

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1i2 =

(k+1)·(k+2)·(2·(k+1)+1)6 .

LHS =

k+1X

i=1

i2

= 12+ 22

+ 32+ . . . + k2

+ (k + 1)2

= (12+ 22

+ 32+ . . . + k2

) + (k + 1)2

=k · (k + 1) · (2k + 1)

6+ (k + 1)

2, using the inductive hypothesis

=k + 1

6(k · (2k + 1) + 6 · (k + 1))

=k + 1

6(2k2

+ k + 6k + 6)

=k + 1

6(2k2

+ 7k + 6)

Subramani Proofs and Recursion

Page 60: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction proof (contd.)

Proof.

=k + 1

6(2k2 + 4k + 3k + 6)

Subramani Proofs and Recursion

Page 61: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction proof (contd.)

Proof.

=k + 1

6(2k2 + 4k + 3k + 6)

=k + 1

6(2k · (k + 2) + 3 · (k + 2))

Subramani Proofs and Recursion

Page 62: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction proof (contd.)

Proof.

=k + 1

6(2k2 + 4k + 3k + 6)

=k + 1

6(2k · (k + 2) + 3 · (k + 2))

=k + 1

6(2k + 3) · (k + 2))

Subramani Proofs and Recursion

Page 63: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction proof (contd.)

Proof.

=k + 1

6(2k2 + 4k + 3k + 6)

=k + 1

6(2k · (k + 2) + 3 · (k + 2))

=k + 1

6(2k + 3) · (k + 2))

=(k + 1) · (k + 2) · (2 · (k + 1) + 1)

6

Subramani Proofs and Recursion

Page 64: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction proof (contd.)

Proof.

=k + 1

6(2k2 + 4k + 3k + 6)

=k + 1

6(2k · (k + 2) + 3 · (k + 2))

=k + 1

6(2k + 3) · (k + 2))

=(k + 1) · (k + 2) · (2 · (k + 1) + 1)

6

= RHS.

Subramani Proofs and Recursion

Page 65: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction proof (contd.)

Proof.

=k + 1

6(2k2 + 4k + 3k + 6)

=k + 1

6(2k · (k + 2) + 3 · (k + 2))

=k + 1

6(2k + 3) · (k + 2))

=(k + 1) · (k + 2) · (2 · (k + 1) + 1)

6

= RHS.

Since, LHS=RHS, we have shown that P(k) → P(k + 1).

Subramani Proofs and Recursion

Page 66: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction proof (contd.)

Proof.

=k + 1

6(2k2 + 4k + 3k + 6)

=k + 1

6(2k · (k + 2) + 3 · (k + 2))

=k + 1

6(2k + 3) · (k + 2))

=(k + 1) · (k + 2) · (2 · (k + 1) + 1)

6

= RHS.

Since, LHS=RHS, we have shown that P(k) → P(k + 1).

Applying the first principle of mathematical induction, we conclude that the conjecture is true.

Subramani Proofs and Recursion

Page 67: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction Example

Example

Show that the sum of the first n odd integers is n2, i.e., show thatPn

i=1(2i − 1) = n2.

Subramani Proofs and Recursion

Page 68: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction Example

Example

Show that the sum of the first n odd integers is n2, i.e., show thatPn

i=1(2i − 1) = n2.

Proof.

BASIS (P(1)):

LHS =

1X

i=1

(2i − 1)

Subramani Proofs and Recursion

Page 69: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction Example

Example

Show that the sum of the first n odd integers is n2, i.e., show thatPn

i=1(2i − 1) = n2.

Proof.

BASIS (P(1)):

LHS =

1X

i=1

(2i − 1)

= 2 · 1 − 1

Subramani Proofs and Recursion

Page 70: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction Example

Example

Show that the sum of the first n odd integers is n2, i.e., show thatPn

i=1(2i − 1) = n2.

Proof.

BASIS (P(1)):

LHS =

1X

i=1

(2i − 1)

= 2 · 1 − 1

= 1

Subramani Proofs and Recursion

Page 71: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction Example

Example

Show that the sum of the first n odd integers is n2, i.e., show thatPn

i=1(2i − 1) = n2.

Proof.

BASIS (P(1)):

LHS =

1X

i=1

(2i − 1)

= 2 · 1 − 1

= 1

RHS = 12

Subramani Proofs and Recursion

Page 72: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction Example

Example

Show that the sum of the first n odd integers is n2, i.e., show thatPn

i=1(2i − 1) = n2.

Proof.

BASIS (P(1)):

LHS =

1X

i=1

(2i − 1)

= 2 · 1 − 1

= 1

RHS = 12

= 1

Subramani Proofs and Recursion

Page 73: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Induction Example

Example

Show that the sum of the first n odd integers is n2, i.e., show thatPn

i=1(2i − 1) = n2.

Proof.

BASIS (P(1)):

LHS =

1X

i=1

(2i − 1)

= 2 · 1 − 1

= 1

RHS = 12

= 1

Thus, LHS = RHS and P(1) is true.

Subramani Proofs and Recursion

Page 74: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

Subramani Proofs and Recursion

Page 75: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true,

Subramani Proofs and Recursion

Page 76: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

Subramani Proofs and Recursion

Page 77: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

Subramani Proofs and Recursion

Page 78: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

= 1 + 3 + 5 + . . . (2k − 1) + (2(k + 1) − 1)

Subramani Proofs and Recursion

Page 79: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

= 1 + 3 + 5 + . . . (2k − 1) + (2(k + 1) − 1)

= (1 + 3 + 5 + . . . (2k − 1)) + (2k + 1)

Subramani Proofs and Recursion

Page 80: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

= 1 + 3 + 5 + . . . (2k − 1) + (2(k + 1) − 1)

= (1 + 3 + 5 + . . . (2k − 1)) + (2k + 1)

= k2+ (2k + 1), using the inductive hypothesis

Subramani Proofs and Recursion

Page 81: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

= 1 + 3 + 5 + . . . (2k − 1) + (2(k + 1) − 1)

= (1 + 3 + 5 + . . . (2k − 1)) + (2k + 1)

= k2+ (2k + 1), using the inductive hypothesis

= (k + 1)2

Subramani Proofs and Recursion

Page 82: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

= 1 + 3 + 5 + . . . (2k − 1) + (2(k + 1) − 1)

= (1 + 3 + 5 + . . . (2k − 1)) + (2k + 1)

= k2+ (2k + 1), using the inductive hypothesis

= (k + 1)2

= RHS

Subramani Proofs and Recursion

Page 83: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

= 1 + 3 + 5 + . . . (2k − 1) + (2(k + 1) − 1)

= (1 + 3 + 5 + . . . (2k − 1)) + (2k + 1)

= k2+ (2k + 1), using the inductive hypothesis

= (k + 1)2

= RHS

Subramani Proofs and Recursion

Page 84: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

= 1 + 3 + 5 + . . . (2k − 1) + (2(k + 1) − 1)

= (1 + 3 + 5 + . . . (2k − 1)) + (2k + 1)

= k2+ (2k + 1), using the inductive hypothesis

= (k + 1)2

= RHS

Since LHS = RHS, we have shown that P(k) → P(k + 1).

Subramani Proofs and Recursion

Page 85: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that

kX

i=1(2i − 1) = k2

We need to show that P(k + 1) is true, i.e., we need to show thatPk+1

i=1(2i − 1) = (k + 1)2.

LHS =

k+1X

i=1

(2i − 1)

= 1 + 3 + 5 + . . . (2k − 1) + (2(k + 1) − 1)

= (1 + 3 + 5 + . . . (2k − 1)) + (2k + 1)

= k2+ (2k + 1), using the inductive hypothesis

= (k + 1)2

= RHS

Since LHS = RHS, we have shown that P(k) → P(k + 1). Applying the first principle of mathematical induction, we conclude that the

conjecture is true.

Subramani Proofs and Recursion

Page 86: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

One Final Example

Example

Show that 7n − 5n is always an even number for n ≥ 0, i.e., show that 2 | (7n − 5n),∀n ≥ 0.

Subramani Proofs and Recursion

Page 87: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

One Final Example

Example

Show that 7n − 5n is always an even number for n ≥ 0, i.e., show that 2 | (7n − 5n),∀n ≥ 0.

Proof.

BASIS (P(0)):

LHS = 70− 50

Subramani Proofs and Recursion

Page 88: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

One Final Example

Example

Show that 7n − 5n is always an even number for n ≥ 0, i.e., show that 2 | (7n − 5n),∀n ≥ 0.

Proof.

BASIS (P(0)):

LHS = 70− 50

= 1 − 1

Subramani Proofs and Recursion

Page 89: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

One Final Example

Example

Show that 7n − 5n is always an even number for n ≥ 0, i.e., show that 2 | (7n − 5n),∀n ≥ 0.

Proof.

BASIS (P(0)):

LHS = 70− 50

= 1 − 1

= 0

Subramani Proofs and Recursion

Page 90: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

One Final Example

Example

Show that 7n − 5n is always an even number for n ≥ 0, i.e., show that 2 | (7n − 5n),∀n ≥ 0.

Proof.

BASIS (P(0)):

LHS = 70− 50

= 1 − 1

= 0

Since the LHS is even, we have proven the basis P(0).

Subramani Proofs and Recursion

Page 91: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k .

Subramani Proofs and Recursion

Page 92: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m.

Subramani Proofs and Recursion

Page 93: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2.

Subramani Proofs and Recursion

Page 94: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

Subramani Proofs and Recursion

Page 95: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

= 7 · (2m + 5k) − 5 · 5k

, using the inductive hypothesis

Subramani Proofs and Recursion

Page 96: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

= 7 · (2m + 5k) − 5 · 5k

, using the inductive hypothesis

= 14m + 7 · 5k− 5 · 5k

Subramani Proofs and Recursion

Page 97: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

= 7 · (2m + 5k) − 5 · 5k

, using the inductive hypothesis

= 14m + 7 · 5k− 5 · 5k

= 14m + 5k· (7 − 5)

Subramani Proofs and Recursion

Page 98: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

= 7 · (2m + 5k) − 5 · 5k

, using the inductive hypothesis

= 14m + 7 · 5k− 5 · 5k

= 14m + 5k· (7 − 5)

= 14m + 2 · 5k

Subramani Proofs and Recursion

Page 99: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

= 7 · (2m + 5k) − 5 · 5k

, using the inductive hypothesis

= 14m + 7 · 5k− 5 · 5k

= 14m + 5k· (7 − 5)

= 14m + 2 · 5k

= 2 · (7m + 5k)

Subramani Proofs and Recursion

Page 100: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

= 7 · (2m + 5k) − 5 · 5k

, using the inductive hypothesis

= 14m + 7 · 5k− 5 · 5k

= 14m + 5k· (7 − 5)

= 14m + 2 · 5k

= 2 · (7m + 5k)

= some even number!

Subramani Proofs and Recursion

Page 101: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

= 7 · (2m + 5k) − 5 · 5k

, using the inductive hypothesis

= 14m + 7 · 5k− 5 · 5k

= 14m + 5k· (7 − 5)

= 14m + 2 · 5k

= 2 · (7m + 5k)

= some even number!

We have thus shown that P(k) → P(k + 1).

Subramani Proofs and Recursion

Page 102: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Proof (contd.)

Proof.

Let us assume that P(k) is true, i.e., assume that (7k− 5k ) is divisible by 2 for some k . It follows that (7k

− 5k ) = 2m, for some integer

m. We need to show that P(k + 1) is true, i.e., (7k+1− 5k+1) is divisible by 2. Observe that,

7k+1− 5k+1

= 7 · 7k− 5 · 5k

= 7 · (2m + 5k) − 5 · 5k

, using the inductive hypothesis

= 14m + 7 · 5k− 5 · 5k

= 14m + 5k· (7 − 5)

= 14m + 2 · 5k

= 2 · (7m + 5k)

= some even number!

We have thus shown that P(k) → P(k + 1). Applying the first principle of mathematical induction, we conclude that the conjecture is true.

Subramani Proofs and Recursion

Page 103: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Second Principle of Induction

Note

Also called Strong Induction. Is necessary, when the first principle does not help us.

Subramani Proofs and Recursion

Page 104: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Second Principle of Induction

Note

Also called Strong Induction. Is necessary, when the first principle does not help us.

Principle

Assume that the domain is the set of integers.

Subramani Proofs and Recursion

Page 105: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Second Principle of Induction

Note

Also called Strong Induction. Is necessary, when the first principle does not help us.

Principle

Assume that the domain is the set of integers.

(i) P(1) is true.

Subramani Proofs and Recursion

Page 106: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Second Principle of Induction

Note

Also called Strong Induction. Is necessary, when the first principle does not help us.

Principle

Assume that the domain is the set of integers.

(i) P(1) is true.

(ii) (∀r)[P(r) true for all r ,1 ≤ r ≤ k → P(k + 1)]

Subramani Proofs and Recursion

Page 107: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Second Principle of Induction

Note

Also called Strong Induction. Is necessary, when the first principle does not help us.

Principle

Assume that the domain is the set of integers.

(i) P(1) is true.

(ii) (∀r)[P(r) true for all r ,1 ≤ r ≤ k → P(k + 1)]

P(n) is true for all n.

Subramani Proofs and Recursion

Page 108: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Subramani Proofs and Recursion

Page 109: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Proof.

The conjecture is clearly true for 8, 9 and 10.

Subramani Proofs and Recursion

Page 110: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Proof.

The conjecture is clearly true for 8, 9 and 10. Assume that the conjecture holds for allr , 8 ≤ r ≤ k .

Subramani Proofs and Recursion

Page 111: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Proof.

The conjecture is clearly true for 8, 9 and 10. Assume that the conjecture holds for allr , 8 ≤ r ≤ k . Consider the integer k + 1.

Subramani Proofs and Recursion

Page 112: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Proof.

The conjecture is clearly true for 8, 9 and 10. Assume that the conjecture holds for allr , 8 ≤ r ≤ k . Consider the integer k + 1. Without loss of generality, we assume that(k + 1) ≥ 11.

Subramani Proofs and Recursion

Page 113: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Proof.

The conjecture is clearly true for 8, 9 and 10. Assume that the conjecture holds for allr , 8 ≤ r ≤ k . Consider the integer k + 1. Without loss of generality, we assume that(k + 1) ≥ 11. Observe that (k + 1)− 3 = k − 2 is at least 8 and less than k .

Subramani Proofs and Recursion

Page 114: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Proof.

The conjecture is clearly true for 8, 9 and 10. Assume that the conjecture holds for allr , 8 ≤ r ≤ k . Consider the integer k + 1. Without loss of generality, we assume that(k + 1) ≥ 11. Observe that (k + 1)− 3 = k − 2 is at least 8 and less than k . As per theinductive hypothesis, k − 2 can be expressed in the form 3a + 5b, for suitably chosen aand b.

Subramani Proofs and Recursion

Page 115: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Proof.

The conjecture is clearly true for 8, 9 and 10. Assume that the conjecture holds for allr , 8 ≤ r ≤ k . Consider the integer k + 1. Without loss of generality, we assume that(k + 1) ≥ 11. Observe that (k + 1)− 3 = k − 2 is at least 8 and less than k . As per theinductive hypothesis, k − 2 can be expressed in the form 3a + 5b, for suitably chosen aand b. It follows that (k + 1) = 3(a + 1) + 5b, can also be so expressed.

Subramani Proofs and Recursion

Page 116: Mathematical Induction - West Virginia Universitycommunity.wvu.edu/.../sp11/doa/lecnotes/induction.pdfMathematical Induction K. Subramani1 1Lane Department of Computer Science and

First Principle of InductionSecond Principle of Induction

Example

Show that every number greater than or equal to 8 can be expressed in the form5a + 3b, for suitably chosen a and b.

Proof.

The conjecture is clearly true for 8, 9 and 10. Assume that the conjecture holds for allr , 8 ≤ r ≤ k . Consider the integer k + 1. Without loss of generality, we assume that(k + 1) ≥ 11. Observe that (k + 1)− 3 = k − 2 is at least 8 and less than k . As per theinductive hypothesis, k − 2 can be expressed in the form 3a + 5b, for suitably chosen aand b. It follows that (k + 1) = 3(a + 1) + 5b, can also be so expressed. Applying thesecond principle of mathematical induction, we conclude that the conjecture is true.

Subramani Proofs and Recursion