Mathematical Induction - Computer and Information...

96
Copyright © Cengage Learning. All rights reserved. Mathematical Induction

Transcript of Mathematical Induction - Computer and Information...

Copyright © Cengage Learning. All rights reserved.

Mathematical Induction

Mathematical InductionIn general, mathematical induction is a method for proving that a property defined for integers n is true for all values of n that are greater than or equal to some initial integer.

Mathematical Induction!!!!!!!The validity of proof by mathematical induction is generally taken as an axiom. That is why it is referred to as the principle of mathematical induction rather than as a theorem.

Mathematical Induction: two stepsProving a statement by mathematical induction is a two-step process: basis step, and inductive step.

Example 1 – Sum of the First n Integers

Use mathematical induction to prove that !!!Solution:To construct a proof by induction, you must first identify the property P(n). In this case, P(n) is the equation !!![To see that P(n) is a sentence, note that its subject is “the sum of the integers from 1 to n” and its verb is “equals.”]

Example 1 – SolutionIn the basis step of the proof, you must show that the property is true for n = 1, or, in other words that P(1) is true. !Now P(1) is obtained by substituting 1 in place of n in P(n). The left-hand side of P(1) is the sum of all the successive integers starting at 1 and ending at 1. This is just 1. Thus P(1) is

cont’d

Example 1 – SolutionOf course, this equation is true because the right-hand side is !!!which equals the left-hand side. !In the inductive step, you assume that P(k) is true, for a particular but arbitrarily chosen integer k with k ≥ 1. [This assumption is the inductive hypothesis.]

cont’d

Example 1 – SolutionYou must then show that P(k + 1) is true. What are P(k) and P(k + 1)? P(k) is obtained by substituting k for every n in P(n). !Thus P(k) is !!!!!Similarly, P(k + 1) is obtained by substituting the quantity (k + 1) for every n that appears in P(n).

cont’d

Example 1 – SolutionThus P(k + 1) is !!!or, equivalently,

cont’d

Example 1 – SolutionNow the inductive hypothesis is the supposition that P(k) is true. How can this supposition be used to show thatP(k + 1) is true? P(k + 1) is an equation, and the truth of an equation can be shown in a variety of ways. !One of the most straightforward is to use the inductive hypothesis along with algebra and other known facts to transform separately the left-hand and right-hand sides until you see that they are the same.

cont’d

Example 1 – SolutionIn this case, the left-hand side of P(k + 1) is

! 1 + 2 +· · ·+ (k + 1), which equals (1 + 2 +· · ·+ k) + (k + 1) !But by substitution from the inductive hypothesis,

cont’d

Example 1 – Solution cont’d

Example 1 – SolutionSo the left-hand side of P(k + 1) is . !Now the right-hand side of P(k + 1) is by multiplying out the numerator. Thus the two sides of P(k + 1) are equal to each other, and so the equation P(k + 1) is true. !This discussion is summarized as follows:

cont’d

Example 1 – SolutionProof (by mathematical induction): !Let the property P(n) be the equation !!!Show that P(1) is true: !To establish P(1), we must show that

cont’d

Example 1 – SolutionBut the left-hand side of this equation is 1 and the right-hand side is !!also. Hence P(1) is true. !Show that for all integers k ≥ 1, if P(k) is true then P(k + 1) is also true: ![Suppose that P(k) is true for a particular but arbitrarily chosen integer k ≥ 1.That is:] Suppose that k is any integer with k ≥ 1 such that

cont’d

Example 1 – Solution[We must show that P(k + 1) is true. That is:] We must show that !!or, equivalently, that !!![We will show that the left-hand side and the right-hand side of P(k + 1) are equal to the same quantity and thus are equal to each other.]

cont’d

Example 1 – SolutionThe left-hand side of P(k + 1) is

cont’d

Example 1 – Solution!!!!And the right-hand side of P(k + 1) is

cont’d

Example 1 – SolutionThus the two sides of P(k + 1) are equal to the same quantity and so they are equal to each other. Therefore the equation P(k + 1) is true [as was to be shown]. ![Since we have proved both the basis step and the inductive step, we conclude that the theorem is true.]

