19
$\begingroup$

I recently had a lecture in a Computer Science course involving the use of induction. The main discrepancy lies in that a few students and I think our proof should suffice, but our instructor argues that there are gaps in our logic. We really just want to get a full understanding of why there may be gaps in our logic.

Problem: Prove that for $K\geq8$, the value $K$ can be made up of the sum of two different types of coins with value $3$ and $5$.

Our Proof: We show that this is true for $K=8,9,10$.

Let $m$ denote a $3$ coin and $n$ denote a $5$ coin.

$K=8=3+5=m+n$

$K=9=3+3+3=3m$

$K=10=5+5=2n$

So we have established that this holds for $K=8,9,10$. Let $N>10$. Assume that our hypothesis hold for $8\leq K\leq N$. We wish to show this implies it holds for $K=N+1$.

So, $K=N+1=(N-2)+3$, and by our inductive hypothesis, $N-2$ can be made up of 3-coins and 5-coins, (since $N>10$), and clearly $3$ is simply one 3-coin., thus $K=N+1$ can be made up of 3-coins and 5-coins.

We have established our base case ($K=8,9,10$) and shown that assuming $K=N$ holds for $N\geq10$, this implies that $K=N+1$ holds, and thus by the principle of mathematical induction, any value $K\geq8$ can be made up of 3-coins and 5-coins.

Is our argument unsound? Our professor's disagreement was that in order to prove it in this way, we actually must prove for 3 different sequences, that is, 3 separate sequences in which our $K$ value is $8,11,14,...$, and $9,12,15,...$, and $10,13,16,...$ respectively. He states this is because induction must rely solely on the immediately prior term, i.e. $A_N$ implies $A_{N+1}$ implies $A_{N+2}$ ... but that our proof only relates $A_{N+1}$ to $A_{N-2}$. Is this really how induction works?

We think this is maybe because of how induction and sequences are defined in our course, but based on our prior math courses, we think this should suffice.

$\endgroup$
9
  • 25
    $\begingroup$ Your argument is fine. $\endgroup$ Feb 5, 2019 at 16:10
  • 7
    $\begingroup$ You might want to emphasize that your hypothesis holds for all $K$ with $8\leq K\leq N$. Otherwise this is fine. Using weak induction requires you to do induction on three sequences. But your hypothesis makes this an argument by strong induction, which enables you to do it on just one sequence. $\endgroup$ Feb 5, 2019 at 16:11
  • 1
    $\begingroup$ @JoséCarlosSantos The proof is correct, but I'm assuming the professor was implying that they needed to use weak induction to solve this problem. Perhaps they have not axiomatically shown that they are equivalent yet. $\endgroup$ Feb 5, 2019 at 16:12
  • 7
    $\begingroup$ The other commenters are right: this is an issue of ordinary vs. strong induction. $\endgroup$
    – Randall
    Feb 5, 2019 at 16:14
  • 10
    $\begingroup$ "Let $N>10$" You should change that into "let $N\geq10$". $\endgroup$
    – drhab
    Feb 5, 2019 at 16:14

5 Answers 5

11
$\begingroup$

First we have this principle: take any (mathematically well-formed) property $P(n)$, depending on $n$ if you can prove that

$$P(0)$$

$$\forall n \in \mathbb{N}\, P(n) \implies P(n+1)$$

from this you may conclude $$\forall n \in \mathbb{N}\, P(n)$$

From this induction principle you can derive many other induction principles: finite induction, backwards induction etc but we only need two of the following:

You may start from any other natural number other than $0$:

$$P(k)$$

$$\forall n \in \mathbb{N_{\ge{k}}}\, P(n) \implies P(n+1)$$

$$\forall n \in \mathbb{N_{\ge{k}}}\, P(n)$$

and a principle of strong induction:

Suppose you prove

$$\forall n \in \mathbb{N_{\ge{k}}}\,\Bigl(\forall k \in \mathbb{N_{\ge{k}}}\, [k < n \implies P(k)]\Bigr) \implies P(n)$$

then you may conclude

$$\forall n \in \mathbb{N_{\ge{k}}} P(n)$$

In words, the first principle of mathematical induction works like this: You prove the base case (it is absolutely necessary to do this!) and after that you prove that the property holds for some number $n$ by knowing only that it holds for the previous number $n-1$! And if you work with the principle of strong induction not only that you don't need to prove the base case - you can also consider that the property holds for all of the previous numbers! How cool is that? And this is exactly what you did in your proof by strong induction:

Let's suppose that $P(n)$ means than $n$ can be rewritten as sum of $2$'s and $3$'s.

So you take any number $n \ge 8$. You assume that forall $8 \le k < n$ that property holds and then you prove that it also holds for $n$. You do this by cases:

