Practice Problem Set 1 (Solution, Updated on 2024.10.19) (1)
Practice Problem Set 1 (Solution, Updated on 2024.10.19) (1)
(a) Please provide the conjunctive normal form and disjunctive norm form that are
equivalent to p ↔ q, respectively. (Proofs are not needed.)
(b) Please provide the conjunctive normal form and disjunctive norm form that are
equivalent to ¬((p → ¬q) → r), respectively. (Proofs are asked in the next
parts.)
(c) Please use truth table to show that the original statement and the conjunctive
normal form in (1b) are logical equivalent.
(d) Please use propositional algebra to show that the original statement and the
disjunctive normal form in (1b) are logical equivalent.
Solution:
(d)
¬((p → ¬q) → r)
≡ ¬((¬p ∨ ¬q) → r)
≡ ¬(¬(¬p ∨ ¬q) ∨ r)
≡ (¬p ∨ ¬q) ∧ ¬r
≡ (¬p ∧ ¬r) ∨ (¬q ∧ ¬r)
1
(a) equivalent to (¬p ∧ ¬q) → (¬r ∧ s) using connectives ¬ and ∨ only.
(b) equivalent to p ↔ ¬q using connectives ¬ and ∧ only.
(c) equivalent to (p ∧ q) ∨ (r ∧ s) using connectives ¬ and → only.
Solution:
(a)
(b) Solution 1:
p ↔ ¬q
≡ (p ∧ ¬q) ∨ (¬p ∧ q)
≡ ¬(¬(p ∧ ¬q) ∧ ¬(¬p ∧ q))
Solution 2:
p ↔ ¬q
≡ (p ∨ q) ∧ (¬p ∨ ¬q)
≡ ¬(¬p ∧ ¬q) ∧ ¬(p ∧ q)
(p ∧ q) ∨ (r ∧ s)
≡ ¬(p ∧ q) → (r ∧ s)
≡ (¬p ∨ ¬q) → ¬(¬r ∨ ¬s)
≡ (p → ¬q) → ¬(r → ¬s)
3. We call a set of connectives adequate if the connectives in the set are sufficient to
express every possible propositional formula. It is easy to see that S = {¬, ∨, ∧} is an
adequate set of connectives, because every possible propositional formula corresponds
to a truth table and the truth table can be uniquely represented in DNF which consists
of only connective ¬, ∨, and ∧.
(a) Please prove or disprove that P = {¬, ∧} is an adequate set of connectives. (Hint:
to prove a set is adequate, it is sufficient to prove that we can use the connectives
in the set to replace all connectives in another adequate set.)
(b) Please prove or disprove that Q = {¬, ↔} is adequate.
2
Solution:
(a) Yes, P is an adequate set. What remains to do is to prove that ∧ can be expressed
by ¬ and ∨. And this is obvious: A ∧ B ≡ ¬(¬A ∨ ¬B)
(b) No. We’ll show that ∨ can not be expressed by the given operators.
a ∨ b ≡ ab + a + b (mod 2), ¬a ≡ a + 1 (mod 2), and a ↔ b ≡ a + b + 1 (mod 2).
If a ∨ b can be expressed using ¬ and ↔, it means that there exist constants c1 ,
c2 , c3 such that ab + a + b ≡ c1 a + c2 b + c3 (mod 2) for all possible a, b. By
setting a, b to be 0 and 1, we can establish the following equation: c1 +c2 +c3 ≡ 1
(mod 2), c2 + c3 ≡ 1 (mod 2), c1 + c3 ≡ 1 (mod 2), c3 ≡ 0 (mod 2). But there
is no solution for the equations.
4. Let P (x), Q(x, y), R(x, y) be the statements “x is a leaf”,“x and y look alike”, “x ̸=
y”(x and y do not refer to the same thing). Express each of the following statements
using quantifiers, logical connectives and P (x), P (y), Q(x, y), R(x, y).
(a) For any two different leaves, they do not look alike.
(b) There do not exist two different leaves that look alike.
(c) Are (4a) and (4b) logical equivalent? If yes, give the proof.
Solution:
5. Please simplify the following expressions, and make sure that each of the sets A, B,
and C appears at most once in each simplified expression:
Solution:
3
(a)
((A ∪ B) ∩ B) − (A ∪ B)
= ((A ∪ B) ∩ B) ∩ (A ∪ B)
= ((A ∪ B) ∩ (A ∪ B)) ∩ B
= Ø∩B
= Ø
(b)
((A ∪ B ∪ C) − (B ∪ C)) ∪ A
= ((A ∪ B ∪ C) ∩ (B ∪ C)) ∪ A
= ((A ∪ (B ∪ C)) ∩ (B ∪ C)) ∪ A
= ((A ∩ (B ∪ C)) ∪ ((B ∪ C) ∩ (B ∪ C))) ∪ A
= ((A ∩ (B ∪ C)) ∪ Ø) ∪ A
= (A ∩ (B ∪ C)) ∪ A
= A
(c)
(B − (A ∩ C)) ∪ (A ∩ B ∩ C)
= (B ∩ (A ∩ C)) ∪ (A ∩ B ∩ C)
= (B ∩ (A ∩ C)) ∪ (B ∩ (A ∩ C))
= B ∩ ((A ∩ C) ∪ (A ∩ C))
= B∩U
= B
(d)
(A ∩ B) − (C − (A ∪ B))
= (A ∩ B) ∩ (C ∩ (A ∪ B))
= (A ∩ B) ∩ (C ∪ (A ∪ B))
= ((A ∩ B) ∩ C) ∪ ((A ∩ B) ∩ (A ∪ B))
= ((A ∩ B) ∩ C) ∪ (((A ∩ B) ∩ A) ∪ ((A ∩ B) ∩ B))
= ((A ∩ B) ∩ C) ∪ ((A ∩ B) ∪ (A ∩ B))
= ((A ∩ B) ∩ C) ∪ (A ∩ B)
= A∩B
4
6. For the set S = {0, 1, 2, 3}, give the relation sets determined by the following relations
respectively:
(a) aR1 b if a + b = 3;
(b) aR2 b if a − b ≡ 0 (mod 2);
(c) aR3 b if a ≤ b;
(d) aR4 b if a + b ≤ 4;
(e) aR5 b if max{a, b} = 3.
Solution:
Solution:
5
(c) The proposition is false. Consider the following counterexample:
Let A = {a, b, c, d, e} and define R and S as follows:
R = {(a, d), (b, e)}
S = {(d, b), (e, c)}
Both R and S are transitive relations.
However, R ◦ S = {(a, b), (b, c)}, which is not transitive.
(d) The proposition is false. Consider the following counterexample:
Let A = {a, b, c} and define R and S as follows:
R = {(a, a), (b, b), (c, c), (a, b), (b, a)}
S = {(a, a), (b, b), (c, c), (b, c), (c, b)}
Both R and S are equivalent relations.
However, R ◦ S = {(a, a), (b, b), (c, c), (a, c)}, which is not symmetric. Therefore,
R ◦ S is not equivalent relation.
Solution:
x2 x2
(a) f ◦ g(x) = 4 + x + 1; g ◦ f (x) = 2 + x + 12 .
(b) Function f is not bijective. It is easy to see that f is symmetirc with axis of
symmetry x = −1, which means, for any value k > 0, f (−1 + k) = f (−1 − k).
Therefore f is not injective.
Function g is bijective, and its inverse function is g −1 (x) = 2x. We first prove
taht g is injective. For ∀a, b ∈ R, if g(a) = g(b), then a2 = 2b . We can easily see
that a = b. Then we prove that g is surjective. For any value in g’s domain, i.e.,
∀a ∈ R, we can always find a value b = 2a in its range, i.e., ∃b = 2a ∈ R such
that f (b) = a.
6
Therefore, ((m + 1)3 − (m + 1)) mod 3 = 0. We then have that the statement holds
for n = m + 1.
(i) () ∈ S;
(ii) If x ∈ S, (x) ∈ S;
(iii) If x, y ∈ S, (xy) ∈ S;
(iv) Only the symbol string obtained by using 10i, 10ii, or 10iii for finite number of
times belongs to set S.
Are the following symbol strings in set S? Please also give your explanations, i.e.,
if no, you should explain why it cannot be in S; if yes, you should show how it is
constructed step by step.
(a) ((())())
(b) (()())
(c) ()()
(d) (()()))
(e) ((()())())
Solution: