Professional Documents
Culture Documents
Propositional Logic
Propositional Logic
Rashidah Kasauli
Department of Networks
Block A, Level 3,Room 301
COCIS
1 Propositions
2 Logical Connectives
3 Logical Equivalence
Propositions
Propositions
Propositional variables
p ¬p
T F
F T
p q p∧q
T T T
T F F
F T F
F F F
Logical Operators: OR
Logical Operators: OR
p q p∨q
T T T
T F T
F T T
F F F
Exclusive Or (XOR)
Symbol: ⊕
p q p⊕q
T T F
T F T
F T T
F F F
p q p→q
T T T
T F F
F T T
F F T
Example
Let p = “I am elected” and q = “I will lower taxes”
p → q = “If I am elected, then I will lower taxes”
Consider all possibilities
Note that if p is false, then the conditional is true regardless of
whether q is true or false
Conditional Implication
Different ways to express a conditional statement
“if p, then q”
“p implies q”
“if p, q”
“p only if q”
“p is sufficient for q”
“a sufficient condition for q is p”
“q if p”
“q whenever p”
“q when p”
“q is necessary for p”
“a necessary condition for p is q”
“q follows from p”
Rashidah Kasauli BSE 1107 17 / 47
Logical Connectives
Example 1:
p = “It is below freezing”
q = “It is snowing”
1 It is below freezing and it is snowing p ∧ q
2 It is below freezing but not snowing p ∧ ¬q
3 It is not below freezing and it is not snowing ¬p ∧ ¬q
4 It is either snowing or below freezing (or both) p ∨ q
5 If it is below freezing, it is also snowing p ∧ ¬q
Translating to English...
Example 2:
Let p,q,r be the following propositions:
P =“it is raining”,
q =“the sun is shining”,
r =“there are clouds in the sky.”
Translate the following into logical notation , using p,q,r and the logical
connectives.
It is raining and the sun is shining.
If it is raining then there are clouds in the sky.
If it is not raining, then the sun is not shining and there are clouds in
the sky.
If there are no clouds in the sky, then the sun is shining.
x2 = x ∀x ∈ r
x2 = x ∃x ∈ r
Precedence of Operators
Examples
Tautology: p ∨ ¬p
¬(p ∧ q) ↔ (¬p) ∨ (¬q)
Contradiction: p ∧ ¬p
¬(¬(p ∧ q) ↔ (¬p) ∨ (¬q))
p ¬p p ∨ ¬p p ∧ ¬p
T F T F
F T T F
↔ ::= IFF
p q p↔q
T T T
T F F
F T F
F F T
↔ ::= IFF
p q p↔q
T T T
T F F
F T F
F F T
Note: P ↔ Q is equivalent to (P → Q) ∧ (Q → P)
↔ ::= IFF
p q p↔q
T T T
T F F
F T F
F F T
Note: P ↔ Q is equivalent to (P → Q) ∧ (Q → P)
Note: P ↔ Q is equivalent to (P → Q) ∧ (Q → P)
↔ ::= IFF
p q p↔q
T T T
T F F
F T F
F F T
Note: P ↔ Q is equivalent to (P → Q) ∧ (Q → P)
Note: P ↔ Q is equivalent to (P → Q) ∧ (Q → P)
Is the statement “x is an even number if and only if x 2 is an even
number” true?
Contrapositive
Statement: If you are a BSE year 1 student, then you are taking BSE 1107.
Contrapositive: If you are not taking MTH 3105, then you are not a BSE
year 2 student.
Proofs
Statement: If P, then Q.
Contrapositive: If ¬Q, then ¬P.
P Q P→Q ¬Q ¬P ¬Q → ¬P
T T T F F T
T F F T F F
F T T F T T
F F T T T T
P → Q ≡ ¬P ∨ Q ≡ Q ∨ ¬P ≡ ¬Q → ¬P
Logical Equivalences
Logical Equivalences....
Idempotent:
p ∧ p ≡ p and p ∨ p ∨ p
Identity:
p ∧ T ≡ p and p ∨ F ≡ p
Negation:
p ∨ ¬p ≡ T and p ∧ ¬p ≡ F
Universal bound:
p ∧ F ≡ F and p ∨ T ≡ T
Negations of T and F:
¬T ≡ F and ¬F ≡ T
DeMorgan’s Laws
¬(p ∨ q) ≡ ¬p ∧ ¬q
Example in English: It is not the case that Pete or Quincy went to
the store. ≡ Pete did not go to the store and Quincy did not go to
the store.
¬(p ∧ q) ≡ ¬p ∨ ¬q
Example in English: It is not the case that both Pete and Quincy
went to the store. ≡ Pete did not go to the store or Quincy did not
go to the store.
Proof by laws
Example
Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent by
developing a series of logical equivalences.
Proof by laws
Example
Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent by
developing a series of logical equivalences.
¬(p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) by the second DeMorgan law
≡ ¬p ∧ [¬(¬p) ∨ ¬q] by the first DeMorgan law
≡ ¬p ∧ (p ∨ ¬q) by the double negation law
≡ (¬p ∧ p) ∨ (¬p ∧ ¬q) by the second distributive law
≡ F ∨ (¬p ∧ ¬q) because ¬p ∧ p ≡ F
≡ (¬p ∧ ¬q) ∨ F by the commutative law for disjunction
≡ ¬p ∧ ¬q by the identity law for F
If then as Or
P → Q ≡?
If then as Or
P → Q ≡?
Idea 2: Look at the false rows, take the ”and” and negate
¬(P ∧ ¬Q)
p q p→q ≡ ¬P ∨ Q
T T T
If you don’t give me all your
T F F money, then I will kill you.
F T T
Either you give me all your
F F T
money or I will kill you (or
both).
Negation of If-Then
¬(p → q) ≡?
¬(p → q) ≡ ¬(¬P ∨ Q)
≡ P ∧ ¬Q)
Maths Vs English
Parent = If you don’t clean your room, then you can’t watch the DVD.
Let C = clean your room, D = watch a DVD
This sentence says ¬C → ¬D
In real life it also means C → D
So C ↔ D
Mathematician: if a number x greater than 2 is not an odd number, then
x is not a prime number.
This sentence says ¬O → ¬P
But ofcourse it doesnot mean O → P
Arguments
Valid Argument?
(P → Q), (Q → R), (R → P)
Is it valid?
P ∧Q ∧R
Modus Ponens
p q p→q p q
T T T T T
T F F T F
F T T F T
F F T F F
Assumptions
Modus Tollens
p q p→q ¬q ¬p
T T T F F
T F F T F
F T T F T
F F T T T
Assumptions
Rules of inference
Rules of inference....
p
p → (p ∨ q) Addition
∴p∨q
p∧q
(p ∧ q) → p Simplification
∴p
p
q
((p) ∧ (q)) → (p ∧ q) Conjunction
∴p∧q
p∨q
¬p ∨ r
((p ∨ q) ∧ (¬p ∨ r )) → (q ∨ r ) Resolution
∴q∨r
Exercise
The End