Chap 2
Chap 2
Chap 2
Discrete Mathematics
Chapter 2 Logic
Content
Statements Calculus: logical connectives
and compound statements
Truth table, tautology, contradiction and
contingency
Normal forms
Predicate calculus: quantifiers, universes
1
Introduction
Logic
- the discipline that deals with the methods
of reasoning.
- on elementary level, logic provides rules
and techniques for determining whether a
given argument is valid.
Statement (Proposition)
Statement or Proposition is a declarative sentence that
is either true or false, but not both.
Example:
2
Logical Connectives and
Compound Statement
Negation
If p is a statement, the negation of p is the statement
not p, denoted by ~p.
3
Worked example: Negation
a) ~p: 2+3 ≤ 1
Conjunction
4
Worked Example: Conjunction
Solution :
Disjunction
5
Worked example: Disjunction
Solution:
pvq
p q r
T T
T F
F T
F F
6
Conditional Statement
If p and q are statements, the compound statement “if p
then q”, denoted by p q , is called a conditional
statement or implication. The statement p is called the
antecedent or hypothesis, and the statement q is called
the consequent or conclusion.
The connective “if…then…” is denoted by the symbol
p is a sufficient condition for q; q is a necessary condition
for p.
p q is false only if p is true and q is false
Implication of p q
converse of p q : q p
contrapositive of p q : ~ q ~p
inverse of p q : ~ p ~ q
Solution:
7
Biconditional
Worked Example:
Example 1:
Example2:
Solution:
8
Tautology, Contradiction, Contingency
Tautology
A statement that is true for all possible values of its
propositional variables.
Contradiction (Absurdity)
A statement that is always false.
Contingency
A statement that can be either true or false
Worked Example
9
Equivalent
Worked Example
10
Important Tautologies
Theorem 3
Negation Properties
p ~ p t; p ~ p c
Identity Properties
p t p; p c p
Domination Law
p t t; p c c
11
Properties of Implication Operation
Theorem 2
Proved in slide 20
Proved in slide 16
Normal Form
12
Normal Form (disjunctive and
conjunctive)
PCNF E = ~PDNF ~E
PCNF ~ E = ~PDNF E
13
Example
DNF E = ( P Q ) ( P ~ Q ) (~ P Q )
DNF ~E =
CNF E= ~DNF~E
CNF ~E =
Theorem 2
Theorem 2
Distributive Law
Negation Law
Identity Law
( P Q R) ( P ~ Q) (~ P Q) DNF ?
14
Worked Example: DNF and CNF (Con’t)
Find CNF of E
De Morgan’s Law
Let E= (~ P ~ Q) ( P ~ Q)
15
Exercise
~PDNF (~A)
~PDNF (A)
Solution
* Critical row
16
Example 1
Show that the conclusion c: r follows from the
Premises H1: p v q H2: p r H3: q r
Solution
H1 H2 H3
p q r pvq p -> r q -> r Conclusion
T T T T T T T
T T F T F F F
T F T T T T T
T F F T F T F
F T T T T T T
F T F T T F F
F F T F T T T
F F F F T T F
valid
Exercise
Check the validity of the following statements:
(i) [~q˄(p→q)] =>~p p q ~q p->q => ~p
T T F F T T F
T F T F F T F
F T F F T T T
F F T T T T T
[(p→q)˅(q→r)]=>(p→r) is invalid
17
Predicates and Quantifiers
Definition
A predicate is a sentence that contains a finite number of
variables and becomes a statement when specific values are
substituted for the variables. The domain of a predicate
variable is the set of all values that may be substituted in place
of the variable.
18
The Universe of Discourse
Quantification
Quantification
Universal Existential
• A statement “ For all values of x , • A statement “There exists a
P(x) is true.” value of x for P(x) is true.”
• Can also be stated as “ for every • Can be read “there is an x,”
x,” “every x” or “ for any x.” “there is some x,” “there exists
an x,” or “there is at least one
• is denoted by x P ( x )
x.”
•symbol is universal quantifier
• is denoted by x P ( x )
• symbol
19
Universal Quantification
Definition – The universal quantification of P(x) is the proposition
“P(x) is true for all values of x in the universe of
discourse”
When all the elements in the universe can be listed – say, x1,x2,…xn
– it follows that the universe quantification x P( x ) is the same as
the conjunction P(x1)˄P(x2)˄P(x3)˄…˄P(xn), since this conjunction is
true if and only if P(x1),P(x2),P(x3),…,P(xn) are all true.
Example:
x Q( x )
Existential Quantification
When all the elements in the universe can be listed – say, x1,x2,…xn
– it follows that the existential quantification x P( x ) is the same as
the disjunction P(x1)˅P(x2) ˅P(x3) ˅… ˅ P(xn), since this disjunction
is true if and only if at least one of P(x1),P(x2),P(x3),… P(xn) is true.
20
Worked Example: Existential Quantification
Example1:
Example2:
Scope of Quantifier
21
Worked Example
(x)( P ( x, y ) (y )Q ( x, y ))
Scope for
Scope for
22
Exercise
Determine the truth value for each of the following
statements. If it is false, give a counterexample.
(i) x Z , y Z such that x y 1.
x R, y R such that xy 1.
Exercise
Let S = {-17,-9,-1,1,4,16,20,31,36,42}. Determine which of the
following statements are true and which are false. Provide
counterexample for those statements that are false.
23
Exercise
Let A={1,2,3} and B={6,7,8}. Consider the quantified
statement (x A)(y B )( x y 12)
Exercise
(i) Show the scope of quantifier in the following
expression (y )( P( x, y ) (x)Q( x, y ))
24
Exercise
Consider A = (p q) ((p v ~q) (p ˄ q))
(i) Construct the truth table for A
(ii) Determine if A is tautology, contradiction or contingency.
(iii) Write down the PDNF of A and PCNF of ~A from the truth table.
(iv) Use the rules of logic to simplify A to ( p ˅ q). (13 marks)
p q ~q (p→ q) → (p v ~ q) → (p ˄ q)
T T F T T T T T
T F T F T T F F
F T F T T F T F
F F T T F T F F
Exercise
Given expression A = p ˄(q →~r).
(i) Construct a truth table for A. Determine
whether the expression is a tautology,
contradiction or contingency.
(ii) Obtain the PDNF and PCNF for A and ~A.
Continegency
25