5
Chapter 2: Mathematical Preliminaries );J, 57 2.4 PRINCIPLE OF INDUCTION The process of reasoning from general observations to specific truths is called induction. The following propelties apply to the set N of natural principle of induction., Property 1 Zero is a natural number. Property 2 The successor of any natural number is also a natural number. Property 3 Zero is not the successor of any natural number. Property 4 No two natural numbers have the same successor. Property 5 Let a property pen) be defined for every natural number n. If (i) P(O) is true. and (ii) P(successor of II) is true whenever pen) is true, then P(n) is true for all II. A proof by complete enumeration of all possible combinations is called perfect induction. e.g. proof by truth table. The method of proof by induction can be used to prove a property pen) for all n. 2.4.1 METHOD OF PROOF BY INDUCTION This method consists of three basic steps: Step 1 Prove P(n) for II = 0/1. This is called the proof for the basis. Step 2 Assume the result/properties for pen). This is called the induction hypothesis. Step 3 Prove P(II + l) using the induction hypothesis. EXAMPLE 2.20 Prove that 1 + 3 + 5 + ... + r = for all n > O. where r is an odd integer and n is the number of terms in the sum. (Note: r = 211 - 1.) Solution (a) Prooffor the basis. For n = 1. L.H.S. = 1 and R.H.S. = 1 2 = 1. Hence the result is true for n = 1. (b) By induction hypothesis. we have 1 + 3 + 5 + ... + r = As r = 2n - 1. L.H.S. = 1 + 3 + 5 + ... + (2n - 1) = 11 2 (e) We have to prove that 1 + 3 + 5 + .. , + r + r + 2 = (n + 1)2: L.R.S. = (1 + 3 + 5 + '" + r + (r + 2)) = 11 2 + r + 1 = n: + 2n - 1 + 2 = (ll + 1)= = R.H.S.

Principle of Induction

Embed Size (px)

DESCRIPTION

Principle of Induction in Theory of Computation

Citation preview

Page 1: Principle of Induction

Chapter 2: Mathematical Preliminaries );J, 57

2.4 PRINCIPLE OF INDUCTION

The process of reasoning from general observations to specific truths is calledinduction.

The following propelties apply to the set N of natural numbers~theprinciple of induction.,

Property 1 Zero is a natural number.

Property 2 The successor of any natural number is also a natural number.

Property 3 Zero is not the successor of any natural number.

Property 4 No two natural numbers have the same successor.

Property 5 Let a property pen) be defined for every natural number n. If(i) P(O) is true. and (ii) P(successor of II) is true whenever pen) is true, thenP(n) is true for all II.

A proof by complete enumeration of all possible combinations is calledperfect induction. e.g. proof by truth table.

The method of proof by induction can be used to prove a property pen) forall n.

2.4.1 METHOD OF PROOF BY INDUCTION

This method consists of three basic steps:

Step 1 Prove P(n) for II = 0/1. This is called the proof for the basis.

Step 2 Assume the result/properties for pen). This is called the inductionhypothesis.

Step 3 Prove P(II + l) using the induction hypothesis.

EXAMPLE 2.20

Prove that 1 + 3 + 5 + ... + r = n~. for all n > O. where r is an odd integerand n is the number of terms in the sum. (Note: r = 211 - 1.)

Solution

(a) Prooffor the basis. For n =1. L.H.S. = 1 and R.H.S. = 12 = 1. Hencethe result is true for n = 1.

(b) By induction hypothesis. we have 1 + 3 + 5 + ... + r = Il~. As r =2n - 1.

L.H.S. = 1 + 3 + 5 + ... + (2n - 1) = 11 2

(e) We have to prove that 1 + 3 + 5 + .. , + r + r + 2 = (n + 1)2:

L.R.S. = (1 + 3 + 5 + '" + r + (r + 2))

= 112 + r + 1 = n: + 2n - 1 + 2 = (ll + 1)= = R.H.S.

Page 2: Principle of Induction

58 !i2 Theory ofComputer Science

EXAMPLE 2.21

Prove the following theorem by induction:

1 + 2 + 3 + ... + n = n(n + 1)/2

Solution

(a) Proof for the basis. For n = L L.H.S. = 1 andR.H.5. = 1(1 + 1)/2 = 1

(b) Assume 1 + 2 + 3 + ... + n = n(1l + 1)/2.(c) We have to prove:

1 + 2 + 3 + + (n + 1) = (n + 1)(n + 2)/2

1 + 2 + 3 + + n + (n + 1)

=n(n + 1)/2 + (n + 1) (by induction hypothesis)

= (n + 1)(n + 2)/2 (on simplification)

The proof by induction can be modified as explained in the followingsection.

2.4.2 MODIFIED METHOD OF INDUCTION

Three steps are involved in the modified proof by induction.

Step 1 Proof for the basis (n = 0/1).

Step 2 Assume the result/properties for all positive integers < n + 1.

Step 3 Prove the result/properties using the induction hypothesis (i.e. step 2),forn+l.

Example 2.22 below illustrates the modified method of induction. Themethod we shall apply will be clear once we mention the induction hypothesis.

EXAMPLE 2.22

Prove the following theorem by induction: A tree with n vertices has (n - 1)edges.

Solution

For n = 1, 2, the following trees can be drawn (see Fig. 2.15). 50 the theoremis true for n = 1, 2. Thus, there is basis for induction.

o In=1 n=2

Fig. 2,15 Trees with one or two vertices.

Page 3: Principle of Induction

Chapter 2: Mathematical Preliminaries ~ 59

Consider a tree T with (n + 1) vertices as shown in Fig. 2.16. Let e bean edge connecting the vertices Vi and 1} There is a unique path between Vi

and vi through the edge e. (Property of a tree: There is a unique path betweenevery pair of vertices in a tree.) Thus, the deletion of e from the graph willdivide the graph into two subtrees. Let nl and n: be the number of verticesin the subtrees. As 111 ::; 11 and 11: ::; n. by induction hypothesis, the totalnumber of edges in the subtrees is 11] - 1 + n: - 1. i.e. n - 2. So, the numberof edges in T is n - 2 + 1 = 11 - 1 (by including the deleted edge e). Byinduction. the result is true for all trees.

e

Fig. 2.16 Tree T with (n + 1) vertices.

EXAMPLE 2.23

Two definitions of palindromes are given below. Prove by induction that thetwo definitions are equivalent.

Definition 1 A palindrome is a string that reads the same forward andbackward.

Definition 2 (i) A is a palindrome.(ii) If a is any symboL the string a is a palindrome.

(iii) If a is any symbol and x is a palindrome. then axa is a palindrome.(iv) Nothing is a palindrome unless it follows from (i)-(iii).

Solution

Let x be a string which satisfies the Definition L i.e. x reads the same forwardand backward. By induction on the length of x we prove that x satisfiesthe Definition 2.

If Ix I ::; 1. then x =a or A. Since x is a palindrome by Definition L i\and a are also palindromes (hence (i) and (ii», i.e. there is basis for induction.If !x I > 1. then x =mva, where w. by Definition 1. is a palindrome: hence therule (iii). Thus. if x satisfies the Definition L then it satisfies the Definition 2.

Let x be a string which is constructed using the Definition 2. Weshow by induction on i x I that it satisfies the Definition 1. There is basisfor induction by rule (ii). Assume the result for all strings with length < n.Let x be a string of length n. As x has to be constructed using therule (iii). x = aya. where y is a palirrlr'Jme. As y is a palindrome byDefinition 2 and Iy I < 71, it satisfies the Definition 1. So, x = aya also satisfiesthe Definition 1.

Page 4: Principle of Induction

60 J;l Theory of Computer Science

EXAMPLE 2.24

Prove the pigeonhole principle.

Proof We prove the theorem by induction on m. If m = 1 and 11 > L thenall these 11 items must be placed in a single place. Hence the theorem is truefor III = 1.

Assume the theorem for m. Consider the case of III + 1 places. We provethe theorem for 11 =In + 2. (If 11 > In + 2. already one of the In + 1 places willreceive at least two objects from m + 2 objects, by what we are going to prove.)Consider a particular place. say, P.

Three cases arise:

(i) P contains at least two objects.(ii) P contains one object

(iii) P contains no object.

In case (i). the theorem is proved for n = 111 + 2. Consider case (ii). As P

contains one object, the remaining m places should receive 111 + 1 objects. Byinduction hypothesis, at least one place (not the same as P) contains at least twoobjects. In case (iii), III + 2 objects are distributed among In places. Once again,by induction hypothesis, one place (other than P) receives at least two objects.Hence. in aD the cases, the theorem is true for (m + 1) places. By the principleof induction. the theorem is true for all Ill.

2.4.3 SIMULTANEOUS INDUCTION

Sometimes we may have a pair of related identities. To prove these, we mayapply two induction proofs simultaneously. Example 2.25 illustrates thismethod.

EXAMPLE 2.25

A sequence Fo, F], F2, ... called the sequence of Fibonacci numbers (namedafter the Italian mathematician Leonardo Fibonacci) is defined recursively asfollows:

Prove that:Fo = O.

P" : (2.2)

(2.3)

Proof We prove the two identities (2.2) and (2.3) simultaneously bysimultaneous induction. PI and Q] are F12 + F0

2 = F1 and F2F 1 + F]Fo = Fc

Page 5: Principle of Induction

Chapter 2: Mathematical Preliminaries );! 61

respectively. As Fo = 0, F I = 1, F~ =1, these are true. Hence there is basisfor induction. Assume Pn and Qw So

(2.2)

(2.3)Now.

= (F,~-l + F,~) + F"-lF,, + F,; + F"-lF,,

=F,;-l + F,~ + (F,,-l + F" )F" + F"F,,-l

=(F,~-l + F,;) + F,'~lF" + F"F,'-l

(by (2.3»)

This proves Pn+ l •

Also.

(By P'1+1 and (2.3))

This proves Qn+l'

So. by induction (2.2) and (2.3) are true for all 11.

We conclude this chapter with the method of proof by contradiction.

2.5 PROOF BY CONTRADICTION

Suppose we want to prove a property P under certain conditions. The methodof proof by contradiction is as follows:

Assume that property P is not true. By logical reasoning get a conclusionwhich is either absurd or contradicts the given conditions.

The following example illustrates the use of proof by contradiction andproof by induction.

EXAMPLE 2.26

Prove that there is no string x in {a. b}* such that (L-r: = xb. (For the definitionof strings. refer to Section 2.3.)