




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





This lecture introduces mathematical induction (section 4.1 of Rosen). Earlier in the term, you remembered (or learned real fast) a little bit of summation notation. As we work through examples of induction, we’ll see more examples of this notation. You may want to browse section 2.4 of the textbook, which covers it more systematically.
Mathematical induction is a technique for showing that a statement P (n) is true for all natural numbers n, or for some infinite subset of the natural numbers (e.g. all positive even integers). It’s a nice way to produce quick, easy-to-read proofs for a variety of fact that would be awkward to prove with the techniques you’ve seen so far. It is particularly well suited to analyzing the performance of recursive algorithms. Most of you have seen a few of these in previous programming classes and you’ll see a lot more of them as you finish the rest of the major.
Induction is very handy, but it may strike you as a bit wierd. It may take you some time to get used to it. So, we’ve got two tasks which are a bit independent:
Everyone needs to be able to write an inductive proof to pass this class. However, some of you might finish the term feeling a bit shaky on whether you believe induction works correctly. That’s ok. You can still use the technique, relying on the fact that we say it’s ok. You’ll see induction (and its friend recursion) in later terms and will gradually come to feel more confident about its validity.
2 An Example
Suppose we want to compute the sum of the first n integers. That is:
Σni=1 i = 1 + 2 + 3 +... + n
I claim that this is equal to n(n 2 +1).
The first thing you should do when someone makes such a claim is to see whether you believe that the formula is probably right. Put some small numbers into the formula and check it!
Always be sure to check the smallest value for n that was claimed to work. In this case, the smallest value was claimed to be n = 1. So we check: Σni=1 i = 1 and n(n 2 +1) = 12 ·^2 = 1.
For more complicated formulas, this process of checking often gives you some intuitive insight into why the formula might be true in general. This is often helpful in getting started with a proof.
So, formally, our claim is that
Claim 1 For any positive integer n, Σni=1 i = n(n 2 +1).
motivations at this point, so I’ll offer several.
A proof by induction of that P (k) is true for all positive integers k involves showing that P (1) is true (base case) and that P (k) → P (k + 1) (inductive step).
Dominos: Imagine an infinite line of dominoes. The base step pushes the first one over. The inductive step claims that one domino falling down will push over the next domino in the line. So dominos will start to fall from the beginning all the way down the line. Although this process continues forever (because the line is infinitely long), any given domino will eventually fall.
Recursion fairy: The recursion fairy is the mathematician’s version of a programming assistant. Suppose you tell her how to do the proof for P (1) and also why P (k) implies P (k + 1). Then suppose you pick any integer (e.g. 1034) then she can take this recipe and use it to fill in all the details of a normal direct proof that P holds for this particular integer. That is, she takes P (1), then uses the inductive step to get from P (1) to P (2), and so on up to P (1034).
Smallest counter-example: Let’s assume we’ve established that P (1) is true and also that P (k) implies P (k + 1). Let’s prove that P (j) is true for all j, by contradiction. That is, we suppose that P (1) is true, also that P (k) implies P (k + 1), but there is a counter-example to our claim that P (j) is true for all j. That is, suppose that P (m) was not true for some integer m. Let’s look at the set of all counter-examples. We know that all the counter-examples are larger than 1, because our induction proof established explicitly that P (1) was true. So, the set of counter-examples is a set of integers that has a lower bound. So it has a smallest element. Let’s call the smallest counter-example s. We know that s > 1. So P (s) is not true but P (s − 1) is true. But we know that P (k) implies P (k + 1) for any k. So set k = s − 1. If P (s − 1) is true, then P (s) must be true. So our alleged counter-example(s) can’t exist.
The smallest counter-example explanation can be turned into a formal mathematical proof that induction works. Or, at least, that induction works given that the natural numbers 1 have what’s called the “well-ordering” prop- erty: any subset has a smallest element. This (or something equivent) is part of the standard axioms used to define the integers.
4 Finishing up our example
Now that we have some confidence that our proof outline is ok, let’s finish up the details of our example.
Proof: We will show that Σni=1 i = n(n 2 +1) for any integer n, using induction on n. Base: We need to show that the formula holds for n = 1. Σ^1 i=1 i =
Substituting in the formula from our inductive hypothesis, we get that (Σki=1 i) + (k + 1) = ( k(k 2 +1) ) + (k + 1).
But (k(k 2 +1) ) + (k + 1) = k(k 2 +1) + 2(k 2 +1) = (k+2)( 2 k+1)= (k+1)( 2 k+2).
So, combining these equations, we get that Σk i=1+1 i = (k+1)( 2 k+2) which is what we needed to show.
Notice that the start of the proof tells you which variable in your formula (n in this case) is the induction variable. In this formula, the choice of induction variable is fairly obvious. But sometimes there’s more than one integer floating around that might make a plausible choice for the induction variable. It’s good style to always mention that you are doing a proof by induction and say what your induction variable is.
(^1) Or the positive integers. Or the integers starting with m for some lower bound m.
Proof: Suppose that n is an integer and n ≥ 4. We’ll prove that 2 n^ < n! using induction on n. Base: n = 4. [show that the formula works for n = 4] Induction: Suppose that the claim holds for n = k. That is, suppose that we have an integer k ≥ 4 such that 2k^ < k!. We need to show that 2k+1^ < (k + 1)!.
Notice that our base case is for n = 4 because the claim was specified to hold only for integers ≥ 4.
Fleshing out the details of the algebra, we get the following full proof. When working with inequalities, it’s especially important to write down your assumptions and what you want to conclude with. You can then work from both ends to fill in the gap in the middle of the proof.
Proof: Suppose that n is an integer and n ≥ 4. We’ll prove that 2 n^ < n! using induction on n. Base: n = 4. In this case 2n^ = 2^4 = 16. Also n! = 1 · 2 · 3 · 4 = 24. Since 16 < 24, the formula holds for n = 4. Induction: Suppose that the claim holds for n = k. That is, suppose that we have an integer k ≥ 4 such that 2k^ < k!. We need to show that 2k+1^ < (k + 1)!. 2 k+1^ = 2· 2 k. By the inductive hypothesis, 2k^ < k!, so 2· 2 k^ < 2 ·k!. Since k ≥ 4, 2 < k + 1. So 2 · k! < (k + 1) · k! = (k + 1)!. Putting these equations together, we find that 2k+1^ < (k + 1)!, which is what we needed to show.
6 Another example
The previous examples applied induction to an algebraic formula. We can also apply induction to other sorts of statements, as long as they involve a suitable integer n.
Claim 3 For any positive integer n, n^3 − n is divisible by 3.
In this case, P (n) is “n^3 − n is divisible by 3.”
Proof: By induction on n. Base: Let n = 1. Then n^3 − n = 1^3 − 1 = 0 which is divisible by
Induction: Suppose that k^3 − k is divisible by 3, for some positive integer k. We need to show that (k + 1)^3 − (k + 1) is divisible by
(k+1)^3 −(k+1) = (k^3 +3k^2 +3k+1)−(k+1) = (k^3 −k)+3(k^2 +k) From the inductive hypothesis, (k^3 − k) is divisible by 3. And 3(k^2 + k) is divisible by 3 since (k^2 + k) is an integer. So their sum is divisible by 3. That is (k + 1)^3 − (k + 1) is divisible by 3.