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

Assignment 2: Logic And Sets Phan Trọng Hiếu - 103426489

The document is an assignment on logic and sets for a student named Phan Trọng Hiếu. It contains 7 questions involving sets, logic, relations, functions and circuits. The questions analyze student activities using Venn diagrams, translate statements between English and symbolic logic, identify functions and relations, simplify Boolean expressions for circuits, and draw and simplify circuit diagrams.

Uploaded by

Hiếu Phan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Assignment 2: Logic And Sets Phan Trọng Hiếu - 103426489

The document is an assignment on logic and sets for a student named Phan Trọng Hiếu. It contains 7 questions involving sets, logic, relations, functions and circuits. The questions analyze student activities using Venn diagrams, translate statements between English and symbolic logic, identify functions and relations, simplify Boolean expressions for circuits, and draw and simplify circuit diagrams.

Uploaded by

Hiếu Phan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

ASSIGNMENT 2 : LOGIC AND SETS

Phan Trọng Hiếu - 103426489

Questions
Sets
1. Student’s activities
a) Considering

 220 students joined a student club as “A”


 159 students ate at a café as “B”
 208 students went to a gym as “C”
 68 students joined a student club and ate at a café as “A ∩ B”
 126 students joined a student club and went to a gym as “A ∩ C”
 ? students ate at a café and went to a gym as “B ∩ C”
 32 students joined a student club, ate at a café and went to a gym as “A ∩ B ∩ C”
 101 students did not join a student club, ate at a café, or go to a gym => 465 – 101 = 164
students needs to be considered.
We have this formula based on the information:
|𝐴 ∪ 𝐵 ∪ 𝐶| = |𝐴| + |𝐵| + |𝐶| − |𝐴 ∩ 𝐵| − |𝐴 ∩ 𝐶| − |𝐵 ∩ 𝐶| + |𝐴 ∩ 𝐵 ∩ 𝐶|
 364 = 220 + 159 + 208 − 68 − 126 − |𝐵 ∩ 𝐶| + 32
 364 = 425 − |𝐵 ∩ 𝐶|
 |𝐵 ∩ 𝐶| = 61
The value need for the Venn diagram is 61 students ate at a café and went to a gym.
b) Values

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

c) Show the numerical expression:


i. Did not go to a gym:
58 + 36 + 62 + 101 = 257
ii. Joined a student club but did not eat at a café:
58 + 94 = 152
iii. Did one only of joined a student club, eat at a cafe or went to a gym:
58 + 62 + 53 = 173
d) Represent:
Considering:
- Joined a student club as “X”
- Ate at a café as “Y”
- Went to a gym as “Z”
i. Did not go to a gym nor eat at a café:
(𝑌 ∪ 𝑍) ‘
ii. Joined a student club and ate at a cafe but did not go to a gym.
- (𝑋 ∪ 𝑌) ∪ 𝑍 ‘
Logic
2.
a) Translate into English.
i. h ∧ (d ∨ a):
Huyen plays cricket and David or Adita plays esports.
ii. d → ¬a ∨ h:
David plays esports if Adita doesn’t not play esport or Huyen plays cricket
iii. ¬(h ∨ d)
Neither Huyen nor David play sports.
b) Translate into symbolic logic
i. If David plays esports, then Adita plays esports:
d→a
ii. Neither Adita nor David play esports:
¬(a ∨ d)
iii. Adita plays esports if and only if Huyen plays cricket and David plays esports:
a ↔ (h ∧ d)
3. If (height <= 100 or width > 10) and (height > 100 or width > 10) and height <= 100
If width > 10 and height <= 100
Height > 100 = a
Width > 10 = b
Height <= 100 = ¬a

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

 f : X → Y has 9 possible functions.


b) Functions in a) are injective:

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

b) Simplify the expression


𝐸 = (𝑧′ + 𝑦)𝑦𝑧
Distributivity3 𝐸 = 𝑧 ′ ∗ 𝑦𝑧 + 𝑦 ∗ 𝑦𝑧
Commutativity 𝐸 = 𝑧′ ∗ 𝑧 ∗ 𝑦 + 𝑦 ∗ 𝑦 ∗ 𝑧
Idempotent 𝐸 = 𝑧′ ∗ 𝑧 ∗ 𝑦 + 𝑦 ∗ 𝑧
Complements 𝐸 = 0 ∗ 𝑦 + 𝑦𝑧
Boundedness 𝐸 = 0 + 𝑦𝑧
Identity 𝐸 = 𝑦𝑧
c) simplified circuit compared to the original:

 Original Size: 4
 Original Depth: 3
 Simplified Size: 1
 Simplified Depth: 1

You might also like