4S. Induction

COMP11120 Solutions 4: Induction
4.1 The proofs of this kind of identity
n
∑ ai =
explicit expression
i=0
follow a common pattern. ∀n ∈ N let
n
L(n) = ∑ ai
,
R(n) = explicit expression
i=0
so we want to prove
(∀n)[L(n) = R(n)].
The details, of course, are different in each case, but usually the following template will work.
Setting n = 0, an easy calculation gives
L(0) = R(0)
i.e. the base case. For the induction step we argue
L(n + 1) = L(n) + an+1 = R(n) + an+1 = R(n + 1)
where
• the first equality follows by detaching the last component of the summation,
• the second equality follows by the Induction Hypothesis,
• the third equality follows by some algebraic manipulations.
It is this last step which may cause the most problems.
Let’s look at the details for some of the examples.
(i) Here we have
n
L(n) = ∑ i(i + 1)(i + 2) ,
R(n) =
i=0
n(n + 1)(n + 2)(n + 3)
.
4
For the induction step we have
R(n) + an+1 = ( n(n+1)(n+2)(n+3)
) + (n + 1)(n + 2)(n + 3)
4
(n+1)(n+2)(n+3)
= (
)(n + 4)
= R(n + 1)
4
as required.
(ii) Here we have
n
L(n) = ∑ i(i + 1)(i + 2)(i + 3) ,
R(n) =
i=0
1
n(n + 1)(n + 2)(n + 3)(n + 4)
.
5
Induction
For the induction step we have
R(n) + an+1 = ( n(n+1)(n+2)(n+3)(n+4)
) + (n + 1) · · · (n + 4)
5
(n+1)(n+2)(n+3)(n+4)
= (
)(n + 5)
= R(n + 1)
5
as required.
(iii) Here we have
n
L(n) = ∑ i(i + 1)(i + 2)(i + 3)(i + 4) ,
R(n) =
i=0
n(n + 1)(n + 2)(n + 3)(n + 4)(n + 5)
.
6
For the induction step we have
R(n) + an+1 = ( n(n+1)···(n+5)
) + (n + 1) · · · (n + 5)
6
(n+1)···(n+5)
= (
)(n + 6)
= R(n + 1)
6
as required.
(iv) Here we have
n
1
i=0 (i + 1)(i + 2)
L(n) = ∑
R(n) = 1 −
,
1
.
n+2
For the induction step we have
1
1
+ (n+2)(n+3)
R(n) + an+1 = 1 − n+2
(n+3)−1
= 1 − (n+2)(n+3)
(n+2
= 1 − (n+2)(n+3)
1
= 1 − n+3
= R(n + 1)
as required.
(v) Here we have
n
2
i=0 (i + 1)(i + 2)(i + 3)
L(n) = ∑
,
R(n) =
1
1
−
.
2 (n + 2)(n + 3)
For the induction step we have
R(n) + an+1 =
=
=
=
1
2
1
2
1
2
1
2
1
2
− (n+2)(n+3)
+ (n+2)(n+3)(n+4)
(n+4)−2
− (n+2)(n+3)(n+4)
n+2
− (n+2)(n+3)(n+4)
1
− (n+3)(n+4)
= R(n + 1)
as required.
(vi) Here we have
n
3
i=0 (i + 1) · · · (i + 4)
L(n) = ∑
,
R(n) =
2
1
1
−
.
6 (n + 2)(n + 3)(n + 4)
COMP11120 Solutions 4
For the induction step we have
1
6
1
6
1
6
1
6
R(n) + an+1 =
=
=
=
1
3
− (n+2)(n+3)(n+4)
+ (n+2)···(n+5)
(n+5)−3
− (n+2)···(n+5)
n+2
− (n+2)···(n+5)
1
− (n+3)···(n+5)
= R(n + 1)
as required.
(vii) Here we have
n
L(n) = ∑ (2i + 1)2
,
R(n) =
i=0
(n + 1)(2n + 1)(2n + 3)
.
3
For the induction step we have
R(n) + an+1 =
=
=
=
(n+1)(2n+1)(2n+3)
+ (2n + 3)2
3
2
(2n + 3) (2n +3n+1)(+(6n+9)
3
2
(2n + 3) 2n +9n+10
3
(2n + 3) (n+2)(2n+5)
3
= R(n + 1)
as required.
(viii) Here we have
n
L(n) = ∑ i2i
R(n) = (n − 1)2n+1 + 2.
,
i=0
For the induction step we have
R(n) + an+1 = (n − 1)2n+1 + 2 + (n + 1)2n+1
= (n − 1 + n + 1)2n+1 + 2
= 2n2n+1 + 2
= R(n + 1)
as required.
(ix) Here we have
n
L(n) = ∑ i3
,
i=0
R(n) = (
n(n + 1) 2
) .
2
For the induction step we have
R(n) + an+1 =
=
=
=
2
3
( n(n+1)
2 ) + (n + 1)
2 2
( (n+1)
2 ) (n + 4(n + 1))
2 2
( (n+1)
2 ) (n + 4n + 4)
( (n+1)(n+2)
)2
= R(n + 1)
2
as required.
(x) Here we have
L(n) = i!i
,
3
R(n) = (n + 1)! − 1.
Induction
For the induction step we have
R(n) + an+1 = ((n + 1)! − 1) + ((n + 1)!(n + 1))
= (n + 1)!(1 + n + 1) − 1
= R(n + 1)
as required. 4.2 Base case: 12 = 3 * 4
Now suppose n is some number ≥ 12. By induction hypothesis
n = 4a + 5b
Since n ≥ 12 we must have either
• a≥1
• or b ≥ 3
In the first case we can replace a 4 by a 5, to obtain n + 1.
In the second we can replace 3 5s by 4 4s, to obtain n + 1 again. 4.3 Base case: 71 − 1 = 6, which is divisible by 6
Now suppose, for some n, 7n − 1 is divisible by 6.
7n+1 − 1 = 7.7n − 1
= 7.(7n − 1) + 6
(∗)
Since 7n − 1 is divisible by 6, the expression (*) is also divisible by 6. 4.4 Base case: 13 − 1 = 0 is divisible by 6.
Suppose n3 − n is divisible by 6
(n + 1)3 − (n + 1) = n3 + 3n2 + 3n + 1 − n − 1
= (n3 − n) + 3n2 + 3n
= (n3 − n) + 3n(n + 1)
(∗)
Since n3 − n is divisible by 6, we need to show that 3n(n + 1) is also divisible by 6 to prove that
(*) is divisible by 6.
But, whatever the value of n, one of n and n + 1 is even, so their product is even and hence
3n(n + 1) is divisible by 6. 4.5 Base case: n = 2. n(n − 1)/2 = 1, and a set of size 2 has exactly 1 subset of size 2.
Now suppose the result is true for some n and consider a set A of size n + 1. This can be
thought of as a set B of size n together with some additional element, which we will call x. Any
subset S of size 2 of A has one the properties
4
COMP11120 Solutions 4
1. x ∈ S
2. x 6∈ S
Subsets of type 1 are all subsets of B, so there are n(n − 1)/2 of them.
Subsets of type 2 consist of x together with one element from b, of which there are n
choices.
This gives a total of
n(n − 1) + 2n
2
n2 − n + 2n
=
2
2
n +n
=
2
= (n + 1)(n + 1 − 1)/2
n(n − 1)/2 + n =
4.6 The cash dispenser can dispense £20 and any multiple of £10 greater than or equal to £40.
Base cases: 20 = 20 ∗ 1, 40 = 20 ∗ 2.
Any multiple n of 10 ≥ 40 must contain at least one 50 or at least 2 20s. In the first case
replace the 50 by 3 20s to obtain n + 10; in the second case replace 2 20s by a 50. 4.7 In each case the formula
f (r) = · · · r · · ·
is given. The proof of the base case
f (0) = · · · 0 · · ·
is trivial. The details of the proof of the induction step
f (r) = · · · r · · · ⇒ f (r + 1) = · · · r + 1 · · ·
are given.
(i) f (r) = 2r
For the induction step, r 7→ r + 1, we have
f (r + 1) = f (r) + 2
= 2r + 2
= 2(r + 1)
by the spec
by the Induction Hypothesis
as required.
(ii) f (r) = r2
For the induction step, r 7→ r + 1, we have
f (r + 1) = f (r) + 2r + 1
= r2 + 2r + 1
= (r + 1)2
5
by the spec
by the Induction Hypothesis
Induction
as required.
(iii) f (r) = 2r
For the induction step, r 7→ r + 1, we have
f (r + 1) = 2 f (r)
= 2 × 2r
= 2r+1
by the spec
by the Induction Hypothesis
as required.
r
(iv) f (r) = 22
For the induction step, r 7→ r + 1, we have
f (r + 1) =
=
=
=
=
f (r)2
r
r
22 × 22
r
r
22 +2
r
22×2
r+1
22
by the spec
by the Induction Hypothesis
as required.
(v) f (r) = r!
For the induction step, r 7→ r + 1, we have
f (r + 1) = (r + 1) × f (r)
= (r + 1) × r!
= (r + 1)!
by the spec
by the Induction Hypothesis
as required.
(vi) f (r) =
Here

0



if 1 < r
1



if r ≤ 1
f (1) = f (0)( f (0) − 0) = 1(1 − 0)
= 1
f (2) = f (1)( f (1) − 1) = f (1)(1 − 1) = 0
and then
f (r) = 0 ⇒ f (r + 1) = 0
holds since
f (r + 1) = f (r)( f (r) − r)
= 0 × ( f (r) − r)
= 0
by the spec
by the Induction Hypothesis
as required. 4.8 (i – iv) In each case the specification has the form
f (0) = 1 , f (1) = k + 1
f (r + 2) = 2 f (r + 1) − f (r)
6
COMP11120 Solutions 4
for k = 0, 1, 2, 3, respectively. We show that
f (r) = kr + 1
,
f (r + 1) = k(r + 1) + 1
by induction on r.
The base case, r = 0, is immediate.
For the induction step, r 7→ r + 1, we have
f (r + 2) =
=
=
=
2 f (r + 1) − f (r)
2(k(r + 1) + 1) − (kr + 1)
2kr + 2k + 2 − kr − 1
k(2r + 2 − r) + 1
= k(r + 2) + 1
to give the required result.
(v – viii) In each case the specification has the form
f (0) = 1 , f (1) = k
f (r + 2) = (k − 1) f (r + 1) + k f (r)
for k = 2, 3, 4, 5, respectively. We show that
f (r) = kr
,
f (r + 1) = kr+1
by induction on r.
The base case, r = 0, is immediate.
For the induction step, r 7→ r + 1, we have
f (r + 2) = (k − 1) f (r + 1) + k f (r)
= (k − 1)kr+1 + kkr
= kr+2 − kr+1 + kr+1
= kr+2
to give the required result. 4.9
The problem is that the argument used to prove the inductive step fails when n = 2. In this
case the sets X − {Linus} and X − {Bill} have no member in common.
7