You are on page 1of 4

Discrete Mathematics (Math 271), Spring 2004 1

Midterm Exam with Solutions


1. Prove that for all distinct primes p and q and all integers a we have if p | a and q | a,
then (pq) | a. [5]

Proof. Let p and q be positive. (In a loose sense, p and q are distinct if |p| 6= |q|.)
The key ingredient here is that for all primes p and all integers u and v we have that
p | uv implies p | u or p | v.
By hypothesis we have p | a, so there exists an integer s such that a = ps. Moreover,
the hypothesis states that q | a, so q | ps. Since p and q are distinct, q - p, and thus
we have q | s. So there exists an integer t such that s = qt. Since a = ps, we have
a = pqt. Therefore, (pq) | a. 

2. Let A and B be sets, and let S : ∀ A, B : A ∪ B ⊆ A ∩ B −→ A = B. [10]

(a) State the negation of S.


¬S : ∃ A, B : A ∪ B ⊆ A ∩ B ∧ A 6= B.
(b) State the converse of S.
S̄ : ∀ A, B : A = B −→ A ∪ B ⊆ A ∩ B
(c) State the contrapositive of S.
S : ∀ A, B : A 6= B −→ A ∪ B * A ∩ B
(d) Prove or disprove S.
Claim: S is true.

Proof. We prove S by exploiting its contrapositive. Let A 6= B. Without loss


of generality, let A and B be such that there is some x (in the universe of A and
B) such that x ∈ A but x ∈ / B. Then clearly x ∈ A ∪ B but x ∈ / A ∩ B. Thus
A ∪ B cannot be subset of A ∩ B. (Recall that X ⊆ Y means ∀ x ∈ X : x ∈ Y, or,
equivalently x ∈ X −→ x ∈ Y.) Therefore, the contrapositive of S and thus S
itself is true. 

(e) Prove or disprove the converse of S.


Claim: S̄ is true.

Proof. We exploit two simple identities: A ∩ A = A and A ∪ A = A. If A = B


then, using those identities, we arrive at A ⊆ A, which is trivially true. 

3. Let A be a nonempty set, and let R be a relation on the powerset 2A of A such that
(X, Y) ∈ R if and only if X ⊆ Y or Y ⊆ X. Prove or disprove: R is an equivalence
relation. [5]

Claim: R is an equivalence relation.

Proof. We have to show that R is reflexive, symmetric, and transitive.

• We have X ⊆ X, so (X, X) ∈ R, and thus R is reflexive.


Discrete Mathematics (Math 271), Spring 2004 2

• X ⊆ Y or Y ⊆ X is equivalent to Y ⊆ X or X ⊆ Y, so if (X, Y) ∈ R, then also


(Y, X) ∈ R, and thus R is symmetric.
• Without loss of generality, let X, Y, Z be such that X, Y, Z 6= ∅, X ⊆ Y and Z ⊆ Y,
and X * Z and Z * X. Then X R Y and Y R Z, but X 6 R Z. Therefore, R is not
transitive.
It follows that R is not an equivalence relation. 

4. Let f and g be functions on R such that [10]


