Unit I
Unit I
Mathematical Logic
Topics to be covered
2
What is Discrete Mathematics?
4
What is Proposition?
x+ 4 > 9.
7
Exercise Problems
8
Exercise Problem
9
Proposition Variables…
10
Logical Connectives
– Negation ( or !)
– And or logical conjunction ()
– Or or logical disjunction ()
– XOR or exclusive or ()
– Implication ( or )
– Bi-conditional ( or )
11
Negation
12
Examples of Negation
The conjunction p˄q is true when p and q are both true and is
false otherwise
Examples
It is raining and it is warm
(2+3=5) and (1<2)
15
Example of Conjunction?
The conjunction is
16
What is Disjunction?
The disjunction p˅q is false when both p and q are false and is
true otherwise.
Examples
It is raining or it is the second lecture
(2+2=5) V (1<2)
You may like cake or ice cream
17
What is Disjunction?
The disjunction is
p˅q : Today is Friday or it is raining today
18
What is Exclusive OR?
• Example
The circuit is either ON or OFF but not
both
Let ab<0, then either a<0 or b<0 but not
both
You may have cake or ice cream, but
not both
19
What is Implication?
p → q is the proposition that is false
when p is true and q is false and true
otherwise • If p then q
p is called the hypothesis, • p implies q
antecedent, premise • If p, q
• p only if q
q is called the conclusion,
• q if p
consequence • q when p
• q whenever p
• q follows from p
• p is a sufficient condition
for q (p is sufficient for q)
• q is a necessary condition
for p (q is necessary for p
20
What is Bi-Conditional?
Note: It is equivalent to (p → q) (q → p)
• p if and only if q
• p is a necessary and sufficient
condition for q
• if p then q, and conversely
• p iff q
21
Bi-Conditional Examples..
Examples
x>0 if and only if x2 is positive
The alarm goes off iff a burglar breaks in
Which of the following bi conditionals are true?
x2 + y2 = 0 if and only if x=0 and y=0
sol: True. Both implications hold
2 + 2 = 4 if and only if 2<2
sol: True. Both implications hold
x2 0 if and only if x 0
False. The implication “if x 0 then x2 0” holds.
However, the implication “if x2 0 then x 0” is false.
Consider x=-1.
The hypothesis (-1)2=1 0 but the conclusion fails.
22
Statement Formula
23
Well formed Formula
24
Well formed Formula Examples
¬(P ^ Q)
¬(P V Q)
(P->(P V Q))
(P->(Q->R))
25
Converse, Inverse and Contra
Positive
Consider the proposition p q
Converse is q p
Inverse is p q
Contrapositive is q p
Statement: If P, then q.
Converse: If q , then p .
Inverse: If not p , then not q .
Contrapositive: If not q , then not p .
26
Converse, Inverse and Contra
Positive
27
Practice Exercise
30
Practice Exercise problems
Determine whether the following conditional statements are
true or false.
a) If 1 + 1 = 3, then unicorns exist.
b) b) If 1 + 1 = 3, then dogs can fly.
c) If 1 + 1 = 2, then dogs can fly.
d) If 2 + 2 = 4, then 1 + 2 = 3.
32
Construction of Truth tables
p q pq q (( p q ) q )
0 0 0 1 1
0 1 0 0 0
1 0 0 1 1
1 1 1 0 1
33
Construction of truth tables-
Exercise problems
1. Construct a truth table for each of these compound
propositions.
a) (p ∨ q) ∨ r b) (p ∨ q) ∧ r c) (p ∧ q) ∨ r d) (p ∧ q) ∧ r
e) (p ∨ q)∧¬r f ) (p ∧ q)∨¬r
2. Construct a truth table for each of these compound
propositions.
a)p → (¬q ∨ r) b) ¬p → (q → r) c) (p → q) ∨ (¬p → r)
d) (p → q) ∧ (¬p → r) e) (p ↔ q) ∨ (¬q ↔ r)
f ) (¬p ↔¬q) ↔ (q ↔ r)
3. Construct a truth table for each of these compound
propositions.
a) p →¬p b) p ↔¬p c) p ⊕ (p ∨ q) d) (p ∧ q) → (p ∨ q)
e) (q →¬p) ↔ (p ↔ q) f ) (p ↔ q) ⊕ (p ↔¬q)
34
Construction of truth tables-
Exercise problems
Examples
A simple tautology is p p
A simple contradiction is p p
36
Problems
37
Logical Equivalence statements
Propositions (p q) and
(p q) are logically
equivalent
38
Example on Logical Equivalence
39
Practice Problem on tautology
40
Practice Problem
41
Exercise Problems
43
Normal Forms
Necessary and sufficient condition for an elementary product to
be identically false is that it contain at least one pair of factors in
which one is the negation of the another
44
Disjunctive Normal Form
A formula which is equivalent to given formula and which consists
of a sum of elementary products is called a disjunctive normal
form of the given formula
45
Conjunctive Normal Form
A formula which is equivalent to a given formula and which
consists of a product of elementary sums is called a conjunctive
normal form of a given formula
46
Principal Disjunctive Normal
Form
47
Obtain the PDNF of ( P Q)
(P⇔ Q)
T T F F T
T F T T T
F T T T T
F F T F F
49
Principal Conjunctive Normal
Form
Example2:
Obtain PCNF for A : ( P R) ((Q P) (P Q)).
Solution:
A (P R) (( Q P) ( P Q))
(P R (Q Q)) (P Q (R R)) ( P Q (R R))
(P Q R) (P Q R) (P Q R) (P Q R) ( P
Q R) ( P Q R)
(P Q R) (P Q R) (P Q R) ( P Q R) (
P Q R)
p (0,2,3,4,5).
50