cont’d

Mathematical Induction I!!!!!For example, writing expresses the sum 1 + 2 + 3 +· · ·+ n in closed form.

a. Evaluate 2 + 4 + 6 +· · ·+ 500. !b. Evaluate 5 + 6 + 7 + 8 +· · ·+ 50. !c. For an integer h ≥ 2, write 1 + 2 + 3 +· · ·+ (h – 1) in

closed form.

Applying the Formula for the Sum of the First n Integers

In a geometric sequence, each term is obtained from the preceding one by multiplying by a constant factor. !If the first term is 1 and the constant factor is r, then the sequence is 1, r, r

2, r 3, . . . , r

n, . . . . !The sum of the first n terms of this sequence is given by the formula !!for all integers n ≥ 0 and real numbers r not equal to 1.

Mathematical Induction

The expanded form of the formula is !!!and because r

0 = 1 and r 1 = r, the formula for n ≥ 1 can be

rewritten as

Mathematical Induction

Prove that , for all integers n ≥ 0 and all real !numbers r except 1. !Solution:In this example the property P(n) is again an equation, although in this case it contains a real variable r :

Example 3 – Sum of a Geometric Sequence

Because r can be any real number other than 1, the proof begins by supposing that r is a particular but arbitrarily chosen real number not equal to 1. !Then the proof continues by mathematical induction on n, starting with n = 0. !In the basis step, you must show that P(0) is true; that is, you show the property is true for n = 0.

Example 3 – Solution cont’d

So you substitute 0 for each n in P(n): !!!!In the inductive step, you suppose k is any integer with k ≥ 0 for which P(k) is true; that is, you suppose the property is true for n = k.

Example 3 – Solution cont’d

So you substitute k for each n in P(n): !!!!Then you show that P(k + 1) is true; that is, you show the property is true for n = k + 1. !So you substitute k + 1 for each n in P(n):

Example 3 – Solution cont’d

Or, equivalently, !!!!In the inductive step for this proof we use another common technique for showing that an equation is true: !We start with the left-hand side and transform itstep-by-step into the right-hand side using the inductive hypothesis together with algebra and other known facts.

Example 3 – Solution cont’d

!!!!!Proof (by mathematical induction): Suppose r is a particular but arbitrarily chosen real number that is not equal to 1, and let the property P(n) be the equation !!We must show that P(n) is true for all integers n ≥ 0. We do this by mathematical induction on n.

Example 3 – Solution cont’d

Show that P(0) is true: !To establish P(0), we must show that !!The left-hand side of this equation is r

0 = 1 and the right-hand side is !!also because r

1 = r and r ≠ 1. Hence P(0) is true.

Example 3 – Solution cont’d

Show that for all integers k ≥ 0, if P(k) is true then P(k + 1) is also true: [Suppose that P(k) is true for a particular but arbitrarily chosen integer k ≥ 0. That is:] Let k be any integer with k ≥ 0, and suppose that !!![We must show that P(k + 1) is true. That is:] We must show that

Example 3 – Solution cont’d

Or, equivalently, that !!![We will show that the left-hand side of P(k + 1) equals the right-hand side.] The left-hand side of P(k + 1) is

Example 3 – Solution cont’d

!!!!!!!!which is the right-hand side of P(k + 1) [as was to be shown.] [Since we have proved the basis step and the inductive step, we conclude that the theorem is true.]

Example 3 – Solution cont’d

Proving an Equality

Two different ways to show that an equation is true: !1. transforming the LHS (left-hand side) and RHS (right-

hand side) independently until they are seen to be equal, and

2. transforming one side of the equation until it is the same as the other side of the equation.

!

Proving an Equality

Sometimes people use a method that they believe proves equality but that is actually invalid. e.g., to prove basis step for Theorem 5.2.3: !!!!!!The problem with this method is that starting from a statement and deducing a true conclusion does not prove that the statement is true.

Proving an Equality

What’s going on here?

!A true conclusion can also be deduced from a false statement. For instance, the steps below show how to deduce the true conclusion that 1 = 1 from the false statement that 1 = 0:

Proving an Equality

