0% found this document useful (0 votes)
9 views5 pages

CS 210 Assignment2 27100134

Uploaded by

arktic.tech1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

CS 210 Assignment2 27100134

Uploaded by

arktic.tech1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CS-210 Discrete Mathematics LUMS

CS-210 Homework 2
Meesum Ali Student ID: 27100134
21 September 2024

1 Problem 1
Collaborated with: X,Y,Z.

1. Since P represents the power set, so P (X ∩ Y ) is the set of all subsets of (X ∩ Y ). So, we can write it as:
A = P (X ∩ Y ) ={S | S ⊆ (X ∩ Y )}.
Similarly for B, we can write it as;
B = P (X) ∩ P (Y ) = {S | S ⊆ (P (X) ∩ P (Y ))}
Since A = P (X ∩ Y ) is the set of all subsets of X ∩ Y or S ⊆ (P (X) ∩ P (Y )), While on the other hand
B = P (X) ∩ P (Y ) is the set of all subsets of X and Y, (or S ⊆ X ∩ S ⊆ Y ).
Since a set S ⊆ (X ∩ Y ) is exactly the same as a set that is a subset of both X and Y, we can conclude:
P (X ∩ Y ) = P (X) ∩ P (Y ) or we can say that A = B.
Hence Proved.

2 Problem 2
Collaborated with: X,Y,Z.
We will start by applying gates in the numbering they’re mentioned.
1. Input: A
Output : A
2. Input: C
Output: C
3. Input: B, C
Output: B.C

4. Input: B, C
Output: B.C
5. Input: B,C
Output: B.C

6. Input: A, (B.C)
Output : A.(B.C)
7. Input: A, (B. C)
Output : A . (B. C)
8. Input: A, (B.C)
Output: A.(B.C)
9. Input: A.(B.C), A.(B.C)
Output: A.(B.C) + A.(B.C)

Meesum Ali: [email protected] 1


CS-210 Discrete Mathematics LUMS

10. Input: A.(B.C) + A.(B.C), A.(B.C)


Output: ( A.(B.C) + A.(B.C)) + A.(B.C)

Now we simplify the expressions:


(B.C).(A + A) + A.(B.C) (Distributive Laws)
(B.C).(T ) + A.(B.C) (Negation Laws)
And finally, the expression becomes:
(B.C) + A.(B.C) (Identity Laws)

B.(C + (A.C))(Distributive Laws)

B.((C + A).(C + C)) (Distribuitve Laws)

B.((C + A).T ) (Negation Laws)

B.(C + A) (Identity Laws)


The circuit diagram will be:

Figure 1: Image of new circuit.

3 Problem 3
Collaborated with: X,Y,Z.
1. From LHS and RHS:
(P → R) ∨ (Q → R) ≡ (P ∧ Q) → R
(¬P ∨ R) ∨ (¬Q ∨ R) ≡ ¬(P ∧ Q) ∨ R (Implication Laws)
(¬P ∨ ¬Q) ∨ R ≡ (¬P ∨ ¬Q) ∨ R (Distributive law on LHS and DeMorgan’s Law on RHS)
(¬P ∨ ¬Q) ∨ R ≡ (¬P ∨ ¬Q) ∨ R
Hence Proved.
2. From LHS and RHS:
P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R)
P ∧ (Q ∨ R) ≡ P ∧ (Q ∨ R) (Distributive Law)
Hence Proved.
3. The expression is:
¬[¬[(P ∨ Q) ∧ R] ∨ ¬Q] ≡ Q ∧ R
¬[¬(P ∨ Q) ∨ ¬R ∨ ¬Q] ≡ Q ∧ R (DeMorgan’s Law)

Meesum Ali: [email protected] 2


CS-210 Discrete Mathematics LUMS

¬[(¬P ∧ ¬Q) ∨ ¬R ∨ ¬Q] ≡ Q ∧ R (DeMorgan’s Law)


¬[(¬P ∧ ¬Q) ∨ ¬Q ∨ ¬R] ≡ Q ∧ R
¬[¬Q ∨ ¬R] ≡ Q ∧ R (Absorption Law)
[Q ∧ R] ≡ Q ∧ R
Hence Proved.

4. From LHS and RHS:


(P ∨ Q ∨ R) ∧ (P ∨ T ∨ ¬Q) ∧ (P ∨ ¬T ∨ R) ≡ P ∨ [R ∧ (T ∨ ¬Q)]
Taking LHS:
P ∨ [(Q ∨ R) ∧ (¬T ∨ R)] ∧ (P ∨ (T ∨ ¬Q)) (Distributive law)
P ∨ [(Q ∨ R) ∧ (¬T ∨ R) ∧ (T ∨ ¬Q)](Distributive law)
P ∨ [R ∧ (Q ∧ ¬T ) ∧ (T ∨ ¬Q)] (Distributive Law)
P ∨ [R ∧ (T ∨ ¬Q)] ∧ [(T ∨ ¬Q) ∧ (¬T ∨ Q)] (Distributive law)
P ∨ [R ∧ (T ∨ ¬Q)] ∨ [(T ∨ ¬Q) ∧ Q) ∧ ¬T ] (Distributive Law)
P ∨ [R ∧ (T ∨ ¬Q)] ∨ (T ∧ Q) ∨ (Q ∧ ¬Q)¬T (Distributive Law )
P ∨[R ∧ (T ∨ ¬Q)] ∨ [F alse ∧ (Q ∧ T ) ∧ ¬T ](Idempotentlaw)
P ∨[R ∧ (T ∨ ¬Q)] ∨ [(T ∧ Q) ∧ ¬T ] (Identity law)
P ∨ [R ∧ (T ∨ ¬Q)] ∨ [F alse ∧ Q] (Negation law)
P ∨ [R ∧ (T ∨ ¬Q)] ∨ F alse (Domination law)
P ∨ [R ∧ (T ∨ ¬Q)] (Identity law)
Hence L.H.S = R.H.S

