# MATH 302 – Discrete Mathematics – Section 501

```Dr. Timo de Wolff
Institute of Mathematics
www.math.tamu.edu/~dewolff/Spring16/math302.html
MATH 302 – Discrete Mathematics – Section 501
Midterm 1 Preparation Homework
Spring 2016
Exercise 1. Let S := {a1 , . . . , an } be a set of real numbers with n ≥ 2. Write a pseudocode
that returns the two largest elements of S.
Exercise 2. Recall the BubbleSort algorithm from the lecture. Sort the list (9, 7, 3, 8) with
this algorithm step by step.
Exercise 3. Show the following statements are true:
1. 3x2 + 4x − 5 is Θ(x2 ).
2. n! is O(nn )
You may use that xn+m ≥ xn for every n, m ∈ N&gt;0 and every x &gt; 0. Recall that n! :=
n &middot; (n − 1) &middot; (n − 2) &middot; &middot; &middot; 2 &middot; 1.
Exercise 4. Show the following:
1. (A ∧ B) ↔ &not;(&not;A ∨ &not;B) is a tautology.
2. (A → B) ↔ &not;(&not;A ∨ B) is a contradiction.
3. (A ∧ B) → (&not;C ∨ &not;D) ↔ &not;(A ∧ B) ∨ &not;(C ∧ D) is a tautology.
4. ∀x, y : P (x) ∧ Q(y) ∀x[P (x)] ∧ ∀y[Q(y)].
Exercise 5. Consider the following predicates: R(x, y) := “run faster than”, E(x, y) :=
“wants to eat”, D(x) := “live in the desert” and let our domain be the set of animals.
1. Translate the following sentences into a proposition using quantifiers (if needed).
(a) “Wile E. Coyote does not run faster than the Road Runner.”
(b) “Every animal that lives in the desert does not run faster than the Road Runner.”
(c) “For every animal there is an animal that wants to eat it [the second one] although it does not run faster than it.”
1
(d) “Wile E. Coyote wants to eat every animal that runs faster than himself or lives
in the desert.”
Exercise 6. In propositional logic we have the connectives “&not;”, “∧”, “∨”, “→”, “↔”
and 6↔“. But we do not need all these connectives to be able to define an equivalent logical
system. Show that excluding the connective ”→“ from our language defines an equivalent
logical system.
Exercise 7. An integer k ∈ Z can be written as a sum of three squares if there exist
integer s1 , s2 , s3 ∈ Z such that
k = s21 + s22 + s23 .
Prove that not every integer can be written as a sum of three squares.
Exercise 8. Assume the following three propositions are true:
1. “If algebraic geometry is not easy to learn then discrete math is the best mathematical
subject.”
2. “Stochastics give you an advantage on the job market.”
3. “Stochastics do not give you an advantage on the job market or algebraic geometry
is not easy to learn and calculus is related to physics.”
Formalize the statements in propositional logic and conclude that they imply the statement
“Discrete math is the best mathematical subject.”.
Exercise 9. Let S := {s1 , . . . , sk }, T := {t1 , . . . , tr } be sets with k, r ≥ 10.
1. Prove that S ⊆ S and ∅ ⊆ S.
2. Which of the following sets are subsets of the cartesian product S &times; T ? Explain your
(a) {(s1 , t3 ), (s2 , t2 )},
(b) {{s1 , t3 }, {s2 , t2 }},
(c) {s1 , t3 , s2 , t2 },
(d) {(∅, t1 )},
(e) {s ∈ S : s ∈ T } &times; {t ∈ T : t ∈ S}.
Exercise 10. Let U be the universe of objects and let A, B, C ⊆ U be sets.
1. Show that A ⊆ C and B ⊆ C implies A ∪ B ⊆ C.
2. We define the complement Ac ⊆ U of A as
∀x : x ∈ Ac ↔ x ∈
/ A.
Prove that A ∪ Ac = U.
2
```