!!!!!In each of (a) and (b) below, assume that m is an integer that is greater than or equal to 3. Write each of the sums in closed form. a. !b. !!

Example 4 – Applying the Formula for the Sum of a Geometric Sequence

Let !!Then !!and so

Alternative way to prove

But !!Equating the right-hand sides of equations (5.2.1) and (5.2.2) and dividing by r – 1 gives !!!This derivation of the formula is attractive and is quite convincing. !However, it is not as logically airtight as the proof by mathematical induction.

Deducing Additional Formulas

To go from one step to another in the previous calculations, the argument is made that each term among those indicated by the ellipsis (. . .) has such-and-such an appearance and when these are canceled such-and-such occurs. !But it is impossible actually to see each such term and each such calculation, and so the accuracy of these claims cannot be fully checked. !With mathematical induction it is possible to focus exactly on what happens in the middle of the ellipsis and verify without doubt that the calculations are correct.

Deducing Additional Formulas

Mathematical Induction IIIn natural science courses, deduction and induction are presented as alternative modes of thought—deduction being to infer a conclusion from general principles using the laws of logical reasoning, and induction being to enunciate a general principle after observing it to hold in a large number of specific instances. !In this sense, then, mathematical induction is not inductive but deductive. !Once proved by mathematical induction, a theorem is known just as certainly as if it were proved by any other mathematical method.

Mathematical Induction IIInductive reasoning, in the natural sciences sense, is used in mathematics, but only to make conjectures, not to prove them. !For example, observe that

Mathematical Induction II!!!then by substitution !!!!!!Thus mathematical induction makes knowledge of the general pattern a matter of mathematical certainty rather than vague conjecture.

Proving a Divisibility Property

Use mathematical induction to prove that for all integers n ≥ 0, 22n – 1 is divisible by 3. !Solution:As in the previous proofs by mathematical induction, you need to identify the property P(n).

In this example, P(n) is the sentence

Example 1 – SolutionBy substitution, the statement for the basis step, P(0), is !!!The supposition for the inductive step, P(k), is !!!and the conclusion to be shown, P(k + 1), is

cont’d

Example 1 – SolutionWe know that an integer m is divisible by 3 if, and only if, m = 3r for some integer r. !Now the statement P(0) is true because 22 ● 0 – 1 = 20 – 1 = 1 – 1 = 0, which is divisible by 3 because 0 = 3 ● 0. !To prove the inductive step, you suppose that k is any integer greater than or equal to 0 such that P(k) is true. !This means that 22k – 1 is divisible by 3. You must then prove the truth of P(k + 1). Or, in other words, you must show that 22(k+1) – 1 is divisible by 3.

cont’d

Example 1 – SolutionBut !!!!!The aim is to show that this quantity, 22k ● 4 – 1, is divisible by 3. Why should that be so? By the inductive hypothesis,22k – 1 is divisible by 3, and 22k ● 4 – 1 resembles 22k – 1.

cont’d

Example 1 – SolutionObserve what happens, if you subtract 22k – 1 from 22k ● 4 – 1: !!!Adding 22k – 1 to both sides gives !!!!Both terms of the sum on the right-hand side of this equation are divisible by 3; hence the sum is divisible by 3.

cont’d

Example 1 – SolutionTherefore, the left-hand side of the equation is also divisible by 3, which is what was to be shown. !This discussion is summarized as follows: !!!Proof (by mathematical induction): Let the property P(n) be the sentence “22n – 1 is divisible by 3.”

cont’d

Example 1 – SolutionShow that P(0) is true: !To establish P(0), we must show that !!But !!!and 0 is divisible by 3 because 0 = 3 ● 0. !Hence P(0) is true.

cont’d

Example 1 – SolutionShow that for all integers k ≥ 0, if P(k) is true then P(k + 1) is also true: ![Suppose that P(k) is true for a particular but arbitrarily chosen integer k ≥ 0. That is:] !Let k be any integer with k ≥ 0, and suppose that !!!By definition of divisibility, this means that

cont’d

Example 1 – Solution[We must show that P(k + 1) is true. That is:] We must show that !!But

cont’d

