CSCE 235
Handout
10: Induction
February
26, 2002
Now, we look at induction. Mathematical induction is a method of proof which we can often use when we want to establish the truth of an infinite list of propositions. The method is a natural one to use in a variety of situations in computer science as well. Some applications are quite mathematical in flavor, such as verifying that a certain formula holds for all positive integers. Another frequent use of the method is to show that a computer program or algorithm with loops performs as expected.
Induction?
Consider a video game
which begins with a spaceship in the middle of the screen. In 5 seconds, an alien appears. 5 seconds later, the alien splits into two,
and then five seconds, later, each of these aliens splits into two, and so
on. Every 5 seconds, the number of
aliens doubles. The player’s task is to
eliminate the aliens before they fill the screen. Now after 30 seconds,
assuming that the play is not very skillful and kills no aliens, how many
aliens will there be 30 seconds after the game starts? 1 2 4 8 16 32 – 32 aliens. What about after
5 minutes? We know that
. And it seems
reasonable to guess that after 5 minutes.
The method of mathematical induction applies to just such situations, ones in which
1. We know the answer in the beginning,
2. We know how to determine the answer at one stage from the answer at the previous stage, and
3. We have a guess at the general answer.
Principle
of Mathematical Induction
Consider a list
,
,
, …, of propositions indexed by P. All the propositions
are true provided
Basis (B)
is true;
Induction (I)
is true whenever
is true.
We will refer to the
fact that
is true, as the basis
for induction and we will refer to
is true whenever
is true as the
inductive step (or the induction hypothesis). In the notation of the propositional calculus, the inductive step
is equivalent to:
The implication
is true for all n
in P.
Note: The principle is not itself a proof that
is true for all n,
but it tells us that if we can somehow show (B) and (I) then all
’s are true. There
is no free lunch. The work goes into
showing the basis and the induction, which must be verified before the
Principle of Mathematical Induction can be applied. In practice, the basis will usually be easy to check.
So, remember that there are two basic ingredients for a valid induction proof: the basis and the inductive step. In addition, if there is any possible doubt, it should be made clear that one is giving a proof by induction.
Steps
(1) Verify the
statement for
. This is the basis
for induction, i.e., show that
is true.
(2) Write down the induction step (hypothesis) (the statement for n = k) in the form “Now suppose that …” and be explicit about what is being assumed.
(3) Write down what is to be proven (the statement for n = k+1) in the form “We must show that … “ again being very explicit about what is to be shown; and finally (after waiting a second);
(4) Give a convincing argument as to why the statement for n = k + 1 is true (and make sure this argument uses the induction hypothesis).
(5) Conclude
with “By the Principle of Mathematical Induction, all of the propositions
are true.”
Based on (Goodaire and Parmenter
2002, and Ross and Wright 1988).