Uploaded by Jeremy Vo

CS Homework Assignment

advertisement
1. Write each of the following conditional statements and the corresponding converse,
inverse, and contrapositive as English sentences in the form “if 𝒑, then 𝒒.”
a. Winning the lottery implies that you will become rich.
Original: If you win the lottery, then you will become rich.
Converse: If you become rich, then you will win the lottery.
Inverse: If you do not win the lottery, then you will not become rich.
Contrapositive: If you do not become rich, then you will not win the lottery.
b. I sneeze whenever I smell pepper.
Original: If I sneeze, then I smell pepper.
Converse: If I smell pepper, then I sneeze.
Inverse: If I do not sneeze, then I will not smell pepper.
Contrapositive: If I do no smell pepper, then I will not sneeze.
c. To make an omelette, it is necessary to break some eggs.
Original: If I break some eggs, then I will make an omelette.
Converse: If I make an omelette, then I break some eggs.
Inverse: If I do not break eggs, then I will not make an omelette.
Contrapositive: If I do not make an omelette, then I will not break some eggs.
2. Determine the truth value of each of the following statements if the domain consists of all
integers. If it is true, find a different domain for which it is false. If it is false, find a different
domain for which it is true. Justify your answer.
a. ∃𝒙(√𝒙 = 𝟎.𝟓)
False. Not one integer will satisfy the existential statement.
True when the domain consists of rational numbers. When x = ¼.
b. ∃𝒙(𝒙 + 𝒙 = 𝒙)
True when x = 0.
False when the domain consists of all positive integers
c. ∀𝒙(𝒙 𝐢𝐬 𝐞𝐢𝐭𝐡𝐞𝐫 𝐞𝐯𝐞𝐧 𝐨𝐫 𝐨𝐝𝐝)
False when x = 0.
True when the domain consists of all positive integers.
d. ∀𝒙(𝟏/𝒙 ≤ 𝟏)
False when x = 0.
True when the domain consists of all positive integers.
3. Let 𝑩(𝒙) be the statement “𝒙 is a barista,” 𝑪(𝒙) be the statement “𝒙 is a customer,” and
𝑺(𝒙, 𝒚) be the statement “𝒙 served a drink to 𝒚.” If the domain of 𝒙 and 𝒚 consists of all
people, express each of the following sentences in terms of 𝑩(𝒙), 𝑪(𝒙), 𝑺(𝒙, 𝒚), quantifiers,
and logical operators.
a. Some barista served every other barista a drink.
∃x∀y(B(x) ∧ (B(y) ∧ (x ≠ y) → S(x,y)))
b. There are two different customers who were served a drink by the same barista.
∃x∃y∀z(B(x) ∧ C(y) ∧ (((x = x) ∧ (z ≠ y)) → S(x,z)))
c. No customer served a drink to anyone.
∀x∀y(C(x) → ¬S(x,y))
d. There is a barista who served a drink to exactly one customer.
∃x∃y∀z(B(x) ∧ C(y) ∧ ((z ≠ y)) → ¬S(x,z)))
4. Use the laws of propositional logic to prove that the following compound propositions are
logically equivalent.
a. ¬(𝒑 ∧ 𝒒) ∧ ¬(𝒑 ∧ ¬𝒒) and ¬𝒑
¬(p ∧ q) ∧ ¬(p ∧ ¬q)
(¬p ∨ ¬q) ∧ (¬p ∨ q)
¬p ∨ (¬q ∧ q)
¬p ∨ F
¬p
b. (𝒑 ∧ ¬𝒓) → ¬𝒒 and (𝒑 ∧ 𝒒) → 𝒓
(p ∧ ¬r) → ¬q
¬(p ∧ ¬r) ∨ ¬q
(¬p ∨ r) ∨ ¬q
(¬p ∨ ¬q) ∨ r
¬(p ∧ q) ∨ r
(p ∧ q) → r
c. 𝒑 ↔ 𝒒 and ¬𝒑 ↔ ¬q
p↔q
(p → q) ∧ (q → p)
(¬p ∨ q) ∧ (¬q ∨ p)
(¬¬p ∨ ¬q) ∧ (¬¬ q ∨ ¬p)
(¬ p → ¬q) (¬q → ¬p)
¬ p ↔ ¬q
d. ¬(¬𝒑 ∨ ((¬𝒑 ∨ 𝒒) ∧ ¬𝒓)) and 𝒑 ∧ (𝒒 → 𝒓)
p ∧ ¬((¬p ∨ q) ∧ ¬𝒓)
p ∧ (¬(¬p ∨ q) ∨ 𝒓)
p ∧ ((p ∧ ¬q) ∨ 𝒓)
p ∧ ((r ∨ p) ∧ (r ∨ ¬q))
(p ∧ (r ∨ p)) ∧ (p ∧ (r ∨ ¬q))
((p ∧ r) ∨ (p ∧ p)) ∧ (p ∧ (r ∨ ¬q))
((p ∧ r) ∨ p) ∧ (p ∧ (r ∨ ¬q))
p ∧ (p ∧ (r ∨ ¬q))
(p ∧ p) ∧ (r ∨ ¬q)
p ∧ (r ∨ ¬q)
p ∧ (¬q ∨ r)
p ∧ (q → r)
5. Use the laws of propositional logic to prove that the following compound propositions are
tautologies.
a. 𝒑 → (𝒒 → 𝒑)
¬p ∨ (q → p)
¬p ∨ (¬q ∨ p)
(¬p ∨ ¬q) ∨ (¬p ∨ p)
(¬p ∨ ¬q) ∨ T
T
b. ((𝒑 → 𝒓) ∧ (𝒓 → 𝒒)) → (𝒑 → 𝒒)
((¬p ∨ r) ∧ (¬r ∨ q)) → (p → q)
6. Determine whether each of the following compound propositions is satisfiable or
unsatisfiable. Justify your answer.
a. (𝒑 ↔ 𝒒) ∧ (¬𝒑 ↔ 𝒒) is unsatisfiable
p
T
T
F
F
q
T
F
T
F
p↔q
¬p
¬p ↔ q
(p ↔ q) ∧ (¬p ↔ q)
T
F
F
T
F
F
T
T
F
T
T
F
F
F
F
F
b. ¬(𝒑 ∧ 𝒒) ∧ ¬(𝒑 ∧ ¬𝒒) ∧ ¬(¬𝒑 ∧ ¬𝒒) is satisfiable
p
F
q
T
¬p
T
¬q
F
¬(p ∧ q)
¬(p ∧ ¬q)
¬(¬p ∧ ¬q)
T
T
T
¬(p ∧ q) ∧ ¬(p ∧ ¬q) ∧ ¬(¬p ∧ ¬q)
T
c. (𝒑 ∨ 𝒒) ∧ (¬𝒑 ∨ 𝒒) ∧ (𝒑 ∨ ¬𝒒) ∧ (¬𝒑 ∨ ¬𝒒) is unsatisfiable
p
T
T
F
F
q
T
F
T
F
¬p
F
F
T
T
¬q
F
T
F
T
p ∨ q ¬p ∨ q p ∨ ¬q ¬p ∨ ¬q (p ∨ q) ∧ (¬p ∨ q) ∧ (p ∨ ¬q) ∧ (¬p ∨ ¬q)
T
T
T
F
F
T
F
T
T
F
T
T
F
T
F
F
T
T
T
F
d. (𝒑 → ¬𝒒) ∧ (¬𝒑 → 𝒒) ∧ (𝒒 → ¬𝒓) ∧ (𝒒 → 𝒓) ∧ (¬𝒒 → ¬𝒓) is satisfiable
p
T
q
F
r
F
(p → ¬q) ∧ (¬p → q) ∧ (q →
¬p ¬q ¬r p → ¬q ¬p → q q → ¬r q → r ¬q → ¬r ¬r) ∧ (q → r) ∧ (¬q → ¬r)
F T T
T
T
T
T
T
T
Download