T1.1 Propositional Logic
T1.1 Propositional Logic
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
A proposition is a declarative statement that is either true or false, but not
both.
Examples of sentences that are propositions:
1. Kuala Lumpur is the capital of Malaysia.
2. Superman can fly.
3. 1+5=9.
4. Tuesday is the day after Wednesday.
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
A proposition can be either TRUE or FALSE.
The TRUE or FALSE is known as the truth value for the proposition.
TRUE is abbreviated as T and FALSE is abbreviated as F.
The notation [[ ]] is used to indicate finding the truth value of a proposition.
Examples:
1. [[Kuala Lumpur is the capital of Malaysia]] = T
2. [[1+6=9]] = F
3. [[Tuesday is the day after Wednesday]] = ?
4. [[Superman can fly]] = ?
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Since propositions are naturally long, they are normally represented as, p, q,
r, s or some other alphabets.
Examples:
p : TMA1201 is a compulsory subject for students who major in Finance
at MMU.
q : You are sitting in this class to learn mathematical logic.
[[p]] =
[[q]] =
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Compound proposition is a term to describe two or more propositions
combined by logical connectives.
A TRUTH TABLE can display the relationships between the truth values of
the propositions when connected with these logical connectives.
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Negation is a connective “not” in English.
It is symbolized by “¬”.
The truth table of a negation operator for a proposition p is:
p ¬p
T F
F T
Example:
p: It is sunny.
¬p: It is not sunny.
The statement “It is not sunny.” is true only when the statement “It is
sunny.” is false.
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Conjunction is a connective “and” in English.
It is symbolized by “”.
The truth table of a conjunction operator for propositions p and q is:
p q pq
T T T
T F F
F T F
F F F
Example:
p: Today is Tuesday.
q: It is raining today.
p q: Today is Tuesday and it is raining today.
The statement “Today is Tuesday and it is raining today.” is true only when both
the statements “Today is Tuesday.” and “It is raining today.” are true. 8
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Disjunction is a connective “or” in English.
It is symbolized by “”.
The truth table of a disjunction operator for propositions p and q is:
p q pq
T T T
T F T
F T T
F F F
Example:
p: Mary likes jogging.
q: Mary likes dancing.
p q: Mary likes jogging or dancing.
The statement “Mary likes jogging or dancing” is true if Mary likes either
jogging or dancing. It is false only when Mary likes neither.
9
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Implication is a connective “if … then” in English.
It is symbolized by “→”.
The truth table of an implication operator for propositions p and q is:
In English, this compound proposition
p q p→q can have these meaning:
T T T “p implies q”
“p only if q”
T F F “p is sufficient for q”
F T T “q is necessary for p”
“q if p”
F F T “q when p”
“q whenever p”
Example:
p: It is sunny.
q: We go to the beach.
p → q: If it is sunny, we go to the beach.
The statement “If it is sunny, we go to the beach” is false only when it is sunny, but
we do not go to the beach. 10
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Two other connectives related to “→” are
“” (if and only if) and “ ” (exclusive or)
The truth values of these two operators for propositions p and q are:
p q pq pq
T T T F In English, the compound proposition p q
T F F T can have these meaning:
“p if and only if q”
F T F T “p is a necessary and sufficient
F F T F condition for q”
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Given
p : It is raining.
q : The sun is shining.
r : There are clouds in the sky.
Solution:
a) p → (¬q r)
b) (q ¬r)→ ¬p
c) q ¬p
d) ¬r → (¬p q) 12
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Given
p : Today is Monday.
q : It is raining.
r : It is hot.
Express each of the following propositions as an English sentence.
a) ¬p → q r
b) ¬ (p q) r
c) p (q r) → r (q p)
Solution:
a) If today is not Monday, then it is raining or it is hot.
b) It is not the case that today is Monday or it is raining if and only if it is
hot.
c) Today is Monday and either it is raining or it is hot imply that it is hot or
it is raining or today is Monday.
13
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
(p → q) (r ¬q)
p q r (p → q) ¬q (r ¬q) (p → q)
(r ¬q)
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F
14
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
For a compound proposition involving the implication connective
(p → q), we can write the converse, inverse, and contrapositive
statement of the implication.
Mathematically,
the converse of p → q is q → p
the inverse of p → q is ¬p → ¬q
the contrapositive of p → q is ¬q → ¬p
15
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
p : It is sunny.
q : We go to the beach.
p → q : If it is sunny, then we go to the beach.
Its inverse, ¬p → ¬q, is “If it is not sunny, then we do not go to the beach.”
16
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
p q p→q q→p ¬p ¬q ¬p → ¬q ¬q → ¬p
T T T T F F T T
T F F T F T T F
F T T F T F F T
F F T T T T T T
The truth values for the implication and its contrapositive are similar in
every row, BUT not with its inverse and converse.
So we said that the implication and its contrapositive are logically
equivalent .
17
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
A compound proposition is called
• a tautology if it is always true, no matter what the truth values of the
propositions that occur in it.
• a contradiction if it is always false, no matter what the truth values of
the propositions that occur in it.
• a contingency if it is neither a tautology nor a contradiction.
Example: Given
p: Today is raining.
q: I am going out.
p ¬p is a tautology. Today is raining or today is not raining.
p ¬p is a contradiction. Today is raining and today is not raining.
p q is a contingency.
Today is raining or I am going out.
18
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
p ¬p p ¬p p ¬p p ¬p
T F T T F F
F T T F T F
Tautology Contradiction
p q pq
T T T
T F T
F T T
F F F
Contingency
19
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Logical operator Precedence
() 1
¬ 2
3
4
→ 5
6
20
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
A compound proposition containing propositions, p and q are said to be
logically equivalence when p q is a TAUTOLOGY.
When using the truth table to show logical equivalence, basically the
columns of giving the final truth values agreed.
21
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Verify that the statements, (p q) q and q, are logically equivalent.
p q pq (p q) q (p q) q q
T T T T T
T F T F T
F T T T T
F F F F T
(p q) q q if and only if (p q) q q T
22
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Other than using the Truth Table method, Equivalences’ Laws can be used to
show logical equivalence.
Example
Show that (p q) (¬p q) is logically equivalent to ¬p.
¬(p q) (¬p q)
(¬p ¬q) (¬p q) De Morgan’s Law
¬p (¬q q) Distributive Law These are some of the
¬p T Negation Law Equivalences’ Laws.
¬p Identity Law
23
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Identity laws Associative laws Conversion of Implication
pTp (p q) r p (q r) p → q ¬p q
pFp (p q) r p (q r) p q ¬p → q
Domination laws Absorption Laws Contrapositive
pTT p (p q) p p → q ¬q → ¬p
pFF p (p q) p p q ¬q ¬p
Idempotent laws Commutative laws Conversion of Equivalence
ppp pqqp p q (p → q) (q → p)
ppp pqqp
Negation laws Distributive laws De Morgan’s laws
p ¬p T p (q r) (p q) (p r) ¬(p q) ¬p ¬q
p ¬p F p (q r) (p q) (p r) ¬(p q) ¬p ¬q
Double Negation (p q) r (p r) (q r)
laws (p q) r (p r) (q r)
¬(¬p) p
24
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Show that p → (q → r) is logically equivalent to q → (p → r)
p → (q → r)
p → (¬q r) Conversion of implication
¬p (¬q r) Conversion of implication
(¬p ¬q) r Associative law
(¬q ¬p) r Commutative law
¬q (¬p r) Associative law
q → (¬p r) Conversion of implication
q → (p → r) Conversion of implication
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Show that p (¬p q) (p q) is a tautology.
p (¬p q) (p q)
(p ¬p) (p q) (p q) Distributive law
F (p q) (p q) Negation law
(p q) (p q) Identity law
T
26
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
We have learnt the following concepts, terms and notation related to
mathematical logic:
27
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Which statements are syntactically incorrect? Why?
1. (p → q) (→ r ¬q)
2. ¬¬(p ¬q)
3. (p p p)
4. ( p)
5. p → (¬p → (p → ¬p))
28
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Given that [[p]] = T, [[q]] = F, [[r]] = T,
evaluate:
1. [[p (q r)]]
2. [[(p q) → (p q)]]
3. [[¬p q]]
29
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Create the truth table for the compound proposition:
p → q r ¬q
30
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Let
h: John is healthy, w: John is wealthy, and s: John is wise
31
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Characterize each of the following formulae as a tautology, a contingency, or
a contradiction.
1) p → (q p)
2) ¬p → (q ¬p)
3) (q ¬q) → (p ¬p)
4) ¬(p q) (q ¬p)
32
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Fill in the blanks with the correct equivalences.
33
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
Prove that [¬(¬p → q) p] p ¬q by using
a) Truth table
b) Logical equivalence laws
34
TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU