Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Translating Sentences into Logical Expressions and Solving Puzzles - Prof. Alper Ungor, Assignments of Computer Science

A series of lectures notes from the cot3100: propositional equivalences course taught by alper ¨ung"or in january 2007. The notes cover various topics related to propositional logic, including translating natural language sentences into logical expressions, solving puzzles using propositional logic, and understanding tautologies, contradictions, and equivalences. The notes provide examples and explanations of how to apply these concepts, as well as truth tables to determine logical equivalences.

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-ve3
koofers-user-ve3 🇺🇸

10 documents

1 / 17

Toggle sidebar

Related documents


Partial preview of the text

Download Translating Sentences into Logical Expressions and Solving Puzzles - Prof. Alper Ungor and more Assignments Computer Science in PDF only on Docsity! COT3100: Propositional Equivalences 1 Logic and Proofs Alper Üngör Jan 2007 COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 2 1 – Translating from Natural Languages EXAMPLE. Translate the following sentence into a logical expression: “I met my ex-girlfriend today and either she grew taller or I got shorter.” p = “I met my ex-girlfriend today.” q = “She grew taller.” r = “I got shorter.” p ∧ (q ∨ r) p ∧ q ∨ r would mean something else: “I got shorter or I met my ex-girlfriend today and she grew taller” p ∧ (q ⊕ r) would also mean something else... COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 5 Let p= “Alice is a knight.” ¬p= “Alice is a knave.” Let q= “Bob is a knight.” ¬q= “Bob is a knave.” Alice said q and Bob said p ⊕ q. Island Rule: Alice is a knight iff what she said is true and Bob is a knight iff what he said is true. (p ↔ q) ∧ (q ↔ (p ⊕ q)) Alice said Bob said Island rule p q ¬p ¬q p ⊕ q (p ↔ q) ∧ (q ↔ (p ⊕ q)) T T F F F F T F F T T F F T T F T F F F T T F T Hence, Both Alice and Bob are knaves. COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 6 3 – Tautology and Contradiction A compound statetement that is always true is called a tautology. A compound statetement that is always false is called a contradiction. A compound proposition that is neither a tautology nor a contradiction is called a contingency COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 7 4 – Equivalence The compound propositions p and q are called logically equivalent, denoted by p ≡ q, if p ↔ q is a tautology. Remark: The symbol ≡ is not a logical connective and p ≡ q is not a compound proposition but rather is the statement that p ↔ q is a tautology. Use truth tables to determine logical equivalences. Two compound propositions are equivalent if their columns in the truth table are the same. COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 10 6 – Equivalence Example EXAMPLE. “If you are a freshman you can get a free ticket” “Either you are not a freshman or you can get a free ticket.” COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 11 7 – Distributive Law p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 12 Equivalence Name p ∧ T ≡ p Identity Laws p ∨ F ≡ p p ∨ T ≡ T Domination Laws p ∧ F ≡ F p ∨ p ≡ p Idempotent Laws p ∧ p ≡ p ¬(¬p) ≡ p Double Negation Law p ∨ q ≡ q ∨ p Commutative Laws p ∧ q ≡ q ∧ p COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 15 COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 16 8 – Constructing new equivalences EXAMPLE. Show that ¬(p → q) and p ∧ ¬q are logically equivalent. ¬(p → q) ≡ ¬(¬p ∨ q) (See page 10 of these slides) ≡ ¬(¬p) ∧ ¬q (De Morgan’s Law) ≡ p ∧ ¬q (Double negation) COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör COT3100: Propositional Equivalences 17 9 – Proving a Tautology EXAMPLE. Show that (p ∧ q) → (p ∨ q) is a tautology. (p ∧ q) → (p ∨ q) ≡ ¬(p ∧ q) ∨ (p ∨ q) (See page 10 of these slides) ≡ (¬p ∨ ¬q) ∨ (p ∨ q) (De Morgan’s Law) ≡ (¬p ∨ ¬q ∨ p) ∨ q (Associative Law) ≡ (¬p ∨ p ∨ ¬q) ∨ q (Commutative Law) ≡ (¬p ∨ p) ∨ (¬q ∨ q) (Associative Law) ≡ T ∨ T (Negation Law) ≡ T COT3100: Applications of Discrete Structures Jan 2007 Alper Üngör