Example 1 – Solution!!!!!But is an integer because it is a sum of products of integers, and so, by definition of divisibility, is divisible by 3 [as was to be shown]. ![Since we have proved the basis step and the inductive step, we conclude that the proposition is true.]

cont’d

Example 2 – Proving an InequalityUse mathematical induction to prove that for all integers n ≥ 3, !Solution:In this example the property P(n) is the inequality !!!By substitution, the statement for the basis step, P(3), is

Example 2 – SolutionThe supposition for the inductive step, P(k), is !!!and the conclusion to be shown is !!!To prove the basis step, observe that the statement P(3) is true because 2 ● 3 + 1 = 7, 23 = 8, and 7 < 8.

cont’d

Example 2 – SolutionTo prove the inductive step, suppose the inductive hypothesis, that P(k) is true for an integer k ≥ 3. !This means that 2k + 1 < 2k is assumed to be true for a particular but arbitrarily chosen integer k ≥ 3. !Then derive the truth of P(k + 1). Or, in other words, show that the inequality is true. But by multiplying out and regrouping, !!and by substitution from the inductive hypothesis,

cont’d

Example 2 – SolutionHence !!If it can be shown that 2k + 2 is less than 2k+1, then the desired inequality will have been proved. !But since the quantity 2k can be added to or subtracted from an inequality without changing its direction, !!And since multiplying or dividing an inequality by 2 does not change its direction,

cont’d

Example 2 – SolutionThis last inequality is clearly true for all k ≥ 2. Hence it is true that . !This discussion is made more flowing (but less intuitive) in the following formal proof: !!!Proof (by mathematical induction): Let the property P(n) be the inequality

cont’d

Example 2 – SolutionShow that P(3) is true: !To establish P(3), we must show that !!But !!Hence P(3) is true.

cont’d

Example 2 – SolutionShow that for all integers k ≥ 3, if P(k) is true then P(k + 1) is also true: ![Suppose that P(k) is true for a particular but arbitrarily chosen integer k ≥ 3. That is:] !Suppose that k is any integer with k ≥ 3 such that !![We must show that P(k + 1) is true. That is:] We must show that

cont’d

Example 2 – SolutionOr, equivalently, !!But !!!!![This is what we needed to show.] [Since we have proved the basis step and the inductive step, we conclude that the proposition is true.]

cont’d

A Problem with Trominoes

A Problem with TrominoesA particular type of polyomino, called a tromino, is made up of three attached squares, which can be of two types: !!!!Call a checkerboard that is formed using m squares on a side an m × m (“m by m”) checkerboard. !Observe that if one square is removed from a 4 × 4 checkerboard, the remaining squares can be completely covered by L-shaped trominoes.

A Problem with TrominoesFor instance, a covering for one such board is illustrated in the figure below. !!!!!!It is a beautiful example of an argument by mathematical induction.

A Problem with Trominoes!!!!The main insight leading to a proof of this theorem is the observation that because , when a board is split in half both vertically and horizontally, each half side will have length 2k and so each resulting quadrant will be a checkerboard.

A Problem with TrominoesProof (by mathematical induction): Let the property P(n) be the sentence !If any square is removed from a 2n × 2n checkerboard,

then the remaining squares can be completely covered by L-shaped trominoes.

!Show that P(1) is true: A 21 × 21 checkerboard just consists of

four squares. If one square is removed, the remaining squares form an L, which can be covered by a single L-shaped tromino, as illustrated in the figure to the right. Hence P(1) is true.

A Problem with TrominoesShow that for all integers k ≥ 1, if P(k) is true then P(k + 1) is also true: ![Suppose that P(k) is true for a particular but arbitrarily chosen integer k ≥ 3. That is:] Let k be any integer such that k ≥ 1, and suppose that !!If any square is removed from a 2k × 2k checkerboard, then the remaining squares can be completely covered by L-shaped trominoes.

A Problem with TrominoesP(k) is the inductive hypothesis. [We must show that P(k + 1) is true. That is:] We must show that !If any square is removed from a 2k+1 × 2k+1 checkerboard, then the remaining squares can be completely covered by L-shaped trominoes.

