2. • Crucial for mathematical reasoning
• Important for program design
• Used for designing electronic circuitry
• (Propositional )Logic is a system based on
propositions.
• A proposition or statement is a (declarative)
sentence that is either true or false (not both).
• We say that the truth value of a proposition is
either true (T) or false (F).
• Corresponds to 1 and 0 in digital circuits
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 2
3. “Elephants are bigger than mice.”
Is this a sentence? yes
Is this a proposition? yes
What is the truth value
of the proposition? true
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 3
4. “520 < 111”
Is this a sentence? yes
Is this a proposition? yes
What is the truth value
of the proposition? false
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 4
5. “y > 5”
Is this a sentence? yes
Is this a proposition? no
Its truth value depends on the value of y,
but this value is not specified.
We call this type of sentence a
propositional function or open sentence.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 5
6. “Today is January 27 and 99 < 5.”
Is this a sentence? yes
Is this a proposition? yes
What is the truth value
of the proposition? false
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 6
7. “Please do not fall asleep.”
Is this a sentence? yes
It’s a request.
Is this a proposition? no
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 7
8. “If the moon is made of cheese,
then I will be rich.”
Is this a sentence? yes
Is this a proposition? yes
What is the truth value
of the proposition? probably true
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 8
9. “x < y if and only if y > x.”
Is this a sentence? yes
Is this a proposition? yes
… because its truth value
does not depend on
specific values of x and y.
What is the truth value
of the proposition? true
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 9
10. Aswe have seen in the previous
examples, one or more propositions can
be combined to form a single compound
proposition.
We formalize this by denoting
propositions with letters such as p, q, r, s,
and introducing several logical operators
or logical connectives.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 10
11. We will examine the following logical
operators:
• Negation (NOT, ¬ )
• Conjunction (AND, ∧ )
• Disjunction (OR, ∨ )
• Exclusive-or (XOR, ⊕ )
• Implication (if – then, → )
• Biconditional (if and only if, ↔ )
Truth
tables can be used to show how these
operators can combine propositions to
compound propositions.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 11
12. Unary Operator, Symbol: ¬
P P
true (T) false (F)
false (F) true (T)
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 12
13. Binary Operator, Symbol: ∧
P Q P Q
T T T
T F F
F T F
F F F
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 13
14. Binary Operator, Symbol: ∨
P Q P Q
T T T
T F T
F T T
F F F
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 14
15. Binary Operator, Symbol: ⊕
P Q PQ
T T F
T F T
F T T
F F F
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 15
16. Binary Operator, Symbol: →
P Q PQ
T T T
T F F
F T T
F F T
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 16
17. Binary Operator, Symbol: ↔
P Q PQ
T T T
T F F
F T F
F F T
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 17
18. Statements and operators can be combined
in any way to form new statements.
P Q P Q (P)(Q)
T T F F F
T F F T T
F T T F T
F F T T T
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 18
19. Statements and operators can be combined in
any way to form new statements.
P Q PQ (PQ) (P)(Q)
T T T F F
T F F T T
F T F T T
F F F T T
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 19
20. • Totake discrete mathematics, you must
have taken calculus or a course in computer
science.
• When you buy a new car from Acme Motor
Company, you get $2000 back in cash or a
2% car loan.
• School is closed if more than 2 feet of snow
falls or if the wind chill is below -100.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 20
21. • To take discrete mathematics, you must have
taken calculus or a course in computer science.
› P: take discrete mathematics
› Q: take calculus
› R: take a course in computer science
•P →Q∨R
• Problem with proposition R
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 21
22. • When you buy a new car from Acme Motor
Company, you get $2000 back in cash or a 2%
car loan.
› P: buy a car from Acme Motor Company
› Q: get $2000 cash back
› R: get a 2% car loan
•P →Q⊕R
• Why use XOR here? – example of ambiguity
of natural languages
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 22
23. • School is closed if more than 2 feet of snow
falls or if the wind chill is below -100.
› P: School is closed
› Q: 2 feet of snow falls
› R: wind chill is below -100
•Q ∧R→P
• Precedence among operators:
¬, ∧, ∨, →, ↔
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 23
24. P Q (PQ) (P)(Q) (PQ)(P)(Q)
T T F F T
T F T T T
F T T T T
F F T T T
The statements ¬(P∧Q) and (¬P) ∨ (¬Q) are logically equivalent, since
they have the same truth table, or put it in another way, ¬(P∧Q) ↔(¬P)
∨ (¬Q) is always true.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 24
25. A tautology is a statement that is always true.
Examples:
› R∨(¬R)
› ¬(P∧Q) ↔ (¬P)∨(¬ Q)
A contradiction is a statement that is always false.
Examples:
› R∧(¬R)
› ¬(¬(P ∧ Q) ↔ (¬P) ∨ (¬Q))
The negation of any tautology is a contradiction, and
the negation of any contradiction is a tautology.
If A has the truth value, T for at least one combination
of truth values of P1, P2 , P3 ,…, Pn then A is said to be
satisfiable.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 25
26. Definition: two propositional
statements S1 and S2 are said to be
(logically) equivalent, denoted S1 ≡ S2
if
› They have the same truth table, or
› S1 ⇔ S2 is a tautology
Equivalence can be established by
› Constructing truth tables
› Using equivalence laws
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 26
27. Equivalence laws
› Identity laws, P ∧ T ≡ P,
› Domination laws, P ∧ F ≡ F,
› Idempotent laws, P ∧ P ≡ P,
› Double negation law, ¬ (¬ P) ≡ P
› Commutative laws, P ∧ Q ≡ Q ∧ P,
› Associative laws, P ∧ (Q ∧ R)≡ (P ∧ Q) ∧ R,
› Distributive laws, P ∧ (Q ∨ R)≡ (P ∧ Q) ∨ (P ∧ R),
› De Morgan’s laws, ¬ (P∧Q) ≡ (¬ P) ∨ (¬ Q)
› Law with implication P → Q ≡ ¬ P ∨ Q
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 27
28. • Show that P → Q ≡ ¬ P ∨ Q: by truth table
• Showthat (P → Q) ∧ (P → R) ≡ P → (Q ∧ R):
by equivalence laws:
› Law with implication on both sides
› Distribution law on LHS
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 28
29. •Proposition
› Statement, Truth value,
› Proposition, Propositional symbol, Open proposition
•Operators
› Define by truth tables
› Composite propositions
› Tautology and contradiction
•Equivalence of propositional statements
› Definition
› Proving equivalence (by truth table or equivalence
laws)
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 29
30. Propositionalfunction (open sentence):
statement involving one or more variables,
e.g.: x-3 > 5.
Let us call this propositional function P(x),
where P is the predicate and x is the variable.
What is the truth value of P(2) ? false
What is the truth value of P(8) ? false
What is the truth value of P(9) ? true
When a variable is given a value, it is said to be
instantiated
Truth value depends on value of variable
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 30
31. Letus consider the propositional function
Q(x, y, z) defined as:
x + y = z.
Here,Q is the predicate and x, y, and z are
the variables.
What is the truth value of Q(2, 3, 5) ? true
What is the truth value of Q(0, 1, 2) ? false
What is the truth value of Q(9, -9, 0) ? true
A propositional function (predicate) becomes a
proposition when all its variables are instantiated.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 31
32. Other examples of propositional functions
Person(x),
Person(Socrates) = T x is a person
which is true if
Person(dog) = F
CSCourse(x), which is true if x is a
computer science course
CS Course(C-language) = T
CS Course(MATH 102) = F
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 32
33. LetP(x) be a predicate (propositional
function).
Universally quantified sentence:
For all x in the universe of discourse P(x) is true.
Using the universal quantifier ∀:
∀x P(x) “for all x P(x)” or “for every x P(x)”
(Note:∀x P(x) is either true or false, so it is a
proposition, not a propositional function.)
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 33
34. Example: Let the universe of discourse be all people
S(x): x is a Mathematics student.
G(x): x is a genius.
What does ∀x (S(x) → G(x)) mean ?
“If
x is a mathematics student, then x is a genius.” or
“All Mathematics students are geniuses.”
Ifthe universe of discourse is all mathematics
students, then the same statement can be written as
∀x G(x)
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 34
35. Existentiallyquantified sentence:
There exists an x in the universe of discourse for
which P(x) is true.
Using the existential quantifier ∃:
∃x P(x) “There is an x such that P(x).”
“There is at least one x such that P(x).”
(Note:∃x P(x) is either true or false, so it is a
proposition, but no propositional function.)
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 35
36. Example:
P(x):x is a Mathematics professor.
G(x): x is a genius.
What does ∃x (P(x) ∧ G(x)) mean ?
“There is an x such that x is a Mathematics
professor and x is a genius.”
or
“At least one Mathematics professor is a
genius.”
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 36
37. Another example:
Let the universe of discourse be the real
numbers.
What does ∀x∃y (x + y = 320) mean ?
“For every x there exists a y so that x + y = 320.”
Is it true? yes
Is it true for the natural numbers? no
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 37
38. A counterexample to ∀x P(x) is an object c so
that P(c) is false.
Statementssuch as ∀x (P(x) → Q(x)) can be
disproved by simply providing a
counterexample.
Statement: “All birds can fly.”
Disproved by counterexample: Penguin.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 38
39. ¬(∀x P(x)) is logically equivalent to ∃x (¬P(x)).
¬(∃x P(x)) is logically equivalent to ∀x (¬P(x)).
This is de Morgan’s law for quantifiers
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 39
40. Examples
Not all roses are red
¬∀x (Rose(x) → Red(x))
∃x (Rose(x) ∧ ¬Red(x))
Nobody is perfect
x (Person(x) Perfect(x))
x (Person(x) Perfect(x))
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 40
41. A predicate can have more than one
variables.
› S(x, y, z): z is the sum of x and y
› F(x, y): x and y are friends
We can quantify individual variables in
different ways
› ∀x, y, z (S(x, y, z) → (x <= z ∧ y <= z))
› ∃x ∀y ∀z (F(x, y) ∧ F(x, z) ∧ (y != z) → ¬F(y, z)
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 41
42. Exercise: translate the following English
sentence into logical expression
“There is a rational number in between every
pair of distinct rational numbers”
Use predicate Q(x), which is true when
x is a rational number
∀x,y (Q(x) ∧ Q (y) ∧ (x < y) →
∃u (Q(u) ∧ (x < u) ∧ (u < y)))
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 42
43. • Propositional functions (predicates)
• Universal and existential quantifiers, and
the duality of the two
• When predicates become propositions
› All of its variables are instantiated
› All of its variables are quantified
• Nested quantifiers
› Quantifiers with negation
• Logical expressions formed by
predicates, operators, and quantifiers
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 43
45. We need mathematical reasoning to determine
whether a mathematical argument is correct or
incorrect and construct mathematical
arguments.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 45
46. Argument: An argument is an assertion; that a
group of propositions called premises, yields an
other proposition, called the conclusion.
Let P1, P2 , P3 ,…, Pn is the group of propositions that
yields the conclusion Q. Then, it is denoted as P1, P2 ,
P3 ,…, Pn |- Q
Valid Argument: An argument is called valid
argument if the conclusion is true whenever all the
premises are true
or
The argument is valid iff the ANDing of the group of
propositions implies conclusion is a tautology
ie: P(P1, P2 , P3 ,…, Pn ) Q is a tautology 46
Introduction to Mathematical Logic: MATH-105 Jan-May 2013
47. Fallacy Argument: An argument is called
fallacy or an invalid argument if it is not a valid
argument.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 47
48. Translate the following into symbolic form and
test the validity of the argument:
1.“If I will select in IAS examination, then I will not
be able to go to London. Since, I am going to
London, I will not select in IAS examination”.
2. “If 6 is even then 2 does not divide 7. Either 5 is
not prime or 2 divides 7. But 5 is prime, therefore,
6 is not even”.
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 48
49. Ans-1:
p: I will select in IAS examination
q: I will go to London
Premises: 1. p ~q
2. q
Conclusion: ~p
Verify: [(p ~q) ∧(q)] ~p is a tautology
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 49
50. Ans-2:
p: 6 is even
q: 2 divides 7
r: 5 is prime
Premises: 1. p ~q
2. ~r ∨ q
3. r
Conclusion: ~p
Verify: [ (1) ∧ (2) ∧ (3) ] ~p is a tautology
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 50
51. The problem of finding whether a given
statement is tautology or contradiction or
satisfiable in a finite number of steps, is
called as decision problem, the
construction of truth tables may not be
often a practical solution. We therefore
consider alternate procedure known as
reduction to normal forms. The two such
forms are:
Disjunctive Normal Form (DNF)
Conjunctive Normal Form (CNF)
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 51
52. A compound statement is said to be in dnf
if it is disjunction of conjunction of the
variables or their negations.
Ex:(p ∧ q ∧ r) ∨ (~p ∧q ∧r) ∨ (~p ∧~q ∧ r)
A compound statement is said to be in cnf
if it is conjunction of disjunction of the
variables or their negations.
Ex:(p ∨ q ∨ ~r) ∧ (p ∨ ~q ∨ r) ∧ (~p ∨ ~q ∨ r)
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 52
53. The truth table for the given statement is:
P Q P Q Q P (P Q) (Q
P)
T T T T T
T F F T F
F T T F F
F F F T T
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 53
56. • Mathematical Reasoning
• Terminology (argument, valid argument
and fallacy argument)
• Examples on valid arguments
• Normal forms (DNF and CNF)
• Truth table method to express the
statements as dnf and cnf forms
Introduction to Mathematical Logic: MATH-105 Jan-May 2013 56