DATE:21/NOV/ 2023
INFORMATION COMMUNICATION
TECHNOLOGY
ASSIGNMENT 1
Submitted By:
Shayan ullah
Reg no :
B23F0001SE033
Submitted to
________________________
Software Engineering
PAK-AUSTRIA Fachhochschule
Institute of Applied Sciences and Technology
Q.1:
Using Laws of Logic, state the following expressions are logical
equivalent.
~ (~ p ∧q) ∧(p ∨q) ≡ p
Statement:
~ (~ p ∧ q) ∧ (p ∨ q) ≡ p
Proof:
Step 1: Apply De Morgan's Law to negate the first expression:
~ (~ p ∧ q) ≡ ~~(p ∧ q) ≡ p ∨ ~q
Therefore, the expression becomes:
(p ∨ ~q) ∧ (p ∨ q) ≡ p
Step 2: Apply the distributive property of conjunction over disjunction:
(p ∨ ~q) ∧ (p ∨ q) ≡ (p ∧ p) ∨ (p ∧ ~q) ∨ (~q ∧ p) ∨ (~q ∧ q)
Since p ∧ p is equivalent to p, and ~q ∧ q is equivalent to false, we can simplify
further:
(p ∨ ~q) ∧ (p ∨ q) ≡ p ∨ (p ∧ ~q) ∨ (~q ∧ p)
Step 3: Apply the associative property and commutative property of conjunction:
p ∨ (p ∧ ~q) ∨ (~q ∧ p) ≡ p ∨ (~q ∧ p) ∨ (p ∧ ~q)
Step 4: Apply the distributive property of disjunction over conjunction:
p ∨ (~q ∧ p) ∨ (p ∧ ~q) ≡ (p ∨ ~q) ∨ (p ∨ p ∧ ~q)
Step 5: Apply the distributive property again and simplify:
(p ∨ ~q) ∨ (p ∨ p ∧ ~q) ≡ (p ∨ ~q) ∨ (p ∨ ~q)
Step 6: Apply the idempotent property of disjunction:
(p ∨ ~q) ∨ (p ∨ ~q) ≡ p ∨ ~q
Therefore, we have proven that the following expressions are logically equivalent:
~ (~ p ∧ q) ∧ (p ∨ q) ≡ p
Q2.
Let p and q are two propositional variables having bidirectional relations, i.e., p ↔ q
1. Using the laws of logical equivalence to state that following expressions are logical equivalent.
P ↔ q ≡ (p → q) ^ (q → p) ≡ (~q ^ ~p) ∨ (p ^ q)
Solution:
Statement 1:
Proof by De Morgan's Laws:
p ↔ q ≡ ~~(p ∧ ~q) ≡ (p ∧ ~p) ∨ (~q ∧ q) ≡ p ∨ q
(p → q) ^ (q → p) ≡ (p ∧ ~q) ∨ (~q ∧ p) ≡ p ∨ q
Therefore, p ↔ q is logically equivalent to (p → q) ^ (q → p).
Statement 2:
Proof by distributive property:
(p → q) ^ (q → p) ≡ (p ∧ ~q) ^ (q ∧ ~p) ≡ (p ∧ q) ∧ (~q ∧ ~p) ≡ (~q ∧ ~p) ∨ (p ∧ q)
Therefore, (p → q) ^ (q → p) is logically equivalent to (~q ∧ ~p) ∨ (p ∧ q).
Statement 3:
Proof by direct proof:
Assume (~q ∧ ~p) ∨ (p ∧ q).
2. Lista truth table to verify above equivalence.
Solution:
Statement 1:
p q p→q q→p (p → q) ^ (q → p) p↔q
T T T T T T
T F F T F F
F T T F F F
F F T T T T
Statement 2:
p q ~q ~p ~q ∧ ~p p∧q (~q ∧ ~p) ∨ (p ∧ q)
T T F F F T T
T F T F T F T
F T F T T F T
F F T T T F T
Statement 3:
p q ~q ~p ~q ∧ ~p p∧q (~q ∧ ~p) ∨ (p ∧ q) p
T T F F F T T T
T F T F T F T T
F T T F F F F F
F F T T T F T F
3. Draw a logic circuit which gives (~q ^ ~p) ∨ (p ^ q) at its output.
q
~q
(~q ^ ~p)
~p
P