0% found this document useful (0 votes)
2 views

Practice Problem Set 1 (Solution, Updated on 2024.10.19) (1)

The document contains a series of problems and solutions related to discrete mathematics, focusing on logical forms, equivalences, and set operations. It covers topics such as conjunctive and disjunctive normal forms, adequate sets of connectives, quantifiers, relations, and function composition. Each section includes specific problems followed by detailed solutions demonstrating the application of mathematical principles.

Uploaded by

kkw91228
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Practice Problem Set 1 (Solution, Updated on 2024.10.19) (1)

The document contains a series of problems and solutions related to discrete mathematics, focusing on logical forms, equivalences, and set operations. It covers topics such as conjunctive and disjunctive normal forms, adequate sets of connectives, quantifiers, relations, and function composition. Each section includes specific problems followed by detailed solutions demonstrating the application of mathematical principles.

Uploaded by

kkw91228
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

COMP2121A: Discrete Mathematics

Practice 1 Please do NOT submit your answer.

1. Conjunctive normal form (CNF) is a conjunction of one or more clauses, where a


clause is a disjunction of literals; disjunctive normal form (DNF) is a canonical normal
form of a logical formula consisting of a disjunction of conjunctions. See https://
en.wikipedia.org/wiki/Conjunctive_normal_form and https://en.wikipedia.
org/wiki/Disjunctive_normal_form for formal definitions.

(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:

(a) CN F : (p ∨ ¬q) ∧ (¬p ∨ q); DN F : (p ∧ q) ∨ (¬p ∧ ¬q).


(b) CN F : (¬p ∨ ¬q) ∧ ¬r; DN F : (¬p ∧ ¬r) ∨ (¬q ∧ ¬r).
p q r p → ¬q (p → ¬q) → r ¬p ∨ ¬q ¬((p → ¬q) → r) (¬p ∨ ¬q) ∧ ¬r
T T T F T F F F
T T F F T F F F
T F T T T T F F
(c) T F F T F T T T
F T T T T T F F
F T F T F T T T
F F T T T T F F
F F F T F T T T

(d)

¬((p → ¬q) → r)
≡ ¬((¬p ∨ ¬q) → r)
≡ ¬(¬(¬p ∨ ¬q) ∨ r)
≡ (¬p ∨ ¬q) ∧ ¬r
≡ (¬p ∧ ¬r) ∨ (¬q ∧ ¬r)

2. Please give a statement that is:

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)

(¬p ∧ ¬q) → (¬r ∧ s)


≡ ¬(¬p ∧ ¬q) ∨ (¬r ∧ s)
≡ p ∨ q ∨ (¬r ∧ s)
≡ p ∨ q ∨ ¬(r ∨ ¬s)

(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)

(It may have different solutions.)


(c)

