Name: Muhammad Umar
Surname: Magsi
Roll No: 048
Batch: 19BS (IT)
Assignment Subject: Discrete structure
Department: Information Technology
Page | 1
Qno1: Find the bitwise OR, bitwise AND, and bitwise XOR of
each of these pairs of bit strings.
a. 101 1110, 010 0001 b. 1111 0000, 1010 1010
c. 00 0111 0001, 10 0100 1000 d. 11 1111 1111, 00 0000 0000
solutions:
a) 101 1110, 010 0001
OR AND XOR
111 1111 000 0000 111 1111
b) 1111 0000, 1010 1010
OR AND XOR
1111 1010 1010 0000 0101 1010
c) 00 0111 0001, 10 0100 1000
OR AND XOR
10 0111 1001 00 0100 0000 10 0011 1001
d) 11 1111 1111, 000 0000 0000
OR AND XOR
11 1111 1111 00 0000 0000 11 1111 1111
Page | 2
Qno2: Construct a truth table each of the followings.
A. (p ↔ q) ↔ (r ↔ s)
P Q R S ((P ↔ Q) ↔ (R ↔ S))
T T T T T
T T T F F
T T F T F
T T F F T
T F T T F
B. p → ¬q C. ¬p ↔ q
P Q (P → ¬Q) P Q (¬P ↔ Q)
T T F T T F
T F T T F T
F T T F T T
F F T F F F
D. (p → q) ∨ (¬p → q)
P Q ((P → Q) ∨ (¬P → Q))
T T T
T F T
F T T
F F T
E. (p → q) ∧ (¬p → q)
Page | 3
P Q ((P → Q) ∧ (¬P → Q))
T T T
T F F
F T T
F F F
Qno3. Let p and q be the propositions
P: I bought a lottery ticket this week.
Q: I won the million-dollar jackpot.
Express each of these propositions as an English sentence.
a) ¬p b) p ∨ q c) p → q d) p ∧ q e) p ↔ q f) ¬p → ¬q
g) ¬p ∧ ¬q h) ¬p ∨ (p ∧ q)
I did not buy a lottery ticket this week Negation of p
1 A
I bought a lottery ticket this week or won the million-dollar Disjunction of p and
2 B jackpot q
If I bought a lottery ticket this week, then I won the million- If, then statement
3 C dollar jackpot
I bought a lottery ticket this week and I won the million- Conjunction of p and
4 D dollar jackpot q
I bought a lottery ticket this week if and only if I won the Biconditional
5 E million-dollar jackpot Statement
If I did not buy a lottery ticket this week, then I will not win the An if, then statement
6 F million-dollar jackpot. and negate p and q
I did not buy a lottery ticket this week and I did not win the Conjunction and p and
7 G million-dollar jackpot. q are negated
I did not buy a lottery ticket this week and I bought a lottery Negation of p then a
8 H ticket this week or I did not win the million-dollar jackpot. conjunction. Then p
disjunction of negative
q
Page | 4