if $n = 8$ then $P(n)$

if $n = 9$ then $P(n)$

if $n = 10$ then $P(n)$

if $n > 10$ then $8 \le n - 3 < n$ and thus by assumption $P(n-3)$ from this follows $P(n)$ since it only has one more $3$.

So you see that $P(n)$ holds in all cases thus by principle of strong induction you may conclude $\forall n \in \mathbb{N_{\ge{8}}}\, P(n)$

Now let's see how you could proceed by using first (ordinary) induction:

The idea is to use ordinary induction 3 times to prove that the property holds for 3 different sequences of natural numbers, that is for $8 + 3n$, $9+3n$, $10+3n$ $n \ge 8$ from this you will be able to conclude that it in facts hold for any natural number greater than $8$, since it'll definitely be in one of those sequences.

I'll show how to do that for the first one, the other two are proved verbatim.

We prove $$\forall n \in \mathbb{N} \mbox{ we have } P(8+3n)$$

$$n = 0, \mbox{ we certainly have } P(8)$$

Now assume we have $P(8+3k)$ for some $k \in \mathbb{N}$ then we need to prove that $P[8 + 3(k+1)]$.

But $8+3(k+1) = (8 + 3k) + 3$ and since $8 + 3k$ could be rewritten as a sum of $3$'s and $2$'s then $(8+3k)+3$ can be also rewritten this way since it is the same but has one more 3. Thus, we have $P[8 + 3(k+1)]$ and thus by the ordinary induction you may conclude $$\forall n \in \mathbb{N}\, P(8+3n)$$

$\endgroup$
2
  • $\begingroup$ Thanks for this! I think that clears up the idea of strong induction for me, which I was a little bit shaky with $\endgroup$
    – Damian Vu
    Feb 5, 2019 at 17:57
  • 2
    $\begingroup$ Another way to organize the proof: show by "weak induction" that for all $k \ge 8$, we have $P(k) \wedge P(k+1) \wedge P(k+2)$. Call this conjunction $Q(k)$; then you have shown all the elements of $Q(8) = P(8) \wedge P(9) \wedge P(10)$. For $Q(k) \rightarrow Q(k+1)$, if $P(k) \wedge P(k+1) \wedge P(k+2)$, then you already know $P(k+1)$ and $P(k+2)$ are true; and also, since $P(k)$ is true and you have shown $P(k) \rightarrow P(k+3)$, you also know $P(k+3)$. Therefore, $P(k+1) \wedge P(k+2) \wedge P(k+3)$, in other words, $Q(k+1)$. $\endgroup$ Feb 6, 2019 at 0:28
5
$\begingroup$

Note that $P(N)$ does not imply $P(N+1)$ in any immediate way (e.g. it is not immediately clear why $17$ should have the property just because $16$ has the property ... though see the inductive proof I give a little later in this post).

So, if you have to use weak induction, the obvious thing to do is what your professor does, and do $3$ separate weak inductive proofs:

  1. Show that $P(8)$, and show that for all $n$: $P(8+3n)\Rightarrow P(8+3(n+1))$

  2. Show that $P(9)$, and show that for all $n$: $P(9+3n)\Rightarrow P(9+3(n+1))$

  3. Show that $P(10)$, and show that for all $n$: $P(10+3n)\Rightarrow P(10+3(n+1))$

Combined together, these proofs show that for all $n \ge 8$: $P(n)$

Another possible weak inductive proof is this:

Show that $P(8)$, $P(9)$, and $P(10)$ hold. Now suppose $P(N)$ holds with $N \ge 10$. Because $N \ge 10$, we know that to form $N$, we need to either use at least one $5$, or (if we don't use any $5$'s at all), at least three $3$'s. But if $P(N)$ is formed using at least one $5$, then we can form $P(N+1)$ by taking away one $5$ and adding two $3$'s. And if we use at least three $3$ to form $P(N)$, then we can form $P(N+1)$ by taking away three $3$'s and adding two $5$'s. So, either way, we can form $P(N+1)$

Your method uses strong induction, and is of course a perfectly good mathematical proof as well ... but maybe your professor had insisted on you using weak induction?

