0% found this document useful (0 votes)
17 views34 pages

T1.1 Propositional Logic

T1.1 Propositional logic (1)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views34 pages

T1.1 Propositional Logic

T1.1 Propositional logic (1)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

TMA1201 Discrete Structures & Probability

Faculty of Computing & Informatics


Multimedia University
What you will learn in this lecture:
• Propositions
• Truth Values
• Compound Propositions
• Logical Connectives
• Inverse, Converse, Contrapositive Statements
• Tautology, Contradiction, Contingency
• Logical Equivalence

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.

Examples of sentences that are NOT propositions:


1. Please sit down.
2. x+1=2.
3. What time is it?

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.

The four basic logical connectives are:


•Negation (¬)
•Conjunction ()
•Disjunction ()
•Implication (→)

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 pq
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 pq
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 pq pq
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”

p  q is defined to be (p → q)  (q → p), it is True when p, q are


both true or both false.

p  q is the negation of p  q, it is True when exactly one of p or q


is true (but not both).
11

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.

Write the following propositions using p, q, r and logical operators:


a) If it is raining, then the sun is not shining and there are clouds in the sky.
b) If the sun is shining or there are no clouds in the sky, then it is not raining.
c) The sun is shining if and only if it is not raining.
d) If there are no clouds in the sky, then it is not raining and the sun is shining.

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 converse, q → p, is “If we go to the beach, then it is sunny.”

Its inverse, ¬p → ¬q, is “If it is not sunny, then we do not go to the beach.”

Its contrapositive, ¬q → ¬p, is “If we do not go to the beach, it is not


sunny.”

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 pq
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.

Logical equivalence can also be denoted as follows:


pq
pq

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 pq (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

This column shows that


These columns are equivalent! (p  q)  q  q is a tautology!
(p  q)  q  q

(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
pTp (p  q)  r  p  (q  r) p → q  ¬p  q
pFp (p  q)  r  p  (q  r) p  q  ¬p → q
Domination laws Absorption Laws Contrapositive
pTT p  (p  q)  p p → q  ¬q → ¬p
pFF p  (p  q)  p p  q  ¬q  ¬p
Idempotent laws Commutative laws Conversion of Equivalence
ppp pqqp p  q  (p → q)  (q → p)
ppp pqqp
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

Convert the expression based on


equivalence laws.
25

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

Remember a TAUTOLOGY means equal to TRUE or T.

26

TMA1201 Discrete Structures & Probability, Faculty of Computing & Informatics, MMU
We have learnt the following concepts, terms and notation related to
mathematical logic:

• Definition of a proposition and compound propositions


• Logical connectives: ¬, , , →, , 
• Truth values and truth table
• Rephrasing into a Converse, Inverse, Contrapositive Statements
• Classification into Tautologies, Contingency, Contradiction Statements
• The meaning of Logical Equivalence

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

A) Express the following propositions using h, w, s and logical operators.


1. John is healthy and wise but not wealthy.
2. John is neither wealthy nor wise, but he is healthy.

B) Express each of the following propositions as an English sentence.


1. w → ¬(h  s)
2. s  h → w

C) Write the converse, inverse, and contrapositive statements for (B)

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.

p→q  Conversion of Implication


pq  De Morgan
pq  De Morgan
pq  Conversion of Equivalences
(q  r)  p  Distributive law
p→q  Contra-positive
p  (q  r)  Distributive law

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

You might also like