(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:

(a) ∀x∀y((P (x) ∧ P (y) ∧ R(x, y)) → ¬Q(x, y))


(b) ¬(∃x∃y(P (x) ∧ P (y) ∧ R(x, y) ∧ Q(x, y)))
(c) Yes, (4a) and (4b) are logical equivalent.

¬(∃x∃y(P (x) ∧ P (y) ∧ R(x, y) ∧ Q(x, y)))


≡ ∀x¬(∃y(P (x) ∧ P (y) ∧ R(x, y) ∧ Q(x, y)))
≡ ∀x∀y¬(P (x) ∧ P (y) ∧ R(x, y) ∧ Q(x, y))
≡ ∀x∀y(¬(P (x) ∧ P (y) ∧ R(x, y)) ∨ ¬Q(x, y))
≡ ∀x∀y((P (x) ∧ P (y) ∧ R(x, y)) → ¬Q(x, y))

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:

(a) ((A ∪ B) ∩ B) − (A ∪ B);


(b) ((A ∪ B ∪ C) − (B ∪ C)) ∪ A;
(c) (B − (A ∩ C)) ∪ (A ∩ B ∩ C);
(d) (A ∩ B) − (C − (A ∪ B)).

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:

(a) {(0, 3), (1, 2), (2, 1), (3, 0)}


(b) {(0, 0), (0, 2), (1, 1), (1, 3), (2, 0), (2, 2), (3, 1), (3, 3)}
(c) {(0, 0), (0, 1), (0, 2), (0, 3), (1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)}
(d) {(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (3, 0), (3, 1)}
(e) {(0, 3), (1, 3), (2, 3), (3, 0), (3, 1), (3, 2), (3, 3)}

7. If R ⊆ X × Y , S ⊆ Y × Z are two binary relations, then their composition R ◦ S is


defined as R ◦ S = {(x, z) ⊆ X × Z : ∃y ∈ Y such that (x, y) ∈ R and (y, z) ∈ S}.
Prove or disprove the following propositions.

(a) If R is a transitive relation defined on A, then R◦R is a transitive relation defined


on A.
(b) If R and S are two symmetric relations defined on A, then R ◦ S is a symmetric
relation defined on A;
(c) If R and S are two transitive relations defined on A, then R ◦ S is a transitive
relation defined on A;
(d) If R and S are two equivalent relations defined on A, then R ◦ S is an equivalent
relation;

Solution:

(a) The proposition is true. When (x, y) ∈ R ◦ R and (y, z) ∈ R ◦ R, we must


show that (x, z) ∈ R ◦ R. From the definition of ◦, we know that ∃y1 ∈ A s.t.
(x, y1 ) ∈ R and (y1 , y) ∈ R; ∃y2 ∈ A s.t. (y, y2 ) ∈ R and (y2 , z) ∈ R. Since R is
transitive, we know that (x, y) ∈ R and (y, z) ∈ R. Then we know (x, z) ∈ R ◦ R.
Therefore, R ◦ R is a transitive relation defined on A.
(b) The proposition is false. Consider the following counterexample:
Let A = {a, b, c} and define R and S as follows:
R = {(a, b), (b, a)}
S = {(b, c), (c, b)}
Both R and S are symmetric relations.
However, R ◦ S = {(a, c)}, which is not symmetric.

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.

8. Define operator ◦ on functions as: (f ◦ g)(x) = f (g(x)). Define f : R → R, f (x) =


x2 + 2x + 1; and g : R → R, g(x) = x2 .

(a) Please compute f ◦ g and g ◦ f , respectively;


(b) Please determine whether f and g are bijective functions, respectively. You
should show why they are bijective functions or why they are not. If there are
bijective functions, please also write their inverse functions. (Given a function
f (x) = y, its inverse function is f −1 (y) = x. Note that a function has inverse
function if and only if it is bijective.)

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.

9. Please use mathematical induction to prove that: ∀n ∈ Z+ , n3 ≡ n( mod 3), i.e.,


there exists an integer k such that n3 − n = 3 · k.
Solution: Base case: when n = 1, n3 − n = 0. Obviously 0 mod 3 = 0, hence
n3 ≡ n( mod 3) holds trivially.
Step case: Assume the statement holds when n = m where m ∈ Z+ . When n = m+1,
n3 − n = (m + 1)3 − (m + 1) = m3 + 3m2 + 2m = (m3 − m) + 3m(m + 1). According to
our assumption, (m3 −m) mod 3 = 0. Also, because m ∈ Z+ , 3m(m+1) mod 3 = 0.

6
Therefore, ((m + 1)3 − (m + 1)) mod 3 = 0. We then have that the statement holds
for n = m + 1.

10. Recusively define a set S which consists of symbol strings as follows:

(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:

(a) Yes. By 10i, () ∈ S. By 10ii, (()) ∈ S. By 10iii, (())() ∈ S. Finally by 10ii,


((())()) ∈ S.
(b) Yes.
(c) No. ()() cannot be obtained by the definition. The reason is that for (σ) ∈ S, it
must be the case that σ is one of the following cases: (i) σ is empty; (ii) σ ∈ S,
(iii) σ = xy for x, y ∈ S.
We can check that “σ =)(” does not satisfy the above three cases: (i) σ is not
empty, (ii) no string in S can begin with “)”.
(d) No. The left brackets and right brackets do not match.
(e) Yes.

You might also like