$\endgroup$
6
  • 3
    $\begingroup$ Thanks! I just got an email back from him. He agrees now it is fine, but not a "conventional" way of doing the proof in his words. The main point of discrepancy was that, during lecture, he said "it cannot be done in that way, even under strong induction" which was the confusing part for us. We understood that it would take multiple proofs to do it under weak induction, but that was the main point of confusion. As a matter of fact, the way he did it in class was through a lot more reasoning instead of 3 separate weak inductive proofs, which is what led us to ask if this would work instead $\endgroup$
    – Damian Vu
    Feb 5, 2019 at 18:01
  • 1
    $\begingroup$ @DamianVu Cool! Did he do it using the other weak inductive proof I just added to my Answer? $\endgroup$
    – Bram28
    Feb 5, 2019 at 18:04
  • 1
    $\begingroup$ ah yes I didn't see that. That is exactly how he did it in class. $\endgroup$
    – Damian Vu
    Feb 5, 2019 at 18:06
  • $\begingroup$ @DamianVu OK. But that is a different proof than what you described in your post. :) $\endgroup$
    – Bram28
    Feb 5, 2019 at 18:08
  • 2
    $\begingroup$ @DamianVu Oh! No, the professor was definitely wrong about that. $\endgroup$
    – Bram28
    Feb 5, 2019 at 22:36
4
$\begingroup$

If the property is true for all $k$ such that $$8\le k\le n,$$ where $10\le n$, then it is true for $n-2$ and is true for $n+1$, and for all $k$ such that

$$8\le k\le n+1.$$

$\endgroup$
2
$\begingroup$

Forget about induction for a second.

Let us say $P(K)$ holds iff there exist $c,d \geq 0$ such that $K=3c+5d$. Your goal is to prove that $P(K)$ holds for all $K \geq 8$.

If you would only want to prove $P(8)$ (for example) then you could just write a proof for that ($8=3+5$). However, you can't write a proof for $P(K)$ for all $K \geq 8$ because there simply is not enough time to do that. What you can do instead is to write a computer program (algorithm) which gets $K \geq 8$ as input and outputs a proof for $P(K)$. More specifically, on input $K$ it outputs two numbers $c,d$ such that $K=3c+5d$. Indeed, your question already contains such a program $A$:

  • if $K = 8$ then output $(1,1)$
  • if $K = 9$ then output $(3,0)$
  • if $K = 10$ then output $(0,2)$
  • if $K > 10$ then compute $(c,d) = A(K-3)$ and output $(c + 1, d)$

Now, we need to argue that $A$ works correctly. For the three base cases this is obvious. For the recursive case we argue as follows. Let $K > 10$ and let $(c,d) = A(K-3)$. The algorithm $A$ is correct for input $K$ if $$ K = 3(c+1) + 5d $$

As you have already observed: if $A(K-3)$ is correct, i.e. $K-3 = 3c+5d$, then the above holds as well. Therefore we have reduced proving that $A(K)$ is correct to proving that $A(K-3)$ is correct. Observe that $K-3 > 7$ because otherwise it would contradict our assumption $K > 10$. If $K-3 \leq 10$ then correctness follows from the base cases. Otherwise ($K-3>10$), we can apply the same argument to see that: $A(K-3)$ is correct if $A(K-6)$ is correct. If $K-6$ is still larger than 10 we can apply the same argument and check whether $A(K-9)$ is correct and so on... it is not difficult to argue that eventually a base case is reached. Therefore $A$ works correctly.

My point is that the principle of induction is not some mysterious proof technique but naturally follows from the previous algorithmic perspective. Essentially, a proof by induction is a compact representation of a recursive algorithm which generates the proofs and a proof of correctness of that algorithm. The take-away message is: if you do a proof by induction and you are not certain whether it is sound, try to articulate the recursive algorithm which produces the proofs, try the algorithm out for some cases and then prove its correctness (don't forget to argue that a base case is always reached eventually).

$\endgroup$
2
  • 1
    $\begingroup$ See also the Curry-Howard correspondence: under this correspondence, a proof by induction becomes precisely a special case of a recursive function. $\endgroup$ Feb 6, 2019 at 0:25
  • $\begingroup$ And then you generalize to transfinite induction and program extraction fails, I suppose :) $\endgroup$
    – ComFreek
    Feb 6, 2019 at 7:12
1
$\begingroup$

I'm curious what the professor's approved solution by "weak induction" is. Because the obvious proof is wrong:

N=8: 8=3+5.

Induction step: Assume that $N=3a + 5b$. Then $N+1 = 3(a+2) + 5(b-1)$.

Since the statement ask for a "sum" of 3's and 5's it seems clear we're supposed to show $N=3a + 5b$ for some $a\ge0$ and $b\ge0$. If so then the simple argument above is wrong; if $N=3a + 5b$ with $b=0$ then $b-1<0$.

A correct version is a little more complicated:

Induction step: Assume $N=3a+5b$. If $b>0$ then $N+1=3(a+2)+5(b-1)$.

If $b=0$: Since $N\ge8$ we must have $a\ge3$. So we can write $N+1=3(a-2)+5$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.