Statement Calculus
Statement Calculus
Statement Calculus
not both. The truth or falsity of a statement is called its truth value.
Examples :
Good morning
Is it raining now ?
Im lying.
There is no life in other planets.
6 + 2 > 10
7 5 = 2
I learn English or Japanese. (I learn English or I learn Japanese.)
If it does not rain, Ill go out.
Modes of Composition
Conjunction (and , )
Ramu is dead and Raja is in prison
P Q
connective
F F F
F T F
F F T
T T T
P Q Q P
Modes of Composition
Disjunction (or , v )
Kamala is a teacher or Kamal is a student
P Q
connective
F F F
T T F
T F T
T T T
P v Q Q P
Modes of Composition
Negation (not , ~ ) Kamala is not a teacher
P ~ P
T F
F T
Examples : Find the negations of the following.
1) Tom and Mary are students.
2) All students have done the homework.
3) John is late sometimes
Modes of Composition
Conditional (if - then , )
If it rains, Ill stay at home.
P (hypothesis) Q (consequence)
T
T
F
T
F
T
F
T
F
F
T
T
P Q Q P
I terated Composition
An iterated composition is a composition formed by
combining the above four modes.
If it rains, John will drive Jack home or Jack will stay with John.
P : it rains
Q : John drives Jack home
R : Jack stays with John
When will this statement be false ?
P (Q v R)
I terated Composition
If it rains, John will drive Jack home or Jack will stay with John.
(P (Q v R))
P : it rains
Q : John drives Jack home
R : Jack stays with John
T
T
T
T
F
T
T
T
F
T
T
T
F
T
T
T
F
T
F
T
F
T
F
T
F
F
T
T
F
F
T
T
F
F
F
F
T
T
T
T
P ( Q v R ) R Q P
I terated Composition
T
F
T
T
T
F
F
T
T
T
F
T
F F
T F
F T
T T
(P Q) (Q P) Q P
Complete the following truth table
This iterated composition is called biconditional and is denoted by
P Q , and is read as P if and only if Q, or P iff Q
I terated Composition
T
F
F
T
F F
T F
F T
T T
P Q Q P
Complete the following truth table
This iterated composition is called biconditional and is denoted by
P Q , and is read as P if and only if Q, or P iff Q
I terated Composition
Examples : Let P be he is rich, Q be he is happy. Rewrite the following.
1) If is he is rich, (then) he is unhappy.
2) He neither rich nor happy.
3) To be poor is to be happy.
4) Being poor is a sufficient condition to being happy.
5) Being rich is a necessary condition to being happy.
6) To be rich means the same as to be happy.
P Q Q P (~P) Q
(~P) Q (~P) (~Q) P (~Q)
I terated Composition
T
T
F
T
F
T
F
T
F
F
T
T
P Q Q P
T
T
F
T
F
T
F
T
F
F
T
T
(~P) v Q Q P
Consider this truth
table, ......
And, ......
They have the same truth table,
they are ......
equivalent !!
I terated Composition
T
T
F
T
F
T
F
T
F
F
T
T
P Q Q P
T
T
F
T
F
T
F
T
F
F
T
T
(~P) v Q Q P
P Q (~P) v Q Equivalent Statements
Equivalent Formulae
Let p, q and r be three statements.
1) Idempotent Laws
a) p p p b) p v p p
2) Commutative Laws
a) p q q p b) p v q q v p
3) Associative Laws
a) (p q) r p (q r) b) (p v q) v r p v (q v r)
4) Distributive Laws
a) p (q v r) (p q) v (p r) b) p v (q r) (p v q) (p v r)
5) De Morgans Laws
a) ~(p v q) (~p) (~q) b) ~(p q) (~p) v (~q)
Equivalent Formulae
Simplify (R P) v (R Q)
Solution : (R P) v (R Q)
(~R v P) v (~R v Q)
~R v P v ~R v Q
~R v P v Q
~R v (P v Q)
R (P v Q)
Equivalent Formulae
Which of the following are equivalent ?
a) If it rains, Ill stay at home. b) If it does not rain, Ill not stay at home.
c) If I stay at home, it is raining. d) If I do not stay at home, it is not raining.
Let p : it rain , q : I stay at home
a) p q
b) ~p ~q
c) q p
d) (~q) (~p)
inverse of (a)
converse of (a)
contrapositive of (a)
Equivalent Formulae
A function, f, is called a constant function, if, for any x, f(x) = c, where c is constant.
If the truth value of a statement formula is constantly T ( or, F), then it is called a
tautology (or, contradiction)
Examples
1) Tautologies
a) (~p) v p b) ~((~p) p) c) (p q) q d) p (p v q)
2) More
a) p T p p F F b) p v T T p v F p
c) T p p F p T d) p T T p F F
e) ~T F ~F T
S
1
: If it rains, Ill stay at home.
S
2
: If a b and b c , then a // c.
S
1
may or may not be true but S
2
is always true, i.e. S
2
is a tautology.
When P Q is a tautology, it is called an implication and denoted by P Q.
Therefore, S
2
can be stated as a b and b c a // c
P Q does not represent a composition of statement but the attribution of T to the
conditional.
Here, P is called a sufficient condition for Q and Q is a necessary condition for P.
Consider two conditional statements :
I mplication
Examples
1) Determine which of the following always holds
a) x > y x > y b) x > y x > y
2) What conclusions can be drawn from the following.
3) a) If P Q and P is true, then Q is true.
b) If P Q and Q R, then P R.
c) If P Q, then (~Q) (~P); and vice versa. If P Q, then (~Q) (~P); and vice versa If P Q, then (~Q) (~P); and vice versa
a) If it rains, Ill stay at home.
Now, its raining.
Note : P (P Q) Q
b) If I go to cinema, Ill not read book.
I am now reading.
Note : (P Q) ~Q (~P)
I mplication
To prove P Q is equivalent to prove (~Q) (~P).
Such technique is called proof by contradiction
Example : Let p and q be two rational numbers.
Prove that if p + q\3 = 0 , then p = 0 = q
Solution : Suppose, on the contrary, p and q are not both zero.
Two cases arises :
1 q = 0
p + q\3 = 0 \3 = p/q
As p/q is rational and \3 is irrational, contradiction arises.
2 q = 0
p + q\3 = 0 p = 0, which is a contradiction
I mplication
When P Q is a tautology, it is called an implication and denoted by P Q.
Similarly, if P Q is always true, we write P is equivalent to Q
and is denoted by P Q.
As P Q (P Q) (Q P) , to prove P Q ,
we need to prove P Q and Q P
Example :
1) x = 3 x
2
3x = 0
2) x
2
3x = 0 x = 0 or 3
I mplication
To prove P Q , we need to prove P Q and Q P
Example : Let p, k be two positive integer and p be prime.
Prove that x
2
(k + 2)x + p = 0 has integral roots if and only if k = p 1.
Solution :
Let o , | be the integral roots, then o + | = k + 2 and o| = p
p is prime (o = 1 , | = p) or (o = p , | = 1)
o + | = p + 1
k + 2 = p + 1 k = p 1
:
As k = p 1 , the equation becomes
x
2
(p + 1)x + p = 0
(x 1)(x p) = 0
x = 1 or p , ie., the equation has integral roots
Problems:
Let o , | be the integral roots, then o + | = k + 2 and o| = p
p is prime (o = 1 , | = p) or (o = p , | = 1)
o + | = p + 1
k + 2 = p + 1 k = p 1
:
As k = p 1 , the equation becomes
x
2
(p + 1)x + p = 0
(x 1)(x p) = 0
x = 1 or p , ie., the equation has integral roots
Rules of Inference
Rules of inference provide the justification of the steps
used in a proof.
One important rule is called modus ponens or the law of
detachment. It is based on the tautology
(p(pq)) q. We write it in the following way:
p
p q
____
q
The two hypotheses p and p q are
written in a column, and the conclusion
below a bar, where means therefore.
Rules of Inference
The general form of a rule of inference is:
p
1
p
2
.
.
.
p
n
____
q
The rule states that if p
1
and p
2
and and p
n
are all
true, then q is true as well.
These rules of inference can be used in any
mathematical argument and do not
require any proof.
Rules of Inference
p
_____
pvq
Addition
pq
_____
p
Simplification
p
q
_____
pq
Conjunction
q
pq
_____
p
Modus tollens
pq
qr
_____
pr
Hypothetical
syllogism
pq
p
_____
q
Disjunctive
syllogism
Arguments
Just like a rule of inference, an argument consists of one
or more hypotheses and a conclusion.
We say that an argument is valid, if whenever all its
hypotheses are true, its conclusion is also true.
However, if any hypothesis is false, even a valid
argument can lead to an incorrect conclusion.
Arguments
Example:
If 101 is divisible by 3, then 101
2
is divisible by 9. 101 is
divisible by 3. Consequently, 101
2
is divisible by 9.
Although the argument is valid, its conclusion is
incorrect, because one of the hypotheses is false (101 is
divisible by 3.).
If in the above argument we replace 101 with 102, we
could correctly conclude that 102
2
is divisible by 9.
Arguments
Which rule of inference was used in the last argument?
p: 101 is divisible by 3.
q: 101
2
is divisible by 9.
p
pq
_____
q
Modus ponens
Unfortunately, one of the hypotheses (p) is false.
Therefore, the conclusion q is incorrect.
Arguments
Another example:
If it rains today, then we will not have a barbeque today.
If we do not have a barbeque today, then we will have a
barbeque tomorrow.
Therefore, if it rains today, then we will have a barbeque
tomorrow.
This is a valid argument: If its hypotheses are true, then
its conclusion is also true.
Arguments
Let us formalize the previous argument:
p: It is raining today.
q: We will not have a barbecue today.
r: We will have a barbecue tomorrow.
So the argument is of the following form:
pq
qr
_____
pr
Hypothetical
syllogism
Arguments
Another example:
Gary is either intelligent or a good actor.
If Gary is intelligent, then he can count
from 1 to 10.
Gary can only count from 1 to 2.
Therefore, Gary is a good actor.
i: Gary is intelligent.
a: Gary is a good actor.
c: Gary can count from 1 to 10.
Arguments
i: Gary is intelligent.
a: Gary is a good actor.
c: Gary can count from 1 to 10.
Step 1: c Hypothesis
Step 2: i c Hypothesis
Step 3: i Modus tollens Steps 1 & 2
Step 4: a v i Hypothesis
Step 5: a Disjunctive Syllogism
Steps 3 & 4
Conclusion: a (Gary is a good actor.)
Arguments
Yet another example:
If you listen to me, you will pass CS 320.
You passed CS 320.
Therefore, you have listened to me.
Is this argument valid?
No, it assumes ((pq) q) p.
This statement is not a tautology. It is false if p is false
and q is true.
Rules of Inference
Rule P: A premise may be introduced at any point in the derivation.
( ) ( ) P R S P R S .
Rule T: A formula S may be introduced in a derivation if S is
tautologically implied by any one or more of the preceding
formulas in the derivation.
Rule CP: If we can derive S from R and a set of premises, then we can
derive R S from the set of premises alone.
(i.e)
Consistency of Premises and Indirect Method of Proof
A set of formulas H
1
, H
2
, ,H
m
is said to be consistency if their
conjunction has the truth value T for some assignment of the truth values
to the atomic variables appearing H
1
, H
2
, ,H
m
. If, for every assignment
of the truth values to the atomic variables, at least on of the formulas
H
1
, H
2
, ,H
m
is false, then the formulas H
1
, H
2
, ,H
m
are called
inconsistent.
1 2
...
m
H H H R R . . . .
Contradiction
Indirect method of Proof (or) Proof by contradiction
1.Show that R S follows logically from the premises C D,
(C D)H, H (A B) and (A B) (R S).
2. Show that S R is tautologically implied by (P Q) (PR)
(QS).
3. Show that RS can be derived from the premises P(QS),
RP, and Q.
4. If there was a ball game, then travelling was difficult. If they arrived
on time, then travelling was not difficult. They arrived on time. There
fore, there was no ball game. Show that these statements constitute a
valid argument.
5. Show that the following premises are inconsistent.
1. If Jack misses many classes through illness, then he fails high school.
2. If Jack fails high school, then he is uneducated.
3. If Jack reads a lot of books, then he is not uneducated.
4. Jack misses many classes through illness and reads a lot of books.
Exercise:
Show the validity of the arguments.
1.
2.
Derive the following
1.
2.
Show that the following are inconsistent
1. PQ, PR,QR, P 2. A(BC), D(BC), A D.
Show the following.
1.
2.
( ) , , P Q R R S S P Q . v v
( ) ( ), ( ), A B A C B C D A D . . v
, ( ( )) P P Q R S Q S .
( ) P Q P P Q .
( ), , , R Q R S S Q P Q P v
( )
( ) , (( ) ), P Q R S Q P R R P Q v v
PREDICATE CALCULUS
QUANTIFIERS
Ram is a doctor
Is it a statement?
Subject
Predicate