Assignment 02 Solution
Assignment 02 Solution
Problem 1 -
Write negation of the following statements
(Hint: recall De Morgan’s law ̅̅̅̅̅̅
𝐴⋁𝐵 = 𝐴̅ ⋀𝐵̅ and ̅̅̅̅̅̅
𝐴⋀𝐵 = 𝐴̅ ⋁𝐵̅ )
a) The train is late or my watch is fast
The train is not late and my watch is slow.
b) The connector is loose or the machine is unplugged
The connector is not loose and the machine is plugged.
c) This program has logical error in first 10 lines or it is being run by an incomplete data set
This program does not have a logical error in first 10 lines and it is being run by a complete data set
d) −2 < 𝑥 < 7
−2 ≥ 𝑥 or 𝑥 ≥ 7
e) 𝑥 < 2 or 𝑥 > 5
2≤𝑥≤5
f) 𝑥 ≤ −1 or 𝑥 > 1
−1 < 𝑥 ≤ 1
Problem 2 -
Use truth tables to verify the following are logically equivalent (parts a and b)?
a) 𝑝 → 𝑞 ≡ ¬𝑝 ⋁𝑞
𝒑 𝒒 ¬𝒑 𝒑→ 𝒒 ¬𝒑 ⋁ 𝒒
0 0 1 1 1
0 1 1 1 1
1 0 0 0 0
1 1 0 1 1
b) ¬(𝑝 → 𝑞) ≡ 𝑝 ⋀ ¬𝑞
𝒑 𝒒 ¬𝒒 𝒑→𝒒 ¬(𝒑 → 𝒒) 𝒑 ⋀ ¬𝒒
0 0 1 1 0 0
0 1 0 1 0 0
1 0 1 0 1 1
1 1 0 1 0 0
𝒑 𝒒 (𝒑 → 𝒒) r 𝒒→𝒓 𝒑 → (𝒒 → 𝒓) (𝒑 → 𝒒) → 𝒓
0 0 1 0 1 1 0
0 0 1 1 1 1 1
0 1 1 0 0 1 0
0 1 1 1 1 1 1
1 0 0 0 1 1 1
1 0 0 1 1 1 1
1 1 1 0 0 0 0
1 1 1 1 1 1 1
e) Using the equivalence in part (d), write the following statement in all three ways of part(d)
If 𝒏 is prime, then 𝒏 is odd or 𝒏 is 2.
Let p: 𝒏 is prime
q: 𝒏 is odd
r: 𝒏 is 2.
Then we may say, according to above relationships (part – d)
Problem 3 -
Write converse, inverse and contrapositive of each of the following statements:
a) If 𝑃 is a square, then 𝑃 is a rectangle.
b) If 𝑛 is prime, then 𝑛 is odd or 𝑛 is 2.
c) If 𝑛 is divisible by 6, then 𝑛 is divisible by 2 and 𝑛 is divisible by 3.
d) If Ch. Allah Ditta is Aslam’s father, then Ch Noor Khan is his Uncle and Salima Bibi is his aunt.
Converse:
a) If 𝑃 is a rectangle, then 𝑃 is a square.
b) If 𝑛 is odd or 𝑛 is 2, then 𝑛 is prime.
c) If 𝑛 is divisible by 2 and 𝑛 is divisible by 3, then 𝑛 is divisible by 6.
d) If Ch Noor Khan is Aslam’s Uncle and Salima Bibi is his aunt, then Ch. Allah Ditta is his father.
Inverse:
a) If 𝑃 is not a square, then 𝑃 is not a rectangle.
b) If 𝑛 is not prime, then 𝑛 is not odd and 𝑛 is not 2.
c) If 𝑛 is not divisible by 6, then 𝑛 is not divisible by 2 or 𝑛 is not divisible by 3.
d) If Ch. Allah Ditta is not Aslam’s father, then Ch Noor Khan is not his Uncle or Salima Bibi is not his aunt.
Contrapositive:
a) If 𝑃 is not a rectangle, then 𝑃 is not a square.
b) If 𝑛 is not odd and 𝑛 is not 2, then 𝑛 is not prime.
c) If 𝑛 is not divisible by 2 or 𝑛 is not divisible by 3, then 𝑛 is not divisible by 6.
d) If Ch Noor Khan is not Aslam’s Uncle and Salima Bibi is not his aunt, then Ch. Allah Ditta is not his
father.
You visit the island and meet a group of six natives, who speak to you as follows:
U says: None of us is a knight.
V says: At least three of us are knights.
W says: At most three of us are knights.
X says: Exactly five of us are knights.
Y says: Exactly two of us are knights.
Z says: Exactly one of us is a knight.
Which are knights and which are knave?
Examining statement of U: U cannot a knight. If he is knight it will contradict his statement. So U is knave, and
there are some knights
Examining statement of V: Suppose V is knight, then there could be 3 or 4 or 5 knights (one, U, has already been
found as knave).
Now if W is also knight, then there must be exactly 3 knights. But none of X, Y, Z can be knights then (as per their
statements). So if W is knave, then there could be 4 knights (6 – U and W). But statements of X, Y, and Z say
knights cannot be 4. So, we have to conclude V is also knave.
Examining statement of X: X is knave, as we have already found two, U and V, as knaves. We cannot have 5
knights. So X is knave.
Now there are 3 knaves.
If W is to be knave, then there mut be more than 3 knights, which is not possible now. So that means W is knight
and there are at most 3 knights.
If W is knight, then as per above discussion, Y is also knight.
Examining statement of Y: We have found Y is knight, then Z cannot be knight, and W should be knight.
Examining statement of Z: Since Y is knight, so Z has to be knave, as his statement contradicts Y’s statement.
Problem 5 -
Express the following statements using quantifiers, variables, and the predicates, with following information:
𝐷 is set of all students
𝑀(𝑠): 𝑠 is a math major student
𝐶(𝑠): 𝑠 is a computer science major student
𝐸(𝑠): 𝑠 is an engineering major student
a) There is an engineering student who is a math major.
∃𝑠 ∈ 𝐷 such that 𝐸(𝑠) ∧ 𝑀(𝑠).
b) Every computer science student is an engineering student.
∀𝑠 ∈ 𝐷, 𝐶(𝑠) → 𝐸(𝑠).
c) No computer science students are engineering student.
∀𝑠 ∈ 𝐷 such that 𝐶(𝑠) ∧ ¬𝐸(𝑠)
OR ∀𝑠 ∈ 𝐷 such that ¬( 𝐶(𝑠) → 𝐸(𝑠) )
d) Some computer science students are also math majors.
∃𝑠 ∈ 𝐷 such that 𝐶(𝑠) ∧ 𝑀(𝑠)
e) Some computer science students are engineering students and some are not.
∃𝑠 ∈ 𝐷 such that C(𝑠) ∧ ¬𝐸(𝑠).
OR ∃𝑠 ∈ 𝐷 such that C(𝑠) ∧ 𝐸(𝑠).
Discrete Structures – Fall 2018 Assignment-02 Solution
Problem 6 -
A. Write negation of each of the statements:
a) ∀ real numbers 𝑥, if 𝑥 2 ≥ 1, then 𝑥 > 0.
∃ real numbers 𝑥, such that 𝑥 ≥ 1 and 𝑥 ≤ 0. (recall: ̅̅̅̅̅̅̅̅
𝒑→𝒒≡𝒑∧𝒒 ̅)
b) ∀𝑥 ∈ ℝ, if 𝑥(𝑥 + 1) > 0, then 𝑥 > 0 or 𝑥 < −1.
∃𝑥 ∈ ℝ, such that 𝑥(𝑥 + 1) > 0, and both 𝑥 ≤ 0 and 𝑥 ≥ −1.
c) ∀ integers 𝑎, 𝑏, 𝑐, if 𝑎 − 𝑏 is even and 𝑏 − 𝑐 is even, then 𝑎 − 𝑐 is even.
∃ integers 𝑎, 𝑏, 𝑐, such that 𝑎 − 𝑏 is even and 𝑏 − 𝑐 is even, and 𝑎 − 𝑐 is not even.
Problem 7 -
Task1: Write each of the following statements in plain English, without using the symbols ∀ or ∃ or any variables
(as simple as possible)
Task2: Write negation of the following statements (in mathematical notation and in simple English)
a) ∀ colors 𝐶, ∃ an animal 𝐴 such that 𝐴 is colored 𝐶.
Statement: For every color, there is an animal of that color.
Negation: ∃ a color 𝐶, such that ∀ animals 𝐴, 𝐴 is not colored 𝐶.