Académique Documents
Professionnel Documents
Culture Documents
Introduction to logic
What is logic?
Why is it useful?
Types of logic
Propositional logic
Predicate logic
Introduction to logic
What is logic?
Why is it useful?
Types of logic
Propositional logic
Predicate logic
What is logic?
Logic is the
beginning of
wisdom, not the
end
What is logic?
Abstraction
Formalisation
What is proposition?
Def: A proposition is a statement that is either true or
false.
or
A proposition is a declarative sentence that is either
true or false,but not both.
e.g. It is raining in Delhi.
e.g. The square of 5 is 16.
Some propositions may not be easily verified:
e.g. The universe is infinite.
Operand
column
Result
column
Logic
Compound Propositions
Composite
Composed of subpropositions & various connectives
Primitive or not composite
E.g. This book is good and cheap
Propositional Variable
Symbol representing any proposition
real variable (x)
not propositon but can be replaced by a
proposition
Logic
P^ Q
T T
T F
F T
F F
Logic
Pv Q
T T
T F
F T
F F
Propositional calculus.
truth tables for logical connectives
P ~P P Q
PQ PQ
T F
F T
T T
T F
T
F
T
T
F T
F F
Example
If p represents This book is good and q represents
This book is cheap, write the following sentences in
symbolic form:
(a) This book is good and cheap.
(b) This book is costly but good
(c) This book is neither good nor cheap
(d) This book is not good but cheap
(e) This book is good or cheap
(a) pq
Logic
T T
T F
F T
F F
Logic
T T
T F
F T
F F
Logic
T T
T F
F T
F F
2006
Im still
here!
T T
T F
F T
F F
Proposition
Let P(p,q,........) denote an expression constructed from
logical variables p,q,......., which take on the value True(T)
or False(F), and the logical connectives , , and
E.g. P(p,q) = (p q)
pq
(p q)
p
q
q
T
Well-Formed Formulas(wff)
(i) If P is a propositional variable then it is wff.
(ii) If x is wff , then ~ x is a wff.
(iii) If x and y are wff , then (xy), (xy), (xy),
(xy)are wffs.
(iv) A string of symbols is a wff iff it is obtained
by finitely many applications of (i)-(iii)
A wff is not a proposition , but if we substitute the
proposition in place of propositional variable , we get
a proposition.
(p
T
T
F
F
T
F
T
F
T
F
T
T
4
step
q)
T
T
F
F
F
T
F
F
F
T
F
T
T
F
T
F
P Q ~P ~PQ PQ PQ ~PQ
T T
T F
F T
F F
Logic - Equivalences
Propositional Equivalences
In mathematical arguments, you can replace a
statement or proposition with another statement or
proposition with the same truth value
Tautology: A compound proposition (combination of
propositions using logical operators) that is always
True, no matter what the truth values of the
propositions that are in it
Contradiction: a compound proposition that is always
false
Contingency: proposition that is neither a tautology or
a contradiction
Logic - Equivalences
Propositional Equivalences
p
pv
p^
T F
F T
Contingency
tautology
contradiction
Principle of Substitution
Let P(p,q,.......) be a tautology , and let
P1(p,q,......),P2(p,q,......),...... be any propositions.
Since P(p,q,........) does not depend upon the
particular truth values of its variables p,q,..., we
can substitute P1 for p , P2 for q, in the tautology
P(p,q,.....) and still have tautology.
Logical Equivalence
P(p,q,.....) Q(p,q,........) (if identical truth tables)
e.g. p p,
ppp
PROPOSITIONAL EQUIVALENCES
Show ( p V q )
using truth tables.
and
pVq
(p V q)
T
T
T
F
T
T
F
F
F
T
p q
F
(p q)
F
T
F
F
Logic - Equivalences
Logical Equivalences: compound propositions
that have the same truth value in all possible cases
words, denotes logical equivalence
between
p and q, for example.
p q pvq
T T T
(p v q)
p
q
F
F F
p^
F
T F
F T
F F
Truth Table
for (p v q)
and p ^ q
(p v q) v r
(p ^ q) ^ r
(p v (q ^ r)
p ^ (q v r)
(p ^ q)
(p v q)
p v (q v r)
p ^ (q ^ r)
(p v q) ^ (p v r)
(p ^ q) v (p ^ r)
pv q
p^ q
Associative laws
Distributive laws
DeMorgans Laws
Useful Law # 1
p V p T
Useful Law # 2
p p F
Useful Law # 3
q pV
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
2. Do DeMorgans second
Next ask yourself, are there any negations with and/or
operators? If there are, then use DeMorgans Law.
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
( p V q)
p q
p (p q)
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
Now we have
(p V (p q)) p (p q))
DeMorgans Law
yes
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
( p V q)
( p)
V q
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
Now we have
(p V (p q))
p (p q))
DeMorgans Law
p [ (p) V q)] ) DeMorgans Law
p (
p V q)
PROPOSITIONAL EQUIVALENCES
Now we have
(p V (p q))
p (p q))
p [ (p) V q)] )
DeMorgans Law
DeMorgans Law
p (p V q)
Double negation
no
no
Yes
PROPOSITIONAL EQUIVALENCES
How do we use the distributive law?
Distributive Law
p (q V r)
p (p V q)
(p q) V (p
r)
(p p) V (p q )
PROPOSITIONAL EQUIVALENCES
Now we have
(p V (p q))
p (p q))
p [ (p) V q)] )
DeMorgans Law
DeMorgans Law
p (p V q)
Double negation
( p p) V ( p q) Distributative Law
no
no
p p F
PROPOSITIONAL EQUIVALENCES
How do we use Useful Law #2?
Useful Law #2
p)
( p
V ( p q)
V ( p q)
PROPOSITIONAL EQUIVALENCES
Now we have
(p V (p q))
p (p q))
p [ (p) V q)] )
DeMorgans Law
DeMorgans Law
p (p V q)
Double negation
( p p) V ( p q)
Distributative Law
(F)
V ( p q)
no
no
no
PROPOSITIONAL EQUIVALENCES
Now we have
(p V (p q))
p (p q))
p [ (p) V q)] )
DeMorgans Law
DeMorgans Law
p (p V q)
Double negation
( p p) V ( p q)
Distributative Law
(F)
V ( p q)
What do we have?
(F) V ( p q)
p q
PROPOSITIONAL EQUIVALENCES
How do we get to the identity law?
Commutative Laws
p V
V p
F V ( p q) ( p q) V F
( p q)
p
( p q)
PROPOSITIONAL EQUIVALENCES
Prove
(p V (p q)) p q,
(p V (p q))
p (p q))
p [ (p) V q)] )
DeMorgans Law
DeMorgans Law
p (p V q)
Double negation
( p p) V ( p q) Distributive Law
(F)
V ( p q)
( p q) V
p q
Law
PROPOSITIONAL EQUIVALENCES
Prove
(p q) ( p V q) is a Tautology.
Prove
(p q) ( p V q)
PROPOSITIONAL EQUIVALENCES
Prove
(p q) ( p V q)
(p q) ( p V q) T
Yes
PROPOSITIONAL EQUIVALENCES
q )
(p q) ( p V q) ( p q) V ( p V q)
PROPOSITIONAL EQUIVALENCES
Prove
(p q) ( p V q) is a Tautology.
Now we have
(pq)(pVq)
( p q) V ( p V q)
no
Yes
PROPOSITIONAL EQUIVALENCES
p V q
( p q) V ( p V q) ( p V q) V ( p V q)
PROPOSITIONAL EQUIVALENCES
Now we have
(p q) ( p V q) T
( p q) V ( p V q)
( p V q) V ( p V q)
DeMorgans Law
no
no
no
PROPOSITIONAL EQUIVALENCES
Now we have
(p q) ( p V q) T
( p q) V ( p V q)
( p V q) V ( p V q)
DeMorgans Law
What do we have?
( p V q) V ( p V q)
What are we trying to get?
T
What do weneed to get this result?
We need UL #1 or Identity law or Domination Law.
PROPOSITIONAL EQUIVALENCES
Associative Laws
(p V q) V r p V (q V r)
( p V q) V ( p V q)
p V ( q V p) V q
PROPOSITIONAL EQUIVALENCES
Then Use the Commulative Law
Commulative Laws
pVq qVp
p V ( q V p) V q
p V (p V q) V q
PROPOSITIONAL EQUIVALENCES
Then Again use the Associative Law
Associative Laws
p V (p V q) V
(p V q) V r p V (q V r)
( p V p) V ( q V q)
PROPOSITIONAL EQUIVALENCES
Useful Law#1
pV p T
( p V p) V ( q V q)
PROPOSITIONAL EQUIVALENCES
Domination Laws
pVT T
PROPOSITIONAL EQUIVALENCES
Prove
(p q) ( p V q) is a Tautology.
(p q) ( p V q) T
( p q) V ( p V q)
( p V q) V ( p V q)
DeMorgans Law
( p V p) V ( q V q)
Associative Law
( p V p) V ( q V q)
Commulative Law
Useful Law # 1
T V T
) V (
Domination Law
Prove
(p q) (p q)
Show that
((pq) (p (q r))) (p q) (p r)
is a tautology.
Arguments
In logical reasoning , a certain number of propositions
are assumed to be true and based on the assumption some
other proposition is derived(deduced or inferred)
premises
conclusion
Definition - An argument p1,p2,p3,.......,pn
q
is said to be valid if q is true whenever all premises
p1,p2,......,pn are true.
valid argument
fallacy
antecedent 1
antecedent 2
consequent
therefore
means
p
pq
pq
p
p
q
pq
Rule of Addition
Rule of Simplification
Rule of Conjunction
q
pq
p
(law of detachment)
the mode of
affirming
the mode of denying
pq
qr
pr
pq
p
q
Rule of hypothetical
syllogism
Rule of disjunctive
syllogism
Proved by
Premise #1.
Simplification of 1.
Premise #2.
rules 2,3.
Premise #3.
rules 4,5.
Premise #4.
rules 6,7.
Example
Consider the following argument:
S1:If a man is a bachelor, he is unhappy
S2:If a man is unhappy, he dies young
---------------------------------------------------S:Bachelors die young
Predicate Calculus
* Ram is a student
* Shyam is a student
* x is a student
* is a student - Predicate
e.g. 2x + 3y = 4z
Definition- A part of a declarative sentence describing
the properties of an object or relation among objects is
called a predicate.
Predicate Calculus
* Let A be a given set . A propositional function(or an open
sentence or condition) defined on A is an expression p(x)
which has property that p(a) is true or false for each
a A.
*A - domain of p(x)
*Tp - all elements of A for which p(a) is true is called the
truth set of p(x)
*Tp= {x:x A, p(x) is true}or T p = {x:p(x)}
Predicate Calculus
e.g.- 1. x is the father of y - P(x,y)
2. 2x+3y = 4z - S(x,y,z)
P(x,y) , S(x,y,z) are not propositions but if x=2 , y=0 and z
=1 in S(x,y,z) or S(2,0,1) is proposition with truth value T
e.g. Find the truth set of each propositional function p(x)
defined on the set N of positive integers.
(a) Let p(x) be x+2>7
(b) Let p(x) be x+5<3
(c) Let p(x) be x+5>1
(a) {x:xN, x+2 >7} = {6,7,8,.......}, (c) {x:xN, x+5>1} = N
(b) {x:xN, x+5<3} =
Predicate Calculus
Definition - For a declarative sentence involving a predicate
, the universe of discourse , or simply the universe, is the
set of all possible values which can be assigned to variables.
Logic - Quantifiers
Logic - Quantifiers
x (S(x) P(x))
Where P(x) denotes that x has studied Maths
And S(x) denotes that x is in JUIT
And the arrow denotes then
Logic - Quantifiers
Existential Quantifier of a proposition: there exists
an element x in the universe of discourse such
that P(x) is true
That is, there is AN x, or at least ONE x, such that
P(x) is true
In this case, one would use the backwards E to
denote this type quantifier rather than the all
inclusive upside down A:
x P(x)
For example, if P(x) was the statement x > 89, and
your data set included test scores of 65, 72, 85, 88,
and 95 what would be the existential quantification
of P(x)?
TRUE!
Example
Further Examples
1) Similar quantifiers are order independent
3) If P is true of an object, so is Q
De Morgans Law
(xA)p(x) ( xA) p(x)
( xA) p(x) (xA) p(x)
e.g. For all positive integers n we have n+2 >8
There exists a positive integer n such that n+2not>8