You are on page 1of 2

Discrete Structures

CS2800 Fall 2013

Homework 2
Due Wednesday, September 18, 2013

1. Let f, g : N N (functions from the natural numbers to the natural numbers). As discussed in class, the
formal definition of f is O(g) (that is, f is order of g; f is asymptotically upper-bounded by g) is:
c > 0 n0 > 0 x n0 f (x) c g(x).
A popular undergraduate text on analysis of algorithms contains the following text, theorem, and proof.
A first property is transitivity: if a function f is asymptotically upper-bounded by a function
g, and if g in turn is asymptotically upper-bounded by a function h, then f is asymptotically
upper-bounded by h.
Theorem A If f is O(g) and g is O(h), then f is O(h).
Proof. We are given that for some constants c and n0 , we have f (n) cg(n) for all n n0 .
Also, for some (potentially different) constants c0 and n00 , we have g(n) c0 h(n) for all n n00 .
Consider any number n that is at least as large as both n0 and n00 . We have f (n) cg(n)
cc0 h(n), so f (n) cc0 h(n) for all n max(n0 , n00 ). This latter inequality is exactly what is
required for showing that f is O(h). 2
Translate this English proof into a step-by-step proof in the style of Example 13, p. 77. Use the rules of
inference in Table 1, p. 72 and Table 2, p. 76. Two properties of the natural numbers will be needed,
which you may use without proof:
(property of max) m n x (x max(m, n) x m x n)
(monotonicity of multiplication) a b c (a b ca cb)
2. Rosen Ex. 16 p. 91. Use the following definitions: An integer x is odd if y (x = 2y + 1) and even if it is
not odd. State the theorem in Ex. 16 p. 91 of Rosen formally and give proofs in (a) English, in the style
of Theorem A of Ex. 1 above, and (b) the style of Example 13, p. 77, using the rules of inference in Table
1, p. 72 and Table 2, p. 76. You may use elementary properties of the natural numbers without proof,
but say what properties you are using and where you use them.
3. A few lectures ago, I stated the following metatheorem in class:
Theorem B Let p and q be propositions. The following are equivalent:
(i) p q is a tautology
(ii) p p q
(iii) p q q.
When one says The following are equivalent, it means that any pair are equivalent; that is, for any pair
of them, say P and Q, we have P implies Q and Q implies P . In proofs of theorems like this, one often
sees the proof broken into three paragraphs, usually labeled something like (i) (ii), (ii) (iii), and (iii)
(i), respectively (or some other circular order). In the paragraph labeled (i) (ii), one would prove
that the statement labeled (i) implies the statement labeled (ii), and correspondingly for the others.
(a) Justify this proof method. Why is showing that (i) (ii), (ii) (iii), and (iii) (i) sufficient to
show that all pairs are equivalent?
(b) Give a formal proof of Theorem B in this style. (Hint. For (i) (ii), do a case argument, considering
the possible truth values of p and q.)

1/2

CS2800 Fall 2013

Homework 2

2/2

4. (a) Prove that x y P (x, y) y x P (x, y).


(b) Give a counterexample showing that the converse does not always hold.
5. Consider the following proof that 1 = 2:
Let a and b be real numbers, and assume that
a = b.

(1)

We can multiply both sides of this equation by a to conclude


a2 = ab.

(2)

We can transform this equation by adding a2 to each side:


a2 + a2 = a2 + ab.

(3)

a2 + a2 2ab = a2 + ab 2ab.

(4)

2(a2 ab) = 1(a2 ab).

(5)

Subtracting 2ab from each side yields

which simplifies to
Finally, we can cancel (a2 ab), thereby proving that 1 = 2.
This proof must be incorrect, since the conclusion is false.
(a) Describe the algebraic rules being used in each step. For example, the first step uses the fact that
for any x, y, and z, if x equals y, then zx must equal zy.
(b) Identify the invalid step.
6. The proof of Ex. 5 is stylistically excellent, but unfortunately wrong. In contrast, the following proof
is correct, but stylistically atrocious. It is a proof that there exist infinitely many primes.
Set of primes P = {p1 , p2 , } in order. | =divides
n, |P | > n. By contra
|P | n
N = p1 p2 pn + 1 =
(p1 |N ) (p2 |N ) (pn |N )
But
p1 6 |N
because remainder 1.
p2 6 |N
because remainder 1.
..
.
pn 6 |N
because remainder 1.
(p1 |N ) (p2 |N ) (pn |N ) (p1 |N ) (p1 |N ) (pn |N )
F
Qed.
Rewrite this proof in English, using good mathematical writing style. Use Theorem A of Ex. 1 as a model.
You may use without proof the fact that if N > 2 and N is not prime, then N is divisible by a prime
smaller than N .

You might also like