06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

“mcs” — 2017/3/3 — 11:21 — page 155 — #163<br />

5.3. Strong Induction vs. Induction vs. Well Ordering 155<br />

For example, 252 D 7 3 3 2 2, and no other weakly decreasing sequence of<br />

primes will have a product equal to 252.<br />

Bogus proof. We will prove the lemma by strong induction, letting the induction<br />

hypothesis P.n/ be<br />

n is a pusp:<br />

So the lemma will follow if we prove that P.n/ holds <strong>for</strong> all n 2.<br />

Base Case (n D 2): P.2/ is true because 2 is prime, and so it is a length one<br />

product of primes, and this is obviously the only sequence of primes whose product<br />

can equal 2.<br />

Inductive step: Suppose that n 2 and that i is a pusp <strong>for</strong> every integer i where<br />

2 i < n C 1. We must show that P.n C 1/ holds, namely, that n C 1 is also a<br />

pusp. We argue by cases:<br />

If n C 1 is itself prime, then it is the product of a length one sequence consisting<br />

of itself. This sequence is unique, since by definition of prime, n C 1 has no other<br />

prime factors. So n C 1 is a pusp, that is P.n C 1/ holds in this case.<br />

Otherwise, n C 1 is not prime, which by definition means n C 1 D km <strong>for</strong><br />

some integers k; m such that 2 k; m < n C 1. Now by the strong induction<br />

hypothesis, we know that k and m are pusps. It follows that by merging the unique<br />

prime sequences <strong>for</strong> k and m, in sorted order, we get a unique weakly decreasing<br />

sequence of primes whose product equals n C 1. So n C 1 is a pusp, in this case as<br />

well.<br />

So P.n C 1/ holds in any case, which completes the proof by strong induction<br />

that P.n/ holds <strong>for</strong> all n 2.<br />

<br />

Problem 5.27.<br />

Define the potential p.S/ of a stack of blocks S to be k.k 1/=2 where k is the<br />

number of blocks in S. Define the potential p.A/ of a set of stacks A to be the sum<br />

of the potentials of the stacks in A.<br />

Generalize Theorem 5.2.1 about scores in the stacking game to show that <strong>for</strong> any<br />

set of stacks A if a sequence of moves starting with A leads to another set of stacks<br />

B then p.A/ p.B/, and the score <strong>for</strong> this sequence of moves is p.A/ p.B/.<br />

Hint: Try induction on the number of moves to get from A to B.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!