Propositional Logic: CSC510 - Discrete Structures

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

PROPOSITIONAL

LOGIC
CSC510 – Discrete Structures

Nur Azmina binti Mohamad Zamani

Faculty of Computer & Mathematical Sciences


DEFINITION
Propositional Logic – concerned with
statements to which the truth values,
“true” and “false”, can be assigned.

PURPOSE: to analyze these statements either


individually or in a composite manner.

 Question
 Variable form ≠ Proposition
 Instruction
PROPOSITION EXAMPLES
PROPOSITION:
 "Man is Mortal“
- returns truth value “TRUE”
 "12 + 9 = 3 – 2“
- returns truth value “FALSE”

NOT PROPOSITION:
 "A is less than 2".
Reason: unless we give a specific value of A, we
cannot say whether the statement is true or
false.
LOGICAL CONNECTIVES
 Negation, NOT (¬)
 Conjunction, AND (∧)
 Disjunction, OR (∨)
 Exclusive OR / XOR (⊕)
 Implication / if-then ()
 Biconditional / if and only if [short form: iff] (⇔)
TRUTH TABLES
KEY NEGATION
TRUE 1 P ¬P
FALSE 0 1 0
0 1

CONJUNCTION (AND) DISJUNCTION (OR)


P Q P∧Q P Q P∨Q
1 1 1 1 1 1
1 0 0 1 0 1
0 1 0 0 1 1
0 0 0 0 0 0
TRUTH TABLES (cont.)
EXCLUSIVE OR (XOR)
P Q P⊕Q
1 1 0
MUST HAVE
EXACTLY ONE TRUE 1 0 1
TO GET THE VALUE 0 1 1
TRUE
0 0 0

IMPLICATION (IF-THEN) BICONDITIONAL (IFF)


P Q PQ P Q P⇔Q
1 1 1 1 1 1
1 0 0 1 0 0
0 1 1 0 1 0
0 0 1 0 0 1
TAUTOLOGY
Tautology - a formula which is always true for every value of its
propositional variables.

EXAMPLE:
Prove [(A→B)∧A]→B is a tautology.

ANSWER:
A B A→B (A → B) ∧ A [( A → B ) ∧ A] → B
1 1 1 1 1
1 0 0 0 1
0 1 1 0 1
0 0 1 0 1

From the truth table, every value of [(A→B) ∧ A] → B is "True“ and hence,
it is a tautology.
PROPOSITIONAL EQUIVALENCE
Two statements X and Y are logically
equivalent if any of the following two
conditions hold:

1. The truth tables of each statement have the


same truth values.

2. The bi-conditional statement X⇔Y is a


tautology.
PROPOSITIONAL EQUIVALENCE
(cont.)
EXAMPLE:
Prove ¬(A∨B) and [(¬A)∧(¬B)] are equivalent.

Method 1: Matching truth table

A B A∨B ¬ (A ∨ B) ¬A ¬B [(¬ A) ∧ (¬ B)]


1 1 1 0 0 0 0
1 0 1 0 0 1 0
0 1 1 0 1 0 0
0 0 0 1 1 1 1

The truth values of ¬(A∨B) and [(¬A)∧(¬B)] are same,


hence the statements are equivalent.
PROPOSITIONAL EQUIVALENCE
(cont.)
Method 2: Bi-conditionality

A B ¬ (A ∨ B ) [(¬ A) ∧ (¬ B)] [¬ (A ∨ B)] ⇔ [(¬ A ) ∧ (¬ B)]


1 1 0 0 1
1 0 0 0 1
0 1 0 0 1
0 0 1 1 1

[¬(A∨B)]⇔[(¬A)∧(¬B)] is a tautology, the statements are


equivalent.
INVERSE, CONVERSE, CONTRAPOSITIVE
 Implication / if-then (→) is also called a
conditional statement. It has two parts:
◦ Hypothesis, p
◦ Conclusion, q
As mentioned earlier, it is denoted as p→q.

EXAMPLE:
“If you do your homework, you will not be punished.”
"you do your homework" is the hypothesis, p.
"you will not be punished" is the conclusion, q.
INVERSE, CONVERSE, CONTRAPOSITIVE
(cont.)
Inverse − An inverse of the conditional statement is the
negation of both the hypothesis and the conclusion. If the
statement is “If p, then q”, the inverse will be “If not p, then
not q”. Thus the inverse of p→q is ¬p→¬q.

EXAMPLE:
The inverse of “If you do your homework, you will not be
punished” is “If you do not do your homework, you will be
punished”.
INVERSE, CONVERSE, CONTRAPOSITIVE
(cont.)
Converse − The converse of the conditional statement is
computed by interchanging the hypothesis and the conclusion.
If the statement is “If p, then q”, the converse will be “If q, then
p”. The converse of p→q is q→p.

EXAMPLE:
The converse of "If you do your homework, you will not be
punished" is "If you will not be punished, you do your homework”.
INVERSE, CONVERSE, CONTRAPOSITIVE
(cont.)
Contra-positive − The contra-positive of the conditional is
computed by interchanging the hypothesis and the conclusion
of the inverse statement. If the statement is “If p, then q”, the
contra-positive will be “If not q, then not p”. The contra-
positive of p→q is ¬q→¬p.

EXAMPLE:
The Contra-positive of " If you do your homework, you will not
be punished” is "If you are punished, then you do not do your
homework”.
LOGICAL EQUIVALENCE
EQUIVALENCE TYPE OF LAW
p ∧T ≡ p
Identity Law
p∨F≡p
p ∨T ≡ T
Domination Law
p∧F≡F
p∨p≡p
Idempotent Law
p∧p≡p
¬ (¬ p) ≡ p Double Negation Law
p∨q≡q∨p
Commutative Law
p∧q≡q∧p
(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
Associative Law
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
Distributive Law
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
¬ (p ∧ q) ≡ ¬ p ∨ ¬ q
De Morgan’s Law
¬ (p ∨ q) ≡ ¬ p ∧ ¬ q
LOGICAL EQUIVALENCE (cont.)

EQUIVALENCE TYPE OF LAW


p ∨ (p ∧ q) ≡ p
Absorption Law
p ∧ (p ∨ q) ≡ p
p∨¬p≡T
Negation Law
p∧¬p≡F
pq≡¬p∨q Useful

EXTRA NOTES:
1) p ⇔ q ≡ (p ∧ q) ∨ (¬ p ∧ ¬ q)
2) ¬ (p ⇔ q) ≡ p ⇔ ¬ q
LOGICAL EQUIVALENCE -
EXAMPLE
 Show that (p  r) ∧ (q  r) ≡ (p ∨ q)  r are
logically equivalent.

SOLUTION:
(p  r) ∧ (q  r) ≡ (¬ p ∨ r) ∧ (¬ q ∨ r) Useful
≡ (r ∨ ¬ p) ∧ (r ∨ ¬ q) Commutative Law
≡ r ∨ (¬ p ∧ ¬ q) Distributive Law
≡ (¬ p ∧ ¬ q) ∨ r Commutative Law
≡ ¬ (p ∨ q) ∨ r De Morgan’s Law
≡ (p ∨ q)  r Useful

Therefore, (p  r) ∧ (q  r) ≡ (p ∨ q)  r

You might also like