f(x) = x2 + x + 1 and g(x) = x − 1 .
(a) Compute (f ◦ g)(x)
(f ◦ g)(x) = (x − 1)2 + (x − 1) + 1 = x2 − x + 1
(b) Compute (g ◦ f)(x)
(g ◦ f)(x) = x2 + x + 1 − 1 = x2 + x = x(x + 1)
(c) Prove or disprove: f(x) is onto.
Claim: f(x) is not onto.
3
Proof. It is easy to check that x2 + x + 1 ≥ 4
for all x ∈ R. In particular, there
is no real x such that f(x) = 0. 
(d) Prove or disprove: (f ◦ g)(x) is onto.
Claim: (f ◦ g)(x) is not onto.
3
Proof. It is easy to check that x2 − x + 1 ≥ 4
for all x ∈ R. In particular, there
is no real x such that (f ◦ g)(x) = 0. 
(e) Prove or disprove: f(x) · g(x) is onto.
Claim: f(x) · g(x) is onto.
Proof. √We have f(x) · g(x) = (x2 + x + 1) · (x − 1) = x3 − 1. Now, for any y ∈ R,
set x = 3 y + 1; this has a real solution for all real y. 
(f) Prove or disprove: f(x) · g(x) is injective.
Claim: f(x) · g(x) is injective.
Proof. We have to show that ∀ x, y ∈ R : f(x)g(x) = f(y)g(y) −→ x = y.
(Remember question 3.(h) from Assignment 1?). So, let x3 − 1 = y3 − 1; this is
equivalent to x3 = y3 , and, over the reals, this is equivalent to x = y. (In fact,
x3 = y3 can be interpreted as x · x · x = y · y · y or as x · x · x = y · (−y) · (−y),
which is contradictory unless x = y = 0.) 
X
n
5. Let A(n) : 1 + 3 + 5 + · · · + (2n − 1) = (2k − 1) = n2 .
k=1

Prove by induction or by the well ordering principle that A(n) is true for all integers
n ≥ 1. [5]
Discrete Mathematics (Math 271), Spring 2004 3

Claim: A(n) is true for all n ≥ 1.

Proof. We use mathematical induction.


Pn
Base case: Consider n = 1, then we have n2 = 12 = 1 and k=1 (2k − 1) = 2 − 1 = 1.
Thus A(n) is true for n = 1.
I.H.: Let A(m) be true for some m ≥ 1.
We prove now that A(m) −→ A(m + 1). We have

X
m+1 X
m
(2k − 1) = (2m + 1) + (2k − 1)
k=1 k=1
2
= (2m + 1) + m by I.H.
2 2
= m + 2m + 1 = (m + 1)
P
Thus we have m+1k=1 (2k−1) = (m+1), which is A(m+1). Since A(m) −→ A(m+1)
and A(1) was true, this establishes the hypothesis for all n ≥ 1. 
 n
1 n
6. Let B(n) : 1+ ≥1+ .
2 2

Prove by induction or by the well ordering principle that B(n) is true for all integers
n ≥ 0. [5]

Claim: B(n) is true for all n ≥ 0.

Proof. We use the well ordering principle.


For the sake of contradiction, assume that there exists integers n such that B(n) is
false, i.e. (1 + 1/2)n < 1 + n/2. Let X be the set of these counterexamples (i.e. we
assume that X 6= ∅), and let x be the smallest such counterexample (this exists by the
well ordering principle if X is nonempty, as X ⊂ N).
We check first that x 6= 0 (this corresponds to the base case in mathematical induc-
tion). In fact, we have (1 + 1/2)0 = 1 and 1 + 0/2 = 1 so B(0) is true and thus
0∈/ X.
Since x ∈ X and x is the smallest element of X, we have x − 1 ∈ / X, i.e. B(x − 1) is
x−1
true, which is equivalent to (1 + 1/2) ≥ 1 + (x − 1)/2. However, by assumption
B(x) is false, i.e. (1 + 1/2)x < 1 + x/2. Now, we have
 x  x−1  
1 1 1
1+ = 1+ 1+
2 2 2
  
x−1 1
≥ 1+ 1+ since B(x − 1) is true
2 2
1 x−1 x−1
=1+ + +
2 2 4
x−1 x−1
>1+ +
2 4
Discrete Mathematics (Math 271), Spring 2004 4

now observe that 34 (x − 1) ≥ 12 x for x ≥ 1, so we get

x
≥1+
2
Thus, we have (1 + 1/2)x ≥ 1 + x/2, i.e. if B(x − 1) is true, then B(x) is also true,
contrary to the assumption. So x ∈ / X, and in fact, X is empty. So, there are no
counterexamples to B (in the given range), and therefore, B(n) is true for all n ≥ 0.


You might also like