Strong Induction With Example
Strong Induction With Example
Strong induction
Axiom 3.1 (Strong Induction): For any property P,
if P(0) and ∀n ∈ N (P(0) ∧ P(1) ∧ . . . ∧ P(n) =⇒ P(n + 1)),
then ∀n ∈ N P(n).
This says that if all the following sentences are true:
P(0)
P(0) =⇒ P(1)
P(0) ∧ P(1) =⇒ P(2)
P(0) ∧ P(1) ∧ P(2) =⇒ P(3)
P(0) ∧ P(1) ∧ P(2) ∧ P(3) =⇒ P(4)
and so on, then P(n) must be true for all n. Intuitively, this seems quite reasonable. If the truth of P all the
way up to n always implies the truth of P(n + 1), then we immediately obtain the truth of P all the way up
to n + 1, which implies the truth of P(n + 2), and so on ad infinitum.
If we compare the Strong Induction axiom to the original Induction axiom from Lecture Notes 2, we see that
Strong Induction appears to make it easier to prove things. With simple induction, one must prove P(n + 1)
given the inductive hypothesis P(n); with strong induction one gets to assume the inductive hypothesis
P(0) ∧ P(1) ∧ . . . ∧ P(n), which is much stronger.
Consider the following example, which is one half of the Fundamental Theorem of Arithmetic. (The other
half says that the product is unique.)
Theorem 3.1: Any natural number n > 1 can be written as a product of primes.
To prove this, of course, we need to define prime numbers:
Definition 3.1 (Prime): A natural number n > 1 is prime iff it has exactly two factors (1 and n). 1 itself is
not prime.
Let’s see first what happens when we try a simple induction:
Proof: (Attempt 1) The proof is by induction over the natural numbers n > 1.
• Inductive step: prove P(n) =⇒ P(n + 1) for all natural numbers n > 1.
2
With a strong induction, we can make the connection between P(n + 1) and earlier facts in the sequence that
are relevant. For example, if n + 1 = 72, then P(36) and P(24) are useful facts.
Proof: The proof is by strong induction over the natural numbers n > 1.
2
Consider the following example, which is of immense interest to post offices and their customers:
Theorem 3.2: Any integer amount of postage from 8¢ upwards can be composed from 3¢ and 5¢ stamps.
With a strong induction, we can make the connection between P(n + 1) and earlier facts in the sequence. In
particular, P(n − 2) is relevant because n + 1 can be composed from the solution for n − 2 plus one 3¢ stamp.
So the inductive step works if P(n − 2) is known already. This will not be the case when n + 1 is 9 or 10, so
we will need to handle these separately.
Proof: The proof is by strong induction over the natural numbers n ≥ 8.
We can reduce this to the following basic form (with the obvious definitions for propositions A, B, B 0 , and
C):
Simple: A∧B =⇒ C
Strong: A ∧ B0 =⇒ C
Now if P(n) =⇒ P(n + 1), then P(0) ∧ . . . ∧ P(n) =⇒ P(n + 1). Hence, B =⇒ B 0 (i.e., b is stronger than
B0 ). Hence, if A ∧ B0 suffice to prove C, then surely the stronger fact A ∧ B also suffices to prove C. (This is
easily checked using truth tables.) Therefore, the strong induction axiom entails the simple induction axiom.
Second, does the simple induction entail the strong induction axiom? One might expect not, but in fact it
does! We can see this by defining, for any property P(n), the proposition
That is, Q(n) is the property “P holds from 0 to n.” The idea is that simple induction using Q is in fact
identical to strong induction using P. The simple induction axiom for Q is
P(0) ∧ [∀n (P(0) ∧ . . . ∧ P(n)) =⇒ (P(0) ∧ . . . ∧ P(n) ∧ P(n + 1))] =⇒ [∀n (P(0) ∧ . . . ∧ P(n))]
A few moments’ thought [we recommend thinking this thought yourself] reveals that this proposition is
logically equivalent to the proposition
1. Assume the theorem is false. Consider the set of cycle lengths of the tournament. By assumption, this
must be nonempty.
3. Let the first three elements in this cycle be p1 , p2 , p3 , and consider the result of the match between p1
and p3 .
7. Hence, it must be the case that any tournament with a cycle has a cycle of length 3.
f (n) = 1 if n = 0
f (n) = n f (n − 1) otherwise
(define (factorial n)
(if (= n 0)
1
(* n (factorial (- n 1)))))
(factorial 0)
= (if (= 0 0) 1 (* 0 (factorial (- 0 1))))
= 1 by evaluation of if
• We appeal implicitly to several aspects of the evaluation of programs such as the binding of parame-
ters, the definition of if-expressions, and the correspondence between the mathematical function “−”
and the built-in function “-”. These lemmata are an essential part of the definition of the programming
language and can be stated and proved once and for all.
• The theorem as stated is almost certainly false! A real proof of correctness, for a suitably reduced
theorem, must handle the important differences between mathematical entities and the corresponding
entities in the computer. For example, n! is well-defined for any natural number, but (factorial
n) fails if n is large enough to cause an overflow in integer multiplication. Another way to say this is
that * is not the same as the mathematical multiplication function.
• As defined, (factorial n) causes an error for nonnumeric, noninteger, or negative inputs. (What
error arises from negative inputs?) A full specification for a really robust system should lay out the
correct responses to all possible inputs.