Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Assignment Sheet 1: logic in computer science

1. Translate the following Propositional Logic to English sentences.

Let: E=Lion is eating

H=Lion is hungry

a. E ⇒ ¬H
b. E ∧ ¬H
c. ¬(H ⇒ ¬E)
2. Let p stand for the proposition “I bought a lottery ticket” and q for “I won the jackpot”.
Express the following as natural English sentences:
A. ¬p
B. p ∨ q
C. p ∧ q
D. p ⇒ q
E. ¬p ⇒ ¬q
F. ¬p ∨ (p ∧ q)
3. Is (p → q) → [(p → q) → q] a tautology? Why or why not?
4. For each of the following propositions, construct a truth table and state whether the proposition is
valid or invalid. (For brevity, you can just write one truth table with many columns.)
A. p ∧ ¬p
B. p ∨ ¬p
C. (p ∨ ¬q) ⇒ q
D. (p ∨ q) ⇒ (p ∧ q)
E. (p ⇒ q) ⇔ (¬q ⇒ ¬p)
F. (p ⇒ q) ⇒ (q ⇒ p)
5. Determine if each statement below is true or false, and explain your reasoning.
A. It is possible for an implication and its contra positive to have different truth values.
B. If the statement q is true, then, for any statement p, the statement p → q is true.
C. If s1 → s2 is a contradiction, then so is its contra positive.
D. There are truth values for p and q such that p → q and q → p are both false.
E. (¬p ∨ q) ∧ ¬ (¬p ∨ q) is a contradiction.
F. If the statement P is a contradiction, then, for any statement q, the statement P → q is a
tautology.
G. If two statements are logically equivalent, then so are their negations
6. By writing truth tables for the premises and conclusion, determine whether the arguments are
valid.

(a)

Either John isn’t stupid and he is lazy, or he’s stupid.

John is stupid.

Therefore, John isn’t lazy.

(b)

The butler and the cook are not both innocent

Either the butler is lying or the cook is innocent

Therefore, the butler is either lying or guilty

7. Show that the two statements (p ∧ q) → r and (p → r) ∧ (q → r) are not logically equivalent.

8. Use truth tables to determine which of the following are equivalent to each other:
A. (P ∧ Q) ∨ (¬P ∧ ¬Q)
B. ¬P ∨ Q
C. (P ∨ ¬Q) ∧ (Q ∨ ¬P)
D. ¬(P ∨ Q)
E. (Q ∧ P) ∨ ¬P
9. Assume that a and b are integers. Consider the statements:
A. If c is a prime number such c divides ab, then c divides a or c divides b.
B. If c is a prime number such c divides ab, and c does not divide b, then c divides a.

Write the statements A and B in symbolic form and then show that they are logically
equivalent.

10. (a) Use any method to show that ¬ (p → q) ↔ (p ∧ ¬q) is a tautology.

(b) Use known logical equivalences to show that ¬ (p ↔ q) ⇔ (p ∨ q) ∧ (¬p ∨ ¬q).

11. Use known logical equivalences to show that (¬a → b) ∧ (¬b ∨ (¬a ∨ ¬b)) is logically equivalent
to ¬ (a ↔ b).
12. Use known logical equivalences to show that ¬ (p ↔ q) is logically equivalent to (p ∨q) ∧ (p →
¬q).
13. Use known logical equivalences to do each of the following.
A. Show p → (q ∨ r) ⇔ (p ∧ ¬q) → r.
B. Show ¬ (p ∨ q) ∨ (¬p ∧ q) ∨ ¬ (¬p ∨ ¬q) ⇔ ¬ (p ∧ ¬q).
C. Find an expression logically equivalent to ¬ (p ↔ q) that involves only ¬ and ∨.
14. Use any method to show the following argument is valid.

¬q ↔ ¬p

∴q

15. Show that the following argument is not valid.

p∨r

p∨q

∴q∨r

You might also like