A Problem with TrominoesConsider a 2k+1 × 2k+1 checkerboard with one square removed. Divide it into four equal quadrants: Each will consist of a 2k × 2k checkerboard. !In one of the quadrants, one square will have been removed, and so, by inductive hypothesis, all the remaining squares in this quadrant can be completely covered by L-shaped trominoes. !The other three quadrants meet at the center of the checkerboard, and the center of the checkerboard serves as a corner of a square from each of those quadrants.

A Problem with TrominoesAn L-shaped tromino can, therefore, be placed on those three central squares. This situation is illustrated in the figure to the right. !By inductive hypothesis, the remaining squares in each of the three quadrants can be completely covered by L-shaped trominoes. !Thus every square in the 2k+1 × 2k+1 checkerboard except the one that was removed can be completely covered by L-shaped trominoes [as was to be shown].

Copyright © Cengage Learning. All rights reserved.

Strong Mathematical Inductionand the Well-Ordering Principle for

the Integers

SECTION 5.4

Strong Mathematical Induction and the Well-Ordering Principle for the Integers

Strong mathematical induction is similar to ordinary mathematical induction in that it is a technique for establishing the truth of a sequence of statements about integers. !Also, a proof by strong mathematical induction consists of a basis step and an inductive step. !However, the basis step may contain proofs for several initial values, and in the inductive step the truth of the predicate P(n) is assumed not just for one value of n but for all values through k, and then the truth of P(k + 1) is proved.

Strong Mathematical Induction and the Well-Ordering Principle for the Integers

Strong Mathematical Induction and the Well-Ordering Principle for the Integers

Any statement that can be proved with ordinary mathematical induction can be proved with strong mathematical induction. !The reason is that given any integer k ≥ b, if the truth of P(k) alone implies the truth of P(k + 1), then certainly the truth of P(a), P(a + 1), . . . , and P(k) implies the truth of P(k + 1). !It is also the case that any statement that can be proved with strong mathematical induction can be proved with ordinary mathematical induction.

Strong Mathematical Induction and the Well-Ordering Principle for the Integers

The principle of strong mathematical induction is known under a variety of different names including the second principle of induction, the second principle of finite induction, and the principle of complete induction.

Applying Strong MathematicalInduction

Applying Strong Mathematical Induction

The divisibility-by-a-prime theorem states that any integer greater than 1 is divisible by a prime number.

!We prove this theorem using strong mathematical induction.

Example 1 – Divisibility by a PrimeProve: Any integer greater than 1 is divisible by a prime number. !Solution: !The idea for the inductive step is this: If a given integer greater than 1 is not itself prime, then it is a product of two smaller positive integers, each of which is greater than 1. !Since you are assuming that each of these smaller integers is divisible by a prime number, by transitivity of divisibility, those prime numbers also divide the integer you started with.

Example 1 – SolutionProof (by strong mathematical induction): Let the property P(n) be the sentence n is divisible by a prime number. !Show that P(2) is true: To establish P(2), we must show that 2 is divisible by a prime number. !But this is true because 2 is divisible by 2 and 2 is a prime number.

cont’d

Example 1 – SolutionShow that for all integers k ≥ 2, if P(i ) is true for all integers i from 2 through k, then P(k + 1) is also true: !Let k be any integer with k ≥ 2 and suppose that i is divisible by a prime number for all integers i from 2 through k. !We must show that k + 1 is divisible by a prime number.

cont’d

Example 1 – SolutionCase 1 (k + 1 is prime): In this case k + 1 is divisible by a prime number, namely itself. !Case 2 (k + 1 is not prime): In this case k + 1 = ab where a and b are integers with 1 < a < k + 1 and 1 < b < k + 1. !Thus, in particular, 2 ≤ a ≤ k, and so by inductive hypothesis, a is divisible by a prime number p. !In addition because k + 1 = ab, we have that k + 1 is divisible by a.

cont’d

Example 1 – SolutionHence, since k + 1 is divisible by a and a is divisible by p, by transitivity of divisibility, k + 1 is divisible by the prime number p. !Therefore, regardless of whether k + 1 is prime or not, it is divisible by a prime number [as was to be shown]. ![Since we have proved both the basis and the inductive step of the strong mathematical induction, we conclude that the given statement is true.]

