Assignment 2: Logic And Sets Phan Trọng Hiếu - 103426489
Assignment 2: Logic And Sets Phan Trọng Hiếu - 103426489
Questions
Sets
1. Student’s activities
a) Considering
- Students joined a student club and ate at a café and not went to a gym:
68 – 32 = 36 (students)
- Students joined a student club and went to a gym and not ate at a café:
126 – 32 = 94 (students)
- Students ate at a café and went to a gym and not joined a student club:
61 – 32 = 29 (students)
- Student joined a student club only:
220 – (36 + 94 + 32) = 58 (students)
- Students ate at a café only:
159 – (29 + 36 +32) = 62 (students)
- Students went to a gym only:
208 – (29 + 94 + 32) = 53 (students)
Venn diagram:
(a ∨ b) ∧ (¬a ∨ b) ∧ ¬a
Distributive: b ∨ (a ∧ ¬a) ∧ ¬a
b ∨ F ∧ ¬a
Identity: b ∧ ¬a
Relations and functions
4. S = {(a, a),(b, b),(a, b),(b, a),(c, c),(d, d),(e, e),(c, e),(d, e),(e, c),(e, d)}
Reflexivity: (a, a), (b, b), (c, c), (d, d), (e, e)
Symmetry: (a, b), (b, a) ; (c, e), (e, c) ; (d, e), (e, d)
Transitivity: does not exist
=> Relation R is not an equivalence relation.
5. For the domain X={x, y} and co-domain Y={x, y, z}:
a) functions f : X → Y are possible:
Injective
Not injective
=> f : A → B has 6 functions are Injective.
c) Functions in a) are bijective?
There cannot be any bijective function. Because domain X has only 2 values but codomain Y has
3 values, which means there is at least one value in the codomain B that will always be
excessive.
Circuit
6.
i. determine the expression using Boolean algebra notation (do not excessively simplify):
a)
𝐸 = (𝐴 + 𝐵̅ ). 𝐵
= 𝐴𝐵 + 𝐵̅ 𝐵
= 𝐴𝐵
b)
𝐸 = (𝐴 + 𝐵)(𝐵 + 𝐶)(𝐴 + 𝐶)
= (𝐴𝐴 + 𝐴𝐶 + 𝐴𝐵 + 𝐵𝐶)(𝐵 + 𝐶)
= 𝐴𝐴𝐵 + 𝐴𝐴𝐶 + 𝐴𝐵𝐶 + 𝐴𝐶𝐶 + 𝐴𝐵𝐵 + 𝐴𝐵𝐶 + 𝐵𝐵𝐶 + 𝐵𝐶𝐶
= 𝐴𝐵 + 𝐴𝐶 + 𝐴𝐵𝐶 + 𝐴𝐶 + 𝐴𝐵 + 𝐴𝐵𝐶 + 𝐵𝐶 + 𝐵𝐶
= 𝐴𝐵 + 𝐴𝐶 + 𝐵𝐶 + 𝐴𝐵𝐶
ii. provide the output value when A is 1, B is 1 and all other inputs are 0. Justify your answer
using annotation or a truth table.
a)
𝐴 𝐵 𝐵̅ 𝐵𝐵̅ 𝐴𝐵
1 1 0 0 1
b)
𝐴 𝐵 𝐶 𝐴𝐵 𝐵𝐶 𝐴𝐶 𝐴𝐵𝐶 𝐴𝐵 + 𝐴𝐶 + 𝐵𝐶 + 𝐴𝐵𝐶
1 1 0 1 0 0 0 1
7.
a) Draw the circuit
Original Size: 4
Original Depth: 3
Simplified Size: 1
Simplified Depth: 1