Download Induction 2 Solutions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Mathematical proof wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
MI 4
Mathematical Induction
Name ________________
Mathematical Induction
It turns out that the most efficient solution to the Towers of Hanoi problem with n disks takes
2n – 1 moves. If this isn’t the formula you determined, make sure to check your data—if you
took more moves than this, see if you can find a more efficient solution; if you took fewer make
sure you didn’t accidentally cheat!
How do we know that the Tower of Hanoi can really be solved in 2n – 1 moves, even if n is very
large? Sure, the formula worked for small choices of n like 1, 2, 3, and perhaps you even tried 4
or 5. But there is no way you could try 64 disks, much less a billion. What if some difficulty
sets in when the problem becomes complicated enough, and it stops following the pattern? Or
conversely, what if there is some shortcut for larger numbers? Then the simple formula 2n – 1
might not work out any more.
Math is full of patterns that don’t work out. For instance, into how many separate regions can n
lines split the plane?
n = 0, 1 region
n = 1, 2 regions
n = 2, 4 regions
(region 1)
n = 3, 7 regions?
(1)
(1 region)
(2)
(region 2)
(3)
(4)
It looked like we had a nice pattern of doubling each time, but after a while it broke down. And
that is the problem with statements about “all n”—they might break down after a while. Worse,
they might break down for some large number where we didn’t bother to check that high, so we
don’t even know they broke down.
Sometimes, it can be very important to know that some fact is true about every possible integer.
For instance, some forms of Internet security depend on the fact that every positive integer can
be factored into primes in exactly one way. Now most 50-digit numbers have never been
factored, much less double-checked to see if there isn’t maybe a second, different way to factor
it. There are just too many 50-digit numbers to check them all! But if the 50-digit number that
happens to be guarding your credit card can be factored in two different ways, it could
compromise your card’s security. So it is important to be able to prove that every number can be
factored in a unique way, even though it is impossible to actually check them all.
There are a number of techniques mathematicians use to prove statements are true about all
numbers, without having to check that every possible number works.
Induction 2.1
F14
MI 4
Mathematical Induction
Name ________________
1.
The most common type of proof in mathematics is the direct proof. This proceeds from
known facts to deduce new facts. For instance: prove that if n is even, then so is n2 (hint: start by
noticing that if n is even, then n = 2⋅k for some other number k. Note this is not true about odd
numbers! Now what is n2?)
If n is even, then n = 2⋅k, so n2 = (2k)2 = 4k2 = 2⋅2k2 is also even. So the square of every even number is even. Now since n is a variable in your proof, you could substitute any even number for n, and you
know that n2 is also even. So your have proven that the square of an even number is even,
without having to check every even number (or, by a different way of thinking, since n is
variable you checked every even number simultaneously).
2.
Another common proof technique is indirect proof, sometimes called “proof by
contradiction” or “proof by contraposition” (they are slightly different, but let’s not worry about
that for now). Use proof by contradiction to prove that if n2 is odd, then n must be odd. (Hint:
what do you know if n is even?)
Assume that n is even. Then, from the previous problem, we know that n2 is even, not odd. This is a contradiction, so n must be odd. Again, since n is a variable, you could substitute any n and the statement remains true.
These techniques aren’t always sufficient to prove everything we want to prove. We would like
to prove that Towers of Hanoi can be solved in 2n – 1 moves if you start with a stack of n disks.
The problem with direct or indirect proof is that there is no easy way to take a variable n and say
which 2n – 1 moves you are going to make, and why no fewer will work. Unlike the even and
odd numbers we played with above, it’s difficult to see what property of n makes the Towers
work in the right number of moves.
Remember the notation from the last handout: H(n) is the minimum number of moves needed to
move a stack of n disks.
Induction 2.2
F14
MI 4
Mathematical Induction
Name ________________
Recursion and Induction
3.
Pretend you are faced with a tower of sixteen disks to move. Don’t fret! The evil
Dr. Mike Fogg just stepped into the room, and he happens to know how to solve a 15-disk
puzzle—in the most efficient way possible! (In other words, he can do it using exactly H(15)
moves.) Explain how you could use his knowledge to solve the 16-disk puzzle.
First, use Dr. Fogg’s method to move the top 15 disks onto another peg. Then move the biggest disk onto the third peg. Then, use Dr. Fogg’s method to put the 15 disks back on top of the biggest disk, thus moving all 16 disks to a new peg. 4.
You should be able to use your strategy to explain why H(16) ≤ 2⋅H(15) + 1. Can you
think of why this is “≤” and not just “=”? Can you make your argument slightly more precise to
explain why it can’t be “<” and therefore must actually be “=”?
Our solution used Dr. Fogg’s solution twice, plus one additional move of the biggest disk. So H(16) is at most 2⋅H(15) + 1. It might be less, because there might be a shortcut not involving Dr. Fogg’s method. But not really. Before we can move the biggest disk, all the disks must be moved off of it, and onto a single other peg to leave room to move the biggest disk. This takes at least H(15) moves, since H(15) is the most efficient way possible. Then we must move the biggest disk, then put those smaller ones back on top, taking at least H(15) more moves. So H(16) ≥ 2H(15) + 1. If it is “≤” and “≥”, is must be “=”. 5.
If H(15) really does equal 215 – 1, use this new strategy to find and simplify H(16).
H(16) = 2H(15) + 1 = 2⋅(215 – 1) + 1 = 2⋅215 – 2 + 1 = 216 – 1. 6.
Is there anything special about the numbers 15 and 16 to make this work? Or could your
strategy work for any number, k, so long as Dr. Fogg knows the solution for k – 1 disks?
Nothing special. Everything works the same with any two consecutive numbers. Induction 2.3
F14
MI 4
Mathematical Induction
Name ________________
7.
If Dr. Fogg’s solution really does take 2k – 1 – 1 steps for the k – 1-disk tower, compute
how many steps it will take you to solve the k-disk tower.
H(k) = 2H(k – 1) + 1 = 2⋅(2k – 1 – 1) + 1 = 2⋅2k – 1 – 2 + 1 = 2k – 1. This is an example of a common strategy in mathematics. If you have a sequence of related
problems, figure out how to use the solution to each one as part of the solution to the next more
complicated one. This is called recursion. If you could then figure out how to solve the first
problem, you could use that as part of the solution to the second problem. Then you could use
that to solve the third one. Then you could use this triply-compounded solution to solve the
fourth one, and so on. Since, eventually, you will get to any one of those problems if you work
for long enough, you can say that (in theory at least—it might take you a long time to get to the
trillionth problem!) you can solve every one of those problems.
This is actually an axiom of the integers: if you can solve problem number one, and whenever
you know the solution to problem number k – 1 you have a strategy for turning that into a
solution for problem number k, then you can solve all the problems!
This technique relied on two things: 1) the ability to solve the first problem, and 2) having a
strategy to use a solution for one problem to solve the next one. Without the first you have no
way to get started, and without the second you have no way of continuing once you get started.
Let’s put it in more math-y terms. Let’s say you have some statement about a number n. It
might be “n is odd” or “Towers of Hanoi with n disks can be solved, in exactly 2n – 1 moves.”
We will call this statement S(n) and it can be either true or false when you substitute some
particular number for n. For example, if S(n) is “n is odd” then S(3) is true while S(94) is false.
Principle of Mathematical Induction: Let’s say you want to prove the S(n) is true no matter
what positive integer you plug in for n.
(1) if S(1) is true, and
(2) whenever a particular S(k – 1) happens to be true, you know how to use that fact to prove that
S(k) is also true, then
(conclusion) S(n) is true for all positive integers n by the principle of mathematical induction.
As noted, the principle of mathematical induction is an axiom of the integers. We can’t prove
it’s true. It is part of the mathematical definition of the integers. It is believable, because we
know a way to get from the truth of S(k – 1) to the truth of S(k), and we also know that S(1) is
true. But then setting k = 2, we know how to use the fact that S(k – 1) = S(1) is true to prove that
S(2) is true. So now we know that S(2) is true, and we change k to 3. Then we know S(k – 1) =
S(2) is true, and we know how to get from S(2) to S(3), so we now learn that S(3) is true. And
we just keep going “forever.”
Notice there are two “variables”—n and k. It’s better not to think of k as a variable, but as being
a definite, but unknown, number. It doesn’t change during your proof; it’s some particular
number, and it happens not to matter what that number is in your strategy from going from one
Induction 2.4
F14
MI 4
Mathematical Induction
Name ________________
step to the next. That is, your strategy tells how to solve problem number k given that you (or
Dr. Fogg) knows how to solve problem number k – 1, without knowing what k actually is. It’s
like climbing a long staircase—it doesn’t matter which stair you are on in the process of
climbing from one stair to the next. Whichever stair you are on (which just happens to be
number k – 1) you can climb onto the next stair (which is stair number k), and it doesn’t matter
what k is. On the other hand, n is a variable like in the examples of direct and indirect proof
earlier—you can substitute any value for n and the statement is true, so the statement is true for
all positive integers n.
Part (1), which gets you started, is called the base case or basis step. Part (2), which keeps you
going once you’ve started, is called the induction step.
Let’s write out the whole inductive proof of the Tower of Hanoi problem now:
Theorem: the n-disk Tower of Hanoi problem can be solved, and the best solution takes exactly
2n – 1 steps.
8.
Base case: Explain how to solve the 1-disk Tower of Hanoi:
Just move the disk to a new peg. 9.
1 How many moves did you take? ______ Is this equal to 21 – 1? Yes 10.
Induction step: Let’s say you (or Dr. Fogg) has a solution to the k – 1-disk puzzle, and
that the best possible solution takes H(k – 1) moves. Explain why you can now solve the k-disk
puzzle, needing no more nor less than 2⋅H(k – 1) + 1 moves.
Let’s say we have a solution to the k – 1 disk puzzle, taking the minimum number of H(k – 1) moves. Then to solve the k-­‐disk puzzle, we can move the top k – 1 disks onto a new peg in H(k – 1) moves, then move the largest disk onto the last vacant peg, then use another H(k – 1) moves to put the smaller disks back on top of the largest. So we can move the tower in no more than 2H(k – 1) + 1 moves. But we can’t do any better than that, because before we move the biggest disk, we must move all the smaller disks onto a single other peg, which takes at least H(k – 1) moves. Then one move to move the biggest disk, then at least H(k – 1) more moves to put the small ones back on top. 11.
So H(k) = 2⋅H(k – 1) + 1. If we knew that H(k – 1) = 2k – 1 – 1, simplify to find H(k).
H(k) = 2H(k – 1) + 1 = 2⋅(2k – 1 – 1) + 1 = 2⋅2k – 1 – 2 + 1 = 2k – 1. By the principle of induction, we are done! We have proven that n-disk Tower of Hanoi can
always be solved, taking 2n – 1 moves.
Induction 2.5
F14
MI 4
Mathematical Induction
Name ________________
As you were filling in the steps of the proof, it probably felt like you were just repeating the
arguments from before. You were—you really had completed the proof before, and were just
putting all the pieces together in one place.
Let’s try another one.
Theorem: if n (non-parallel) lines are drawn in a plane, the resulting picture has
n(n + 1)
L (n) =
+ 1 regions. (You might want to check that this formula works for n = 0, 1, 2,
2
and 3 from the pictures on the first page!)
12.
Base case: does the formula work for one line? How many regions are there? What does
the formula give when you substitute n = 1? Are these equal?
With one line, we get two regions. 1⋅(1 + 1) / 2 + 1 = 2, so the formula works in this case. 13.
Inductive step: Let’s say that for some number k, Dr. Fogg counted the number of
regions determined by k – 1 lines and knows that this really does fit the formula—there really are
(k − 1)(k)
L ( k − 1) =
+ 1 regions. How many regions will there be when you draw that kth line?
2
If the new line crosses through an old region, it splits that region into two pieces—one region
becomes two. So you add one new region for each old region that your new line crosses.
Explain why your new line crosses exactly k regions. Hint: when does your new line go from
one old region to a different one?
When we add the kth line, it starts in one region, and crosses into a new region each time it crosses one of the k – 1 old lines. So it crosses into k – 1 other regions. Thus the new line crosses a total of k regions, splitting each in two. Thus, when we add a new line to the picture, we add k new regions. So now we know that L(k) = L(k – 1) + k. Substitute the formula for L(k – 1) above and simplify.
Do this match the hoped-for formula for L(k)?
(k − 1)k
k2 − k
2k k 2 − k + 2k
L(k) = L(k − 1) + k =
+ 1+ k =
+ 1+
=
+1
2
2
k
2
k2 + k
k(k + 1)
=
+1 =
+ 1. Yes, it matches!
2
2
Then we’re done, by the principle of induction!
Induction 2.6
F14