4 Problem 4
Collaborated with: X,Y,Z.
1. We want to prove that :
(A ∪ B ∪ C)′ = A′ ∩ B ′ ∩ C ′
Let U be the universal set containing all possible elements relevant to sets A, B, and C.

Element A B C A′ B′ C′ A∪B∪C (A ∪ B ∪ C)′ A′ ∩ B ′ ∩ C ′


1 1 1 1 0 0 0 1 0 0

2 1 1 0 0 0 1 1 0 0

3 1 0 1 0 1 0 1 0 0

4 1 0 0 0 1 1 1 0 0

5 0 1 1 1 0 0 1 0 0

6 0 0 1 1 1 0 1 0 0

7 0 1 0 1 0 1 1 0 0

8 0 0 0 1 1 1 0 1 1

Table 1: Membership table for sets A, B, and C (4.1)

From the membership table, we can see that: (A ∪ B ∪ C)′ = A′ ∩ B ′ ∩ C ′


2. We want to prove that

((A ∩ B) ∪ (A′ ∩ C)) = (A ∩ B ′ ) ∪ (A′ ∩ C ′ )

Meesum Ali: [email protected] 3


CS-210 Discrete Mathematics LUMS

Element A B C A′ B′ C′ A∩B A′ ∩ C (A ∩ B) ∪ (A′ ∩ C)


1 1 1 1 0 0 0 1 0 1
2 1 1 0 0 0 1 1 0 1
3 1 0 1 0 1 0 0 0 0
4 1 0 0 0 1 1 0 0 0
5 0 1 1 1 0 0 0 1 1
6 0 1 0 1 0 1 0 0 0
7 0 0 1 1 1 0 0 1 1
8 0 0 0 1 1 1 0 0 0

Table 2: calculations for ((A ∩ B) ∪ (A′ ∩ C)) (4.2)

Let U be the universal set containing all possible elements relevant to sets A, B, and C.
Next, we need to compute the complement of ((A ∩ B) ∪ (A′ ∩ C)):


Element (A ∩ B) ∪ (A′ ∩ C) ((A ∩ B) ∪ (A′ ∩ C))
1 1 0
2 1 0
3 0 1
4 0 1
5 1 0
6 0 1
7 1 0
8 0 1

Table 3: ((A ∩ B) ∪ (A′ ∩ C))′ (4.3)

Now computing the right side (A ∩ B ′ ) ∪ (A′ ∩ C ′ ):

Element A B C A′ B′ C′ A ∩ B′ A′ ∩ C ′ (A ∩ B ′ ) ∪ (A′ ∩ C ′ )
1 1 1 1 0 0 0 0 0 0
2 1 1 0 0 0 1 0 0 0
3 1 0 1 0 1 0 1 0 1
4 1 0 0 0 1 1 1 0 1
5 0 1 1 1 0 0 0 0 0
6 0 1 0 1 0 1 0 1 1
7 0 0 1 1 1 0 0 0 0
8 0 0 0 1 1 1 0 1 1

Table 4: Calculations for (A ∩ B ′ ) ∪ (A′ ∩ C ′ ) (4.3)

Therefore, we conclude that:



((A ∩ B) ∪ (A′ ∩ C)) = (A ∩ B ′ ) ∪ (A′ ∩ C ′ )

3. First from LHS: (A\C) ∪ (B\C)


We say that there is an element x such that:
x ∈ (A\C) or x ∈ (B\C). This means the x ∈ / C and that x could be in A or B.
Therefore we can simplify the expression to:
x ∈ (A ∪ B)\C. Which is the RHS.
Thus we can say that (A\C) ∪ (B\C) ⊆ (A ∪ B)\C.

Meesum Ali: [email protected] 4


CS-210 Discrete Mathematics LUMS

Now from RHS:


Now consider an element y, such that y ∈ (A ∪ B) and y ∈ / C, then;
If y ∈ A and y ∈
/ C, then y ∈ A\C, or if y ∈ B and y ∈ / C, then we can say that:
y ∈ (A\C) ∪ (B\C), which follows that:
(A ∪ B)\ ⊆ (A\C) ∪ (B\C).
And since both sides are subsets of eachother, it follows that LHS = RHS.
4. The given equation is :
((A ∪ C) ∩ B)′ = B ′ ∪ (C ′ ∩ A′ )
From LHS:
= (A ∪ C)′ ∪ B ′ (DeMorgan’s Laws)
= B ′ ∪ (A ∪ C)′
= B ′ ∪ (A′ ∩ C ′ ) (DeMorgan’s Laws)
Hence Proved.
5. (((A ∪ B) ∩ C)′ ∪ B ′ )′ = B ∩ C
expanding the compliments on LHS:
= ( ((A ∪B) ∩ C)′ ∪ B ′ )′
= ( (A ∪B)′ ∪ C ′ ∪ B ′ )′ (DeMorgan’s Law)
= ((A′ ∩ B ′ ) ∪ C ′ ∪ B ′ )′ (DeMorgan’s Law)
= ((A′ ∩ B ′ ) ∪ B ′ ∪ C ′ )′
= (B ′ ∪ C ′ )′ (Absorption Law)
= B ∩ C (DeMorgan’s Law)
= R.H.S. Hence Proved.

Meesum Ali: [email protected] 5

You might also like