Você está na página 1de 4

Discrete Structures – Fall 2018 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

c) Check whether these are equivalent?


𝑝 → (𝑞 → 𝑟) and (𝑝 → 𝑞) → 𝑟

𝒑 𝒒 (𝒑 → 𝒒) 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

So, the two relations are not equivalent.

d) Check whether these are equivalent?


𝑝 → 𝑞 ⋁𝑟 , 𝑝 ⋀¬𝑞 → 𝑟, 𝑝 ⋀ ¬𝑟 → 𝑞
Discrete Structures – Fall 2018 Assignment-02 Solution

𝒑 𝒒 r 𝒒 ⋁𝒓 𝒑 → 𝒒⋁𝒓 ¬𝒒 𝒑⋀¬𝒒 𝒑⋀¬𝒒 ¬𝒓 𝒑⋀¬𝒓 𝒑⋀¬𝒓


→𝒓 →𝒒
0 0 0 0 1 1 0 1 1 0 1
0 0 1 1 1 1 0 1 0 0 1
0 1 0 1 1 0 0 1 1 0 1
0 1 1 1 1 0 0 1 0 0 1
1 0 0 0 0 1 1 0 1 1 0
1 0 1 1 1 1 1 1 0 0 1
1 1 0 1 1 0 0 1 1 1 1
1 1 1 1 1 0 0 1 0 0 1

So, the three relations are logically equivalent.

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)

𝒑 → 𝒒⋁𝒓 : If 𝒏 is prime, then 𝒏 is odd or 𝒏 is 2.


𝒑⋀¬𝒒 → 𝒓 : If 𝒏 is prime and 𝒏 is not odd, then 𝒏 is 2.
𝒑⋀¬𝒓 → 𝒒 : If 𝒏 is prime and 𝒏 is not 2, then 𝒏 is odd.

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.

Problem 4 – (Puzzle of Knights and Knaves)


In an island, there live two types of people: KNIGHTS, who always tell the truth, and KNAVES, who always lie.
Discrete Structures – Fall 2018 Assignment-02 Solution

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 W: Suppose W is knight, so there could be 1, 2 or 3 knights.


X cannot be knight as per his statement. Y can be knight. If Z is knight (exactly one knight), then W cannot be
knight. If Z is knave, then things are fine (W and Y are knights).

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.

B. Write converse of above three statements.


a) ∀ real numbers 𝑥, if 𝑥 > 0, then 𝑥 2 ≥ 1.
b) ∀𝑥 ∈ ℝ, if 𝑥 > 0 or 𝑥 < −1, then 𝑥(𝑥 + 1) > 0.
c) ∀ integers 𝑎, 𝑏, 𝑐, if 𝑎 − 𝑐 is even, then 𝑎 − 𝑏 is even and 𝑏 − 𝑐 is even.

C. Write contrapositive of above three statements.


a) ∀ real numbers 𝑥, if 𝑥 ≤ 0, then 𝑥 2 < 1.
b) ∀𝑥 ∈ ℝ, if 𝑥 ≤ 0 and 𝑥 ≥ −1, then 𝑥(𝑥 + 1) ≤ 0.
c) ∀ integers 𝑎, 𝑏, 𝑐, if 𝑎 − 𝑐 is odd, then 𝑎 − 𝑏 is odd or 𝑏 − 𝑐 is odd.

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 𝐶.

b) ∃ a book 𝑏 such that ∀ people 𝑝, 𝑝 has read 𝑏.


Statement: There is a book that all people have read.
Negation: ∀ books 𝑏, ∃ a person 𝑝 such that 𝑝 has not read 𝑏.

c) ∀ odd integers 𝑛, ∃ an integer 𝑘, such that 𝑛 = 2𝑘 + 1.


Statement: For every odd integer 𝑛, we can find another integer 𝑘 such that 𝑛 = 2𝑘 + 1.
Negation: ∃ an odd integer 𝑛, such that ∀ integers 𝑘, 𝑛 ≠ 2𝑘 + 1.

Você também pode gostar