cont’d

Applying Strong Mathematical Induction

Strong mathematical induction makes possible a proof of the fact used frequently in computer science that every positive integer n has a unique binary integer representation. !The proof looks complicated because of all the notation needed to write down the various steps. But the idea of the proof is simple. !It is that if smaller integers than n have unique representations as sums of powers of 2, then the unique representation for n as a sum of powers of 2 can be found by taking the representation for n/2 (or for (n – 1)/2 if n is odd) and multiplying it by 2.

Applying Strong Mathematical Induction

The Well-Ordering Principle for the Integers

The Well-Ordering Principle for the Integers

The well-ordering principle for the integers looks very different from both the ordinary and the strong principles of mathematical induction, but it can be shown that all three principles are equivalent.

!That is, if any one of the three is true, then so are both of

the others.

Example 4 – Finding Least Elements

In each case, if the set has a least element, state what it is. If not, explain why the well-ordering principle is not violated. !a. The set of all positive real numbers. !b. The set of all nonnegative integers n such that n2 < n. !c. The set of all nonnegative integers of the form 46 – 7k, where k is an integer. !Solution: a. There is no least positive real number. For if x is any positive real number, then x/2 is a positive real number that is less than x.

Example 4 – Solution No violation of the well-ordering principle occurs

because the well-ordering principle refers only to sets ofintegers, and this set is not a set of integers.

!b. There is no least nonnegative integer n such that n2 < n

because there is no nonnegative integer that satisfies this inequality.

! The well-ordering principle is not violated because the

well-ordering principle refers only to sets that contain at least one element.

cont’d

Example 4 – Solutionc. The following table shows values of 46 − 7k for various

values of k. ! !!The table suggests, and you can easily confirm, that 46

– 7k < 0 for k ≥ 7 and that 46 – 7k ≥ 46 for k ≤ 0. !Therefore, from the other values in the table it is clear that 4

is the least nonnegative integer of the form 46 – 7k. This corresponds to k = 6.

cont’d

The Well-Ordering Principle for the Integers

Another way to look at the analysis of Example 4(c) is to observe that subtracting six 7’s from 46 leaves 4 left over and this is the least nonnegative integer obtained by repeated subtraction of 7’s from 46. !In other words, 6 is the quotient and 4 is the remainder for the division of 46 by 7. !More generally, in the division of any integer n by any positive integer d, the remainder r is the least nonnegative integer of the form n – dk.

The Well-Ordering Principle for the Integers

This is the heart of the following proof of the existence part of the quotient-remainder theorem. !!!!Proof: Let S be the set of all nonnegative integers of the form !!where k is an integer.

The Well-Ordering Principle for the Integers

This set has at least one element. [For if n is nonnegative, then !and so n – 0 ● d is in S. And if n is negative, then !!!!and so n – nd is in S.] It follows by the well-ordering principle for the integers that S contains a least element r. Then, for some specific integer k = q, !![because every integer in S can be written in this form].

The Well-Ordering Principle for the Integers

Adding dq to both sides gives !Furthermore, r < d. [For suppose r ≥ d. !Then !and so n – d(q + 1) would be a nonnegative integer in S that would be smaller than r. But r is the smallest integer in S. This contradiction shows that the supposition r ≥ d must be false.]

The Well-Ordering Principle for the Integers

The preceding arguments prove that there exist integers r and q for which !![This is what was to be shown.] !Another consequence of the well-ordering principle is the fact that any strictly decreasing sequence of nonnegative integers is finite. !That is, if r1, r2, r3, . . . is a sequence of nonnegative integers satisfying !!for all i ≥ 1, then r1, r2, r3, . . . is a finite sequence.

The Well-Ordering Principle for the Integers

[For by the well-ordering principle such a sequence would have to have a least element rk. It follows that rk must be the final term of the sequence because if there were a term rk + 1, then since the sequence is strictly decreasing, rk + 1 < rk, which would be a contradiction.] !This fact is frequently used in computer science to prove that algorithms terminate after a finite number of steps.