Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Formal Methods
Key to Homework Assignment 8, Part 1
March 23, 2007
2. Prove by induction that for each natural number n,
(cos x + i sin x)n = cos(nx) + i sin(nx).
Assume that i2 = −1 and also assume the following two trigonometric identities:
cos(x + y) = cos x cos y − sin x sin y and sin(x + y) = sin x cos y + cos x sin y.
Here, the Pn are
P1 : (cos x + i sin x)1 = cos(1 · x) + i sin(1 · x)
P2 : (cos x + i sin x)2 = cos(2x) + i sin(2x)
P2 : (cos x + i sin x)3 = cos(3x) + i sin(3x)
..
.
Pn : (cos x + i sin x)n = cos(nx) + i sin(nx)
..
.
Proof by induction on n. The base case is pretty clear:
(cos x + i sin x)1 = cos x + i sin x = cos(1 · x) + i sin(1 · x).
So when n = 1,
(cos x + i sin x)n = cos(nx) + i sin(nx).
So we assume that n is a positive integer such that
(cos x + i sin x)n = cos(nx) + i sin(nx),
and we need to show that
(cos x + i sin x)n+1 = cos[(n + 1)x] + i sin[(n + 1)x].
1
We start with the left-hand side:
(cos x + i sin x)n+1 =
=
=
=
=
=
(cos x + i sin x)n (cos x + i sin x)
[cos(nx) + i sin(nx)](cos x + i sin x)
cos(nx) cos x + i cos(nx) sin x + i sin(nx) cos x + i2 sin(nx) sin x
[cos(nx) cos x − sin(nx) sin x] + i[cos(nx) sin x + sin(nx) cos x]
cos(nx + x) + i sin(nx + x)
cos[(n + 1)x] + i sin[(n + 1)x].
So by the PMI,
(cos x + i sin x)n = cos(nx) + i sin(nx),
for all positive integers n.
8. See the text for the so-called proof.
Note first that the result is false. For example, 3·1+3·2 = 9, while (3·22 +3·2+2)/2 =
10. However, the argument is almost correct. It’s true (and they’ve proved it) that if
n is a positive integer such that
3 · 1 + 3 · 2 + · · · + 3n = (3n2 + 3n + 2)/2,
then
3 · 1 + 3 · 2 + · · · + 3n + 3(n + 1) = [3(n + 1)2 + 3(n + 1) + 2]/2.
The problem is that the base case doesn’t start off the induction. To see what this
means, ask yourself what the Pn are. If n ≥ 2,
Pn : 3 · 1 + 3 · 2 + · · · + 3n = (3n2 + 3n + 2)/2.
For n = 1, though, it’s not at all clear what Pn is. Since 1 ∈ S, presumably P1 is true.
But then it can’t imply P2 , since P2 (as we’ve already seen) is false. So the problem
with the proof is that P1 doesn’t imply P2 , and we need Pn → Pn+1 , for all positive
integers n.
Note that if you look at 1b on page 73, you’ll see that the correct result is that
3 · 1 + 3 · 2 + · · · + 3n = (3n2 + 3n)/2,
and clearly, (3n2 + 3n + 2)/2 6= (3n2 + 3n)/2, for all positive integers n. So if n ≥ 2,
Pn is false, and in fact S = {1}.
10. See the text for the so-called proof.
Note first that in this case the result is correct. From 1e on page 73, we see that
2 + 5 + 8 + · · · + (3n − 1) = n(3n + 1)/2.
Hence
4 + 10 + 16 + · · · + (6n − 2) = n(3n + 1).
2
Also note that the argument in support of the base case is essentially correct. However,
the induction step starts by assuming that
4 + 10 + 16 + · · · + (6n − 2) + [6(n + 1) − 2] = (n + 1)[3(n + 1) + 1].
It then deduces that
4 + 10 + 16 + · · · + (6n − 2) = n(3n + 1).
In other words, it assumes Pn+1 is true and concludes that Pn is true. So it shows
Pn+1 → Pn when it needs to show that Pn → Pn+1 . This is the standard mistake in
induction proofs.
11. See the text for the proof.
Once again, note that the result is correct by 1k on page 73. The base case is also
essentially correct. The problem is again with the induction step. They start by
assuming that
7n+1 − 2n+1 = 5p
for some integer p. In other words, they’re assuming that
7n+1 − 2n+1
is evenly divisible by 5. They then deduce that
7n − 2n
is evenly divisible by 5. So once again they’re showing that Pn+1 implies Pn .
By the way, the proof that 7n+1 − 2n+1 = 5p implies 7n − 2n is correct. In the last step:
Thus 7(7n − 2n ) = 5(p − 2n ), and hence 7(7n − 2n ) is divisible by 4. Since 7
is not divisible by 5, 5 divides 7n − 2n .
they’re using a fact about prime numbers: if q is a prime number and q divides the
product ab of two integers a and b, then q divides a or q divides b. In this case q is the
prime 5, a = 7, and b = 7n − 2n .
12. See the text for the proof.
In this example, they’re once again proving that Pn+1 → Pn . In this instance, obviously,
the result is false. So this example shows the insidiousness of the Pn+1 → Pn mistake.
3