SlideShare a Scribd company logo
Mathematical Foundations of
Computer Science
 Mathematical logic
 Set theory
 Algebraic Structures
 Elementary Combinatorics
 Recurrence relations
 Graph theory
Mathematical logic
 Statement (Proposition) : A declarative sentence to which it is
meaningful to assign one and only one of the truth values “true”
or “false”. We call such sentences Propositions (Statements).
 Ex. London is a city. Ex. 2+3 = 4
The following sentences are not statements.
 What is your name?
 Close the door
For definiteness let us list our assumptions about propositions.
 The law of excluded middle: For every proposition p,
either p is true or p is false.
 The law of contradiction: For every proposition p, it is not the
case that p is both true and false.
Atomic and Compound statements
 Atomic statement : A statement which can not be divided
further, is called atomic statement (Simple statement or
primary statement).
These statements are denoted by p,q,r,s,……
Ex. Milk is white Ex. 2+3 = 5
 Compound Statement : Two or more simple statements can be
combined to form a new statement. These new statements are
called Compound statements or Molecular Statements or
Propositional function or Statement formulas.
Ex. It is raining today and there are 20 tables in this room.
 Compound statements can be formed from atomic statements
through the use of following sentential connectives.
not, and , or , if …then and if and only if .
Connectives
 Negation: If p is a statement, then the negation of p, written as
~p and read as “ not p ” is a statement.
Ex. p : London is a city.
~p : London is not a city.
 The truth table for not p is given below.
p ~p
T
F
Conjunction (and) pq
 If p and q are two propositions, then the conjunction of p and q
is the statement p  q which is read as “ p and q ”.
 The statement p  q has the truth value T whenever both p and
q have truth value T; otherwise it has the truth value false.
Conjunctive syllogism: If p  q is false and p is true, then q is
false.
p q p  q
F
F
T
T
F
T
F
T
Disjunction ( Or ) pq
 If p and q are two propositions, then the disjunction of p and q
is the statement p  q which is read as “ p or q”.
 The statement pq has the truth value F only when both p and
q have truth value F; otherwise it has the truth value T.
Disjunctive syllogism: If p  q is true and p is false, then q is
true.
p q p  q
F
F
T
T
F
T
F
T
Implication (Conditional) pq
 If p and q are two propositions, then the statement pq
which is read as “ if p, then q ” or “ p implies q “.
 The statement pq has truth value F only when p is true
and q is false; otherwise it has a truth value T.
 A false antecedent p implies any proposition q.
 A true consequent q is implied by any proposition q
p q pq
F
F
T
T
F
T
F
T
Biconditional (if and only if) pq
 Biconditional : If p and q are two propositions, then the
statement pq, which is read as “p if and only if q” is called a
biconditional statement.
 The statement pq has the truth value T whenever both p and
q have identical truth values.
p q pq
F
F
T
T
F
T
F
T
More on Implication
 The opposite of pq is p  q
 The converse of pq is q  p
 The contra positive of pq is q  p
 Note : pq is logically equivalent to q  p
i.e., pq  q  p
or pq  q  p
* Ex. p: Today is Sunday
q: Today is Holiday
p  q : If today is Sunday, then today is
Holiday
q  p : If today is not Holiday, then today is not
Sunday
Well formed formulas
 A well formed formula can be generated by the following rules.
1. A statement variable standing alone is a well formed formula.
2. If P is a well formed formula, then ~P is a well formed
formula.
3. If P and Q are well formed formulas, then (PQ) , (PQ) ,
(PQ) and (PQ) are well formed formulas.
4. A string of symbols containing the statement
variables,connectives and parenthesis is a well formed formula,
iff it can be obtained by finitely many applications of the rules
1,2 and 3.
 Ex. (PQ) , (PQ) , (P (PQ) ) , (P (Q R)) and
(PQ) (PQ) are well formed formulas.
 Ex. PQ , (PQ )Q ) and (P Q )  (Q) are not well
formed formulas.
Truth tables
 Our basic concern is to determine the truth value of a statement
formula for each possible combination of the truth values of the
component statements.
 A table showing all such truth values is called the truth table of
the formula.
 Ex.1 Construct truth table for the statement formula P  Q
P Q Q P  Q
F
F
T
T
F
T
F
T
T
F
T
F
Truth tables - Examples
Ex : 2 Construct the truth table for (PQ)  P
P Q PQ P (PQ)  P
F
F
T
T
F
T
F
T
F
T
T
T
T
T
F
F
T
T
T
T
Truth tables - Examples
Ex.3 Construct the truth table for (PQ)  (QP)
P Q PQ QP (PQ)  (QP)
F
F
T
T
F
T
F
T
T
T
F
T
T
F
T
T
T
F
F
T
Note:
(PQ)  {(PQ)  (QP)}
Tautology and Contradiction
 Tautology : A propositional function (Statement formula) whose
value is true all all possible values of the propositional variables
is called a Tautology ( A Universally valid formula or a logical
truth).
Ex: P  P is a tautology.
Ex. ( P  P )  Q is a tautology.
 Contradiction (Absurdity): A propositional function whose truth
value is always false is called a Contradiction
Ex. P  P is a Contradiction .
Ex. ( P  P )  Q is a Contradiction
 Contingency: A propositional function that is neither a tautology
nor a contradiction is called a Contingency.
Ex. P  Q , P  Q , P Q, ….
Logical Equivalence & Tautological Implication
 Two propositional functions P and Q are logically equivalent, if
they have same truth tables. Then we write
P  Q or P  Q
Ex: (P )  P
Ex: ( P  Q )  ( P  Q ).
Note : The symbol  is not a connective
 A Statement P is said to tautologically imply a Statement Q if
and only if PQ is a tautology.We shall denote this as P  Q.
 Here, P and Q are related to the extent that, Whenever P has
the truth value T then so does Q.
 Every logical implication is an implication, but all implications
are not logical implications.
More on Implications
 If P  Q and Q  P , then PQ.
 If PQ then PQ is a tautology.
 Ex: Show that ( P Q )  ( P  Q )
 Since columns 3 and 5 are identical, The result follows
P Q PQ P PQ
F
F
T
T
F
T
F
T
T
T
F
T
T
T
F
F
T
T
F
T
Ex.Construct truth table for [(pq) (r)]  p]
 The truth table is given below
p q r pq r (pq) (r) [(pq) (r)] p]
F F F
F F T
F T F
F T T
T F F
T F T
T T F
T T T
F
F
F
F
F
F
T
T
T
F
T
F
T
F
T
F
T
F
T
F
T
F
T
T
F
T
F
T
T
F
T
T
Ex. Show that (PQ)  (Q  P)
 Let us prove the result using truth table.
P Q PQ Q P (Q P)
F
F
T
T
F
T
F
T
T
T
F
T
T
F
T
F
T
T
F
F
T
T
F
T
Ex. Using truth tables, show that ( P  Q )  (Q)
is a tautology
 The truth table is given below.
P Q P  Q ( P  Q ) Q ( P  Q )  (Q)
F
F
T
T
F
T
F
T
T
T
F
T
F
F
T
F
T
F
T
F
T
T
T
T
Equivalences
Commutative laws:
 P  Q  Q  P
 P  Q  Q  P
Asociative laws:
 ( P  Q )  R  P  ( Q  R )
 ( P  Q )  R  P  ( Q  R )
Distributive laws:
 P  ( Q  R )  ( P  Q )  ( P  R )
 P  ( Q  R )  ( P  Q )  ( P  R )
Demorgan’s laws:
  ( P  Q)   P   Q
  ( P  Q)   P   Q
More Equivalences
  ( P )  P (Double negation)
 P  P  P
 P  P  P
 P   P  T
 P   P  F
 R  ( P   P )  R
 R  ( P   P )  R
 R  ( P   P )  T
 R  ( P   P )  F
 P  Q  ( P  Q)
 ( P  Q )  (P   Q)
 P  Q  ( Q   P )
More Equivalences
• P  F  P
• P  T  T
• P  F  F
• P  T  P
• P  ( Q  R)  ( P  Q )  R
  ( P  Q )  (P   Q)
• (P  Q )  [( P  Q)  ( Q  P )]
• ( P  Q )  [( P  Q)  ( P   Q )]
• Absorption laws
• P  ( P  Q )  P
• P  ( P  Q )  P
Ex. Without using truth tables, Show that
P  ( Q  R)  ( P  Q )  R
 Proof:
L.H.S = P  (Q  R)
 P  (Q  R) (Since A  B  ( A  B))
 P  (Q  R)
 (P  Q)  R (By associative property)
 ( P  Q )  R (By demorgan’s law)
 ( P  Q )  R
= R.H.S
Ex. Without using truth tables, Show that
( P  Q )  P is a tautology.
Proof:
Consider, ( P  Q )  P
 ( Q  P )  P ( By commutative law )
 Q  (P  P ) ( By associative property)
 Q  T
 T
 ( P  Q )  P is a tautology.
Ex. Show that the Statement formula
( P  Q )  (PQ)  P is a tautology.
 Proof : Consider,
 {( P  Q )  (PQ)}  P (Associative law)
 {(P  Q )  (PQ)}  P ( Demorgan’s law)
  {P  (Q  Q)}  P (Distributive law)
  {P  T }  P
  {P }  P
  T
  ( P  Q )  (PQ)  P is a tautology
Ex. Show that [{( P  Q )  ( P  Q )}  R ]  R
 Proof: L.H.S = {( P  Q )  ( P  Q )}  R
  { T }  R (Since P  Q  ( P  Q))
  R
 = R.H.S
 Ex. Show that {( P  Q )  ( P  Q )} is a Contradiction.
 Proof : Let P  Q = R
 Consider, {( P  Q )  ( P  Q )}
  { R  R }
  F
  { ( P  Q )  ( P  Q )} is a contradiction.
Ex. Show that (P  (Q  R))  ( Q  R )  (P  R)  R
 Proof : Consider,
 {P  (Q  R)}  ( Q  R )  (P  R)
  {(P  Q)  R}  {( Q  R )  (P  R)}, By associative law
  { (P  Q)  R}  {(Q  P )  R} , By distributive law
  {(P Q)  R}  {(Q  P )  R} , By Demorgan’s law
  {(P Q)  (Q  P ) } R, By distributive law
  {T } R (Since, A  A  T)
  R
Ex. S.T. ((P  Q)  (P  (Q  R)))  ( P  Q)  (P   R)
is a tautology.
 Consider,
 [(P  Q)  {P  (Q  R)}]  {(P  Q)  (P  R)}
 [(P  Q)  {P  (Q  R)}]  {(P  Q)  (P  R)}
(By De morgan’s laws)
 [(P  Q)  {P  (Q  R)}]  {(P  Q)  (P  R)}
(By De morgan’s laws)
 [(P  Q)  {P  Q) (P  R)}]  {(P  Q)  (P  R)}
(By Distributive law)
  {(P  Q)  (P  R)}  {(P  Q)  (P  R)}
(Since A  A  A)
  T ( Since A  A T)
Normal forms
 Elementary product:A product of the variables and their
negations in a formula is called an Elementary product.
Ex: P, PQ, PQ, PQ R
 Elementary Sum: A Sum of the variables and their negations in
a formula is called an Elementary Sum.
Ex: P, P  Q, P  Q, P Q R
 Disjunctive normal form: A formula which is equivalent to a
given formula and which consists of a sum of elementary
products is called a disjunctive normal form.
 Ex: (P )  ( PQ )  (PQ).
 Ex: ( PQ )  (PQ)  (PQ R ).
Normal forms (contd.,)
 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.
Ex: (P )  ( P  Q ) (P  Q).
Ex: ( P  Q )  (P  Q) (P  Q  R ).
 Min terms: Let P and Q are two statement variables. Let us
construct all possible formulas which consist of conjunctions of
P or its negation and conjunctions of Q or its negation.
For two variables P and Q, there are 22 such formulas given by
PQ, PQ, PQ, PQ
These formulas are called ‘min terms’.
Normal forms (contd.,)
 For three variables P,Q and R, there are 23 such formulas given
by
PQ R, PQ R, PQ R, PQ R,
PQ R, PQ R, PQ R, PQ R
These min terms are denoted by m0, m1 , …, m7 respectively.
 In general, there are 2n min terms for n variables.
 Principal Disjunctive normal form (Sum of products canonical
form) : For a given formula, an equivalent formula consisting of
disjunctions of min terms only is known as Principal Disjunctive
normal form .
Ex. Obtain the Principal Disjunctive normal forms of the following
PQ , P  Q, (PQ)
 Solution:
 PQ  (PQ)  (PQ)  (PQ)
 P  Q  (PQ)  (PQ)  (PQ)
 (PQ)  (PQ)  (PQ)  (PQ)
P Q PQ P  Q PQ (PQ)
F
F
T
T
F
T
F
T
T
T
F
T
F
T
T
T
F
F
F
T
T
T
T
F
Ex. Obtain the Principal Disjunctive normal form of the following
P  {(PQ)  (P  Q)}
 Given formula is, [ P  {(PQ)  (P  Q)} ] = A (say)
The truth table for A is given below.
 A  (PQ)  (PQ)  (PQ)
 Which is the PDNF for A .
P Q PQ P  Q {(PQ) 
(P  Q)}
A
F
F
T
T
F
T
F
T
T
T
F
T
F
F
F
T
F
F
F
T
T
T
F
T
Ex. Obtain the Principal Disjunctive normal form of the following
(P  Q)  (Q  R)  (P  R )
 Solution: Consider, (P  Q)  (Q  R)  (P  R )
  {(P  Q)  (R  R)} 
{(P  P)  (Q  R) } 
{(P  R )  (Q  Q)}
(PQ R)  (PQ R)  (PQ R) (PQ R)
Which is the PDNF for the given formula.
Ex. Obtain the Principal Disjunctive normal form of the following
(P  Q)  (P  R )
= A (say)
 A  (PQ R)  (PQ R)  (PQ R) =  (m1, m6, m7)
P Q R P  Q P (P  R) A
F
F
F
F
T
T
T
T
F
F
T
T
F
F
T
T
F
T
F
T
F
T
F
T
T
T
F
F
F
F
T
T
T
T
T
T
F
F
F
F
F
T
F
T
T
T
T
T
F
T
F
F
F
F
T
T
Principal Conjunctive normal forms
(Product of Sums canonical forms)
 Max terms: For a given number of variables, the max term
consists of disjunctions in which each variable or its negation,
but not both, appears only once.
For two variables P and Q, there are 22 such formulas given by
(P  Q), (P  Q), (P  Q), (P  Q).
These formulas are called ‘max terms’.
 For three variables P,Q and R, there are 23 such formulas given
by
P  Q  R , P  Q  R, P  Q  R, P  Q  R,
P  Q  R, P  Q  R, P  Q  R, P  Q  R
These max terms are denoted by M0, M1 , …, M7 respectively.
 In general, there are 2n Max terms for n variables.
PCNF (Contd.,)
 Mi =  mi
 M0 =  m0
= (PQ R) = (P  Q  R)
 M1 =  m1
= (PQ R) = (P  Q   R)
 M2 =  m2
= (PQ R) = (P   Q  R)
 Principal Conjunctive normal form (Product of Sums canonical
form) : For a given formula, an equivalent formula
consisting of conjunctions of max terms only is known as
Principal Conjunctive normal form.
Ex. Obtain the Principal Conjunctive normal forms of the following
PQ , P  Q, (PQ)
 The PCNF’s are
 PQ  (P  Q)
 P  Q  (P  Q)  (P  Q)  (P  Q)
 (PQ)  (P  Q)  (P  Q)
P Q PQ P  Q PQ (PQ)
F
F
T
T
F
T
F
T
T
T
F
T
F
F
F
T
T
F
F
T
F
T
T
F
EX. Obtain the Principal Conjunctive normal form of the formula
given by (P  R)  (Q  P)
 Solution: (P  R)  (Q  P)
 (P  R)  {(PQ)  (QP)}
 (P  R)  (P  Q)  (Q  P)
 { (P  R)  (Q  Q) } 
{ (P  Q)  (R  R) } 
{ (Q  P)  (R  R) }
 (P  Q  R)  (P  Q  R)  (P  Q  R) 
( P  Q  R)  (P  Q  R)
= (0,2,3,4,5)
Which is the required PCNF.
Max terms and Min terms
 *
P Q R Min terms mi Max terms Mi
F
F
F
F
T
T
T
T
F
F
T
T
F
F
T
T
F
T
F
T
F
T
F
T
m0 : PQ R
m1 : PQ R
m2 : PQ R
m3 : PQ R
m4 : PQ R
m5 : PQ R
m6 : PQ R
m7 : PQ R
M0 : P  Q  R
M1 : P  Q  R
M2 : P  Q  R
M3 : P  Q  R
M4 : P  Q  R
M5 : P  Q  R
M6 : P  Q  R
M7 : P  Q  R
Ex. Obtain the Principal Conjunctive normal form and Principal
disjunctive normal form of A, where A = (P  Q) (P  R )
The PCNF of A = (0,2,4,5)
A  (P  Q  R)  (P  Q  R)  (P  Q  R) (P  Q  R)
P Q R P  Q P P  R A
F
F
F
F
T
T
T
T
F
F
T
T
F
F
T
T
F
T
F
T
F
T
F
T
F
F
F
F
F
F
T
T
T
T
T
T
F
F
F
F
F
T
F
T
F
F
F
F
F
T
F
T
F
F
T
T
Contd.,
The PDNF of A = (1,3,6,7)
A  (PQ R)  (PQ R)  (PQ R)  (PQ R)
Implications ,Arguments,Inferences
 Inference (Argument): From a set of premises (called
Hypotheses) {H1, H2, …., Hn } a conclusion C follows logically
iff H1  H2  ….  Hn  C.
• The rules of inference are criteria for determining the validity of
an argument.
• Any conclusion which is arrived at by following these rules is
called a valid conclusion, and the argument is called a valid
argument.
• The following statements are equivalent.
• 1. {H1 , H2 , …. , Hn }  C is a logical implication.
• 2. ( H1  H2  ….  Hn) C is a tautology.
• 3. {H1 , H2 ,…. , Hn }  C is a valid argument.
Rules of Inference
There are two rules of Inference
1) Rule P: A premise may be introduced at any point in the
derivation.
2) Rule T: A formula S may be introduced in a derivation if S is
tautologically implied by and/or equivalent to any one or more
of the preceding formulas in thederivation.
Rules of Inference (Logical Implications)
List of Implications
Rules of Inference (contd.,)
List of Equalence
Rules of Inference (contd.,)
List of Equalence
Rules of Inference (contd.,)
Simplification rules:
 (P  Q)  P
(P  Q)  P is a tautology.
P logically follows from (P  Q)
 (P  Q)  Q
(P  Q)  Q is a tautology.
Q logically follows from (P  Q)
Addition rules:
• P  (P  Q)
P  (P  Q) is a tautology
(P  Q) logically follows from P
Rules of Inference (contd.,)
 Q  ( P  Q )
Q  (P  Q) is a tautology
(P  Q) logically follows from Q
 P (P  Q)
P (P  Q) is a tautology
(P  Q) logically follows from P
 Q  ( P  Q)
Q (P  Q) is a tautology
(P  Q) logically follows from Q
 (P  Q)  P
(P  Q)  P is a tautology (or) P follows from (P  Q)
Rules of Inference (Contd.,)
 (P  Q )  (Q)
(P  Q )  (Q) is a tautology
Q logically follows from (P  Q)
 Disjunctive syllogism
{P, P  Q}  Q
{P  ( P  Q)}  Q is a tautology.
The inference P  Q
 P
----------------
 Q is valid
Modus ponens (Rule of detachment)
 {P, PQ}  Q
 { P  (PQ) }  Q is a Tautology
 The argument
PQ
P
------------
 Q is valid
 Ex: The following argument is valid.
A) If today is a Sunday then today is a Holiday
B) Today is Sunday
C : Hence, Today is Holiday
Modus tollens
 { PQ, Q }  P
 { (PQ)  Q}  (P) is a Tautology
 The argument
PQ
Q
------------
 P is valid
 Ex: The following argument is valid.
A) If today is a Sunday then today is a Holiday
B) Today is not Holiday
C : Hence, Today is not Sunday
Rule of Transitivity (Hypothetical Syllogism)
 { PQ, QR }  (PR)
 { (PQ)  (QR}  (PR) is a Tautology
 The argument
PQ
QR
------------
 PR is valid
 Ex: The following argument is valid.
A) If I Study well, then I will get distinction.
B) If I get distinction, then I will get a Good Job.
C:  If I Study well, then I will get a good job
Dilemma
 The Inference
P  Q
P  R
Q  R
------------
 R is a valid Inference.
 {P  Q, PR, QR }  R is a logical implication.
 {(PQ)  (PR}  (QR) }  R is a Tautology
Constructive dilemma
 The Inference
P  Q
P  R
Q  S
------------
 R  S is a valid Inference.
 {P  Q, PR, QS }  ( R  S ) is a logical implication.
 {(PQ)  (PR}  (QS) }  (R  S) is a Tautology
Destructive Dilemma
 The Inference
P  R
Q  S
R  S
----------------
 P  Q is a valid Inference.
 { PR, QS, R  S }  (P  Q ) is a logical implication.
 {(PR)  (QS)  (R  S )}  (P  Q) is a Tautology
Conjunction and Conjunctive Syllogism
 Conjunction
P, Q
----------
 (PQ)
 Conjunctive Syllogism:
 {(PQ), P }  Q
 {(PQ) P } Q is a tautology.
 (PQ)
P
--------
Q
Fallacies
 1. The fallacy of affirming the Consequent (or affirming the
converse):
PQ
Q
_________
 P Fallacy
Ex: Consider, the following argument
If today is Mahatma Gandhi’s Birth day, then today is October 2nd.
Today is October 2nd.
 Today is Mahatma Gandhi’s Birth day.
The argument is not valid
2. Fallacy of denying the antecedent
( Or Assuming the opposite)
 Consider the following
PQ
P
_________
Q Fallacy
 Ex: Consider the following argument:
H1 : If today is Sunday, then today is Holiday
H2 : Today is not Sunday
C :  Today is not Holiday
The argument is not Valid.This is the fallacy of assuming the
opposite.
The non sequitur fallacy
 P , Q
---------
 R is a fallacy.
Ex: Consider the following argument:
1. India’s Capital is New Delhi
2. Milk is White
C:  Sun rises in the East.
The conclusion does not follow from the premises.
Hence, the argument is invalid.
Ex: Show that R follows logically from the premises
PQ, QR, P
 Proof: Consider the premises,
PQ -----(1)
QR -----(2)
P ------(3)
{1} (1) P  Q Rule P
{2} (2) P Rule P
{1, 2} (3) Q Rule T, (1), (2), and I11.
{4} (4) Q  R Rule P
{1, 2, 4} (5) R Rule T, (3), (4) and I11.
Ex: Show that R follows logically from the premises
PQ, QR, P
 Proof: Consider the premises,
PQ -----(1)
QR -----(2)
P ------(3)
From (1) and (2), By the rule of transitivity,we have
PR --------(4)
From (3) and (4), By the rule of Modus ponens,
R follows.
 R logically follows from the given premises
Ex: Show that P follows logically from the premises
PQ, QR, R
 Proof: Consider the premises,
PQ -----(1)
QR -----(2)
R ------(3)
From (1) and (2), By the rule of transitivity,we have
PR --------(4)
From (3) and (4), By the rule of Modus tollens,
P follows.
 P logically follows from the given premises
Ex: Show that R follows logically from the premises
PQ, QR, PM, M
 Proof: Consider the premises,
P  Q -----(1)
Q  R -----(2)
P  M -----(3)
M ------(4)
From (3) and (4), By the rule of Modus tollens, we have
P --------(5)
From (1) and (5), By the rule of Disjunctive Syllogism,we have
Q --------(4)
From (2) and (4), By the rule of Modus ponens,
R follows.
Ex: Show that (R  S) follows logically from the premises
C  D, (C  D) H, H (A B), (A B)  (R  S )
 Proof: Consider the premises,
(C  D) -----(1)
(C  D)  H -----(2)
H  (A B) -----(3)
(A B)  (R  S ) ------(4)
From (2),(3) and (4), By the rule of Transitivity, we have
(C  D)  (R  S ) --------(5)
From (1) and (5), By the rule of Modus ponens,
(R  S) follows.
Ex: Show that S follows logically from the premises
P  (R S), RP, P
 Proof: Consider the premises,
P  (R S) -----(1)
R  P -----(2)
P -----(3)
From (1) and (3), By the rule of Modus ponens, we have
(R S) ------(4)
From (2), By Contra positive equivalence, we have
P  R -------(5)
(3) and (5), By the rule of Modus ponens, we have
R --------(6)
From (4) and (6), By the rule of Modus ponens, S follows.
Ex: Show that W follows logically from the premises
TR, S, T  W, R  S.
 Proof: Consider the premises,
T  R ------(1)
S -----(2)
T  W -----(3)
R  S -----(4)
From (1), By Contra positive equivalence, we have
R  T -------(5)
From, (5) and (3), By the rule of Transitivity, we have
R W --------(6)
From (4) and (2), By the rule of Disjunctive syllogism,we have
R ---------- (7)
 From(6)and (7), By the rule of Modus ponens, W follows
Ex: Show that TP follows logically from the premises
R(ST), R  W, P S, W
 Proof: Consider the premises,
R(ST) ------(1)
R  W -----(2)
P S -----(3)
W -----(4)
From (2) and (4), By the rule of Disjunctive syllogism,we have
R ---------(5)
From(1)and (5), By the rule of Modus ponens, we have
S T ---------(6)
From, (3) and (6), By the rule of Transitivity, we have
P  T ---------(7)
 ( T P ) (By Contra positive equivalence)
Conditional Proof (CP rule)
 Theorem: If {H1, H2, …., Hn } and P imply Q, then
{H1, H2, …., Hn } imply (PQ).
 Proof: From our assumption we have,
(H1 H2  ….  Hn  P)  Q
This assumption means (H1 H2  ….  Hn  P)  Q is a tautology.
Using the equivalence P (Q R)  (P  Q)  R
We can say that (H1 H2  ….  Hn)  ( PQ ) is a tautology.
Hence the theorem.
 Rule CP : If we can derive Q from P and a set of premises,then
we can derive PQ from the set of premises alone
Ex:Show that RS can be derived from the premises
p (Q S), RP, Q
 Solution: Instead of deriving RS, we shall include R as an
additional premise and show S first.
p (Q S) …..(1)
RP …..(2)
Q ……(3)
R …….(4)
From (2) and (4), By the rule of Disjunctive syllogism,we have
P ---------(5)
From(1)and (5), By the rule of Modus ponens, we have
Q S ………….(6)
From(3)and (6), By the rule of Modus ponens, S follows
 By CP rule, RS follows from the given premises.
Consistency, Inconsistency and Proof by Contradiction
 A set of formulas {H1, H2, …., Hn} is said to be consistent, if
their conjunction has truth value T for some assignment of the
truth values to the atomic variables appearing in H1, H2, …., Hn .
 A set of formulas {H1, H2, …., Hn} is said to be inconsistent, if
their conjunction implies a contradiction. that is
(H1 H2  ….  Hn )  (R  R) where R is any formula.
 Proof by Contradiction :
In order to show that,a conclusion C logically follows from the
premises H1, H2, …., Hn ,We assume that C is false and Consider
C as additional premise.
If the new set of premises is inconsistent, then our assumption
is wrong. Hence C follows.
Ex: Show that (PQ) follows from (P  Q)
 Solution: Let us introduce (PQ) as an additional premise and
show that this leads to contradiction.
(PQ) ….(1)
Which is equivalent to
(PQ) ….(2)
From (2), P follows
Given that, (P  Q) …..(3)
From (3), P follows
But, P and P cannot be simultaneously true (Contradiction).
 Our assumption is false.
Hence (PQ) follows from (P  Q)
Ex: Show that P follows from the premises PQ, (P  Q)
 Solution: Let us introduce P as an additional premise and show
that this leads to contradiction.
P ….(1)
PQ …..(2)
(PQ) ….(3)
From (1) and (2), By the rule of Moden ponens, we have
Q …….(4)
From (1) and (4), We have
( PQ) …….(5)
But, (3) and (5) cannot be simultaneously true (Contradiction).
 Our assumption is false.
Hence, P follows from the premises PQ, (P  Q)
Ex: Show that the following set of premises are inconsistent.
P Q, P R, Q  R, P
 Proof: Consider the premises,
P  Q ------(1)
P  R -----(2)
Q R -----(3)
P ----(4)
From (1) and (3), By the rule of transitivity, we have
P R …….(5)
From(2)and (4), By the rule of Modus ponens, R follows
From(4)and (5), By the rule of Modus ponens, R follows
But, R and R cannot be simultaneously true (Contradiction).
Hence, the given premises are inconsistent.
Ex: Show that the following set of premises are inconsistent.
R  M, R  S, M, S
 Proof: Consider the premises,
R  M ------(1)
R  S ----(2)
M -----(3)
S ----------(4)
From (1) and (3), By the rule of Disjunctive Syllogism,we have
R ……….(5)
From(2)and (4), By the rule of Disjunctive Syllogism, We have
R ………..(6)
But, R and R cannot be simultaneously true (Contradiction).
Hence, the given premises are inconsistent.
Ex: Verify that the following argument is valid by using the rules of
inference (Here, H1 , H2 , …. are premises and C is conclusion) :
H1 : If Joe is a Mathematician, then he is ambitious.
H2 : If Joe is an early riser, then he does not like oat meal.
H3 : If Joe is ambitious, then he is an early riser
C : Hence, if Joe is a Mathematician, then he does not like oat
meal.
 Solution: Let us make the following representations
p : Joe is a Mathematician.
q : Joe is ambitious
r : Joe is an early riser
s : Joe likes oat meal
The symbolic form of the given argument is
Contd.,
H1 : pq ….(1)
H2 : rs ….(2)
H3 : qr …..(3)
From (1) and (3), By the rule of transitivity, we have
pr ……(4)
From (4) and (2), By the rule of transitivity, we have
p  s ……(5)
i.e., if Joe is a Mathematician, then he does not like oat meal.
 The conclusion logically follows from the premises.
Hence, the argument is valid
Ex: Verify that the following argument is valid by using the rules of
inference (Here, H1 , H2 , …. are premises and C is conclusion) :
H1 : If Cliffton does not live in France, then he does not
speak French.
H2 : Cliffton does not drive a Datsun.
H3 : If Cliffton lives in France, then he rides a Bicycle.
H4 : Either Cliffton speaks French,or he drives a Datsun.
C : Hence, Cliffton drives a bicycle.
 Solution: Let us make the following representations
p : Cliffton lives in France.
q : Cliffton speaks French.
r : Cliffton drives a Datsun.
s : Cliffton drives a Bicycle.
The symbolic form of the given argument is
Contd.,
 H1 : p q …..(1)
H2 : r …..(2)
H3 : p  s …..(3)
H4 : q  r …….(4)
From (2) and (4), By the rule of Disjunctive Syllogism,we have
q ……..(5)
(1)  q  p …….(6)
From (5) and (6), By the rule of Modus ponens, we have
P ……(7)
From (3) and (7), By the rule of Modus ponens, s follows
 The conclusion logically follows from the premises.
Hence, the argument is valid
Ex:Using Symbolic logic, 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.
 Solution: Let us make the following representations
p : Jack misses many classes through illness
q : Jack fails high school
r : Jack is uneducated
s : Jack reads a lot of books
Now, the given premises can be represented as
Contd.,
p  q …..(1) q  r …..(2)
s  r …..(3) p  s …..(4)
From (1) and (2), By transitivity, p r …..(5)
From(3), By Contra positive equivalence, r  s ….. (6)
From (5) and (6), By transitivity, we have
p s …..(7)
From(4), we have
p …..(8)
From (7) and (8), By the rule of modus ponens, s follows
From (4), s follows
But, s and s cannot be simultaneously true (Contradiction).
Hence, the given premises are inconsistent
Ex:Using Symbolic logic,prove the following argument
If A works hard, then either B or C will enjoy themselves.
If B enjoys himself, then A will not work hard.
If D enjoys himself, then C will not enjoy himself.
Therefore, If A works hard, then D will not enjoy himself .
 Solution: Let us use the following representations.
A : A works hard.
B : B will enjoy himself.
C : C will enjoy himself.
D : D will enjoy himself.
Now, we have to show that, A  D follows from
A (B  C) , B  A and D  C
Contd.,
A (B  C) ….(1) B  A ….(2)
D  C ….(3) A …. (4) ( Additional premise)
From, (1) and (4), By modus ponens, We have
(B  C) ……(5)
(2)  A  B …. (6)
From, (4) and (6), By modus ponens, B ….(7) follows.
From (5) and (7), By the rule of Disjunctive Syllogism, we have
C ….(8)
(3)  C D …. (9)
From (8) and (9), By modus ponens, D follows
Hence, By CP rule, A  D follows

More Related Content

What's hot

Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
blaircomp2003
 
Logic&proof
Logic&proofLogic&proof
Logic&proof
Fathan Hakim
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
rey castro
 
Prolog Programming Language
Prolog Programming  LanguageProlog Programming  Language
Prolog Programming Language
Reham AlBlehid
 
Normal forms
Normal formsNormal forms
Normal forms
Viswanathasarma CH
 
Relation matrix & graphs in relations
Relation matrix &  graphs in relationsRelation matrix &  graphs in relations
Relation matrix & graphs in relations
Rachana Pathak
 
Unit 1 quantifiers
Unit 1  quantifiersUnit 1  quantifiers
Unit 1 quantifiers
raksharao
 
Number theory
Number theoryNumber theory
Number theory
manikanta361
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
Mamta Pandey
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2Ali Usman
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
Premsankar Chakkingal
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
Bipul Roy Bpl
 
Set theory
Set theorySet theory
Set theory
Shiwani Gupta
 
Formal Logic - Lesson 5 - Logical Equivalence
Formal Logic - Lesson 5 - Logical EquivalenceFormal Logic - Lesson 5 - Logical Equivalence
Formal Logic - Lesson 5 - Logical Equivalence
Laguna State Polytechnic University
 
Combinatorics
CombinatoricsCombinatorics
Combinatorics
Anjali Devi J S
 
Graph theory
Graph theoryGraph theory
Graph theory
Muthulakshmilakshmi2
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
Rupali Rana
 
Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logicankush_kumar
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Dr. Khaled Bakro
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
Vikas Sharma
 

What's hot (20)

Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
 
Logic&proof
Logic&proofLogic&proof
Logic&proof
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
 
Prolog Programming Language
Prolog Programming  LanguageProlog Programming  Language
Prolog Programming Language
 
Normal forms
Normal formsNormal forms
Normal forms
 
Relation matrix & graphs in relations
Relation matrix &  graphs in relationsRelation matrix &  graphs in relations
Relation matrix & graphs in relations
 
Unit 1 quantifiers
Unit 1  quantifiersUnit 1  quantifiers
Unit 1 quantifiers
 
Number theory
Number theoryNumber theory
Number theory
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
 
Set theory
Set theorySet theory
Set theory
 
Formal Logic - Lesson 5 - Logical Equivalence
Formal Logic - Lesson 5 - Logical EquivalenceFormal Logic - Lesson 5 - Logical Equivalence
Formal Logic - Lesson 5 - Logical Equivalence
 
Combinatorics
CombinatoricsCombinatorics
Combinatorics
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
 
Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logic
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 

Similar to Mathematical foundations of computer science

Lecture-3-and-4.pdf
Lecture-3-and-4.pdfLecture-3-and-4.pdf
Lecture-3-and-4.pdf
ssuserc478ac
 
UNIT-III-PPT.pptx
UNIT-III-PPT.pptxUNIT-III-PPT.pptx
UNIT-III-PPT.pptx
DakshBaveja
 
null-12.pdf
null-12.pdfnull-12.pdf
null-12.pdf
MOHAMMEDASHIK71
 
null-12.pdf
null-12.pdfnull-12.pdf
null-12.pdf
MOHAMMEDASHIK71
 
Per3 logika&pembuktian
Per3 logika&pembuktianPer3 logika&pembuktian
Per3 logika&pembuktian
Evert Sandye Taasiringan
 
logicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdflogicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdf
PradeeshSAI
 
Discrete math Truth Table
Discrete math Truth TableDiscrete math Truth Table
Discrete math Truth Table
University of Potsdam
 
Discreate Truth tables and laws of logic
Discreate Truth tables and laws of logicDiscreate Truth tables and laws of logic
Discreate Truth tables and laws of logic
ZenLooper
 
DMS UNIT-1 ppt.pptx
DMS UNIT-1 ppt.pptxDMS UNIT-1 ppt.pptx
DMS UNIT-1 ppt.pptx
DrMadhavaReddyCh
 
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1taimoor iftikhar
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]
DIwakar Rajput
 
Logic - Logical Propositions
Logic - Logical Propositions Logic - Logical Propositions
Logic - Logical Propositions
JosefMikaeldelCorro
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
NomanMehboob4
 
CS202Ch1.ppt
CS202Ch1.pptCS202Ch1.ppt
CS202Ch1.ppt
RuchiTuliWadhwa
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
University of Potsdam
 
2.pdf
2.pdf2.pdf

Similar to Mathematical foundations of computer science (20)

Lecture-3-and-4.pdf
Lecture-3-and-4.pdfLecture-3-and-4.pdf
Lecture-3-and-4.pdf
 
UNIT-III-PPT.pptx
UNIT-III-PPT.pptxUNIT-III-PPT.pptx
UNIT-III-PPT.pptx
 
null-12.pdf
null-12.pdfnull-12.pdf
null-12.pdf
 
null-12.pdf
null-12.pdfnull-12.pdf
null-12.pdf
 
Per3 logika&pembuktian
Per3 logika&pembuktianPer3 logika&pembuktian
Per3 logika&pembuktian
 
logicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdflogicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdf
 
Discrete math Truth Table
Discrete math Truth TableDiscrete math Truth Table
Discrete math Truth Table
 
Discreate Truth tables and laws of logic
Discreate Truth tables and laws of logicDiscreate Truth tables and laws of logic
Discreate Truth tables and laws of logic
 
DMS UNIT-1 ppt.pptx
DMS UNIT-1 ppt.pptxDMS UNIT-1 ppt.pptx
DMS UNIT-1 ppt.pptx
 
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]
 
Logic - Logical Propositions
Logic - Logical Propositions Logic - Logical Propositions
Logic - Logical Propositions
 
Dicrete structure
Dicrete structureDicrete structure
Dicrete structure
 
Mathematical Logic
Mathematical LogicMathematical Logic
Mathematical Logic
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
 
The logic
The logicThe logic
The logic
 
CS202Ch1.ppt
CS202Ch1.pptCS202Ch1.ppt
CS202Ch1.ppt
 
LOGIC
LOGICLOGIC
LOGIC
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
 
2.pdf
2.pdf2.pdf
2.pdf
 

More from BindhuBhargaviTalasi

Inheritance
InheritanceInheritance
Blood relations
Blood relationsBlood relations
Blood relations
BindhuBhargaviTalasi
 
Boost model accuracy of imbalanced covid 19 mortality prediction
Boost model accuracy of imbalanced covid 19 mortality predictionBoost model accuracy of imbalanced covid 19 mortality prediction
Boost model accuracy of imbalanced covid 19 mortality prediction
BindhuBhargaviTalasi
 
Batteries
BatteriesBatteries
Blue jacking
Blue jackingBlue jacking
Blue jacking
BindhuBhargaviTalasi
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
BindhuBhargaviTalasi
 
Algebraic structures
Algebraic structuresAlgebraic structures
Algebraic structures
BindhuBhargaviTalasi
 
Bike sharing prediction
Bike sharing predictionBike sharing prediction
Bike sharing prediction
BindhuBhargaviTalasi
 
Travel agency
Travel agencyTravel agency
Travel agency
BindhuBhargaviTalasi
 
Functions
FunctionsFunctions
Introduction to set theory
Introduction to set theoryIntroduction to set theory
Introduction to set theory
BindhuBhargaviTalasi
 
Library system
Library systemLibrary system
Library system
BindhuBhargaviTalasi
 
Data analytics
Data analyticsData analytics
Data analytics
BindhuBhargaviTalasi
 
Agristore
AgristoreAgristore
Collection framework
Collection frameworkCollection framework
Collection framework
BindhuBhargaviTalasi
 

More from BindhuBhargaviTalasi (20)

Inheritance
InheritanceInheritance
Inheritance
 
Blood relations
Blood relationsBlood relations
Blood relations
 
Boost model accuracy of imbalanced covid 19 mortality prediction
Boost model accuracy of imbalanced covid 19 mortality predictionBoost model accuracy of imbalanced covid 19 mortality prediction
Boost model accuracy of imbalanced covid 19 mortality prediction
 
Battery
BatteryBattery
Battery
 
Batteries
BatteriesBatteries
Batteries
 
Water
WaterWater
Water
 
Stories
StoriesStories
Stories
 
Predicates
PredicatesPredicates
Predicates
 
Jdbc
JdbcJdbc
Jdbc
 
Blue jacking
Blue jackingBlue jacking
Blue jacking
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
 
Algebraic structures
Algebraic structuresAlgebraic structures
Algebraic structures
 
Bike sharing prediction
Bike sharing predictionBike sharing prediction
Bike sharing prediction
 
Travel agency
Travel agencyTravel agency
Travel agency
 
Functions
FunctionsFunctions
Functions
 
Introduction to set theory
Introduction to set theoryIntroduction to set theory
Introduction to set theory
 
Library system
Library systemLibrary system
Library system
 
Data analytics
Data analyticsData analytics
Data analytics
 
Agristore
AgristoreAgristore
Agristore
 
Collection framework
Collection frameworkCollection framework
Collection framework
 

Recently uploaded

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 

Recently uploaded (20)

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 

Mathematical foundations of computer science

  • 1. Mathematical Foundations of Computer Science  Mathematical logic  Set theory  Algebraic Structures  Elementary Combinatorics  Recurrence relations  Graph theory
  • 2. Mathematical logic  Statement (Proposition) : A declarative sentence to which it is meaningful to assign one and only one of the truth values “true” or “false”. We call such sentences Propositions (Statements).  Ex. London is a city. Ex. 2+3 = 4 The following sentences are not statements.  What is your name?  Close the door For definiteness let us list our assumptions about propositions.  The law of excluded middle: For every proposition p, either p is true or p is false.  The law of contradiction: For every proposition p, it is not the case that p is both true and false.
  • 3. Atomic and Compound statements  Atomic statement : A statement which can not be divided further, is called atomic statement (Simple statement or primary statement). These statements are denoted by p,q,r,s,…… Ex. Milk is white Ex. 2+3 = 5  Compound Statement : Two or more simple statements can be combined to form a new statement. These new statements are called Compound statements or Molecular Statements or Propositional function or Statement formulas. Ex. It is raining today and there are 20 tables in this room.  Compound statements can be formed from atomic statements through the use of following sentential connectives. not, and , or , if …then and if and only if .
  • 4. Connectives  Negation: If p is a statement, then the negation of p, written as ~p and read as “ not p ” is a statement. Ex. p : London is a city. ~p : London is not a city.  The truth table for not p is given below. p ~p T F
  • 5. Conjunction (and) pq  If p and q are two propositions, then the conjunction of p and q is the statement p  q which is read as “ p and q ”.  The statement p  q has the truth value T whenever both p and q have truth value T; otherwise it has the truth value false. Conjunctive syllogism: If p  q is false and p is true, then q is false. p q p  q F F T T F T F T
  • 6. Disjunction ( Or ) pq  If p and q are two propositions, then the disjunction of p and q is the statement p  q which is read as “ p or q”.  The statement pq has the truth value F only when both p and q have truth value F; otherwise it has the truth value T. Disjunctive syllogism: If p  q is true and p is false, then q is true. p q p  q F F T T F T F T
  • 7. Implication (Conditional) pq  If p and q are two propositions, then the statement pq which is read as “ if p, then q ” or “ p implies q “.  The statement pq has truth value F only when p is true and q is false; otherwise it has a truth value T.  A false antecedent p implies any proposition q.  A true consequent q is implied by any proposition q p q pq F F T T F T F T
  • 8. Biconditional (if and only if) pq  Biconditional : If p and q are two propositions, then the statement pq, which is read as “p if and only if q” is called a biconditional statement.  The statement pq has the truth value T whenever both p and q have identical truth values. p q pq F F T T F T F T
  • 9. More on Implication  The opposite of pq is p  q  The converse of pq is q  p  The contra positive of pq is q  p  Note : pq is logically equivalent to q  p i.e., pq  q  p or pq  q  p * Ex. p: Today is Sunday q: Today is Holiday p  q : If today is Sunday, then today is Holiday q  p : If today is not Holiday, then today is not Sunday
  • 10. Well formed formulas  A well formed formula can be generated by the following rules. 1. A statement variable standing alone is a well formed formula. 2. If P is a well formed formula, then ~P is a well formed formula. 3. If P and Q are well formed formulas, then (PQ) , (PQ) , (PQ) and (PQ) are well formed formulas. 4. A string of symbols containing the statement variables,connectives and parenthesis is a well formed formula, iff it can be obtained by finitely many applications of the rules 1,2 and 3.  Ex. (PQ) , (PQ) , (P (PQ) ) , (P (Q R)) and (PQ) (PQ) are well formed formulas.  Ex. PQ , (PQ )Q ) and (P Q )  (Q) are not well formed formulas.
  • 11. Truth tables  Our basic concern is to determine the truth value of a statement formula for each possible combination of the truth values of the component statements.  A table showing all such truth values is called the truth table of the formula.  Ex.1 Construct truth table for the statement formula P  Q P Q Q P  Q F F T T F T F T T F T F
  • 12. Truth tables - Examples Ex : 2 Construct the truth table for (PQ)  P P Q PQ P (PQ)  P F F T T F T F T F T T T T T F F T T T T
  • 13. Truth tables - Examples Ex.3 Construct the truth table for (PQ)  (QP) P Q PQ QP (PQ)  (QP) F F T T F T F T T T F T T F T T T F F T Note: (PQ)  {(PQ)  (QP)}
  • 14. Tautology and Contradiction  Tautology : A propositional function (Statement formula) whose value is true all all possible values of the propositional variables is called a Tautology ( A Universally valid formula or a logical truth). Ex: P  P is a tautology. Ex. ( P  P )  Q is a tautology.  Contradiction (Absurdity): A propositional function whose truth value is always false is called a Contradiction Ex. P  P is a Contradiction . Ex. ( P  P )  Q is a Contradiction  Contingency: A propositional function that is neither a tautology nor a contradiction is called a Contingency. Ex. P  Q , P  Q , P Q, ….
  • 15. Logical Equivalence & Tautological Implication  Two propositional functions P and Q are logically equivalent, if they have same truth tables. Then we write P  Q or P  Q Ex: (P )  P Ex: ( P  Q )  ( P  Q ). Note : The symbol  is not a connective  A Statement P is said to tautologically imply a Statement Q if and only if PQ is a tautology.We shall denote this as P  Q.  Here, P and Q are related to the extent that, Whenever P has the truth value T then so does Q.  Every logical implication is an implication, but all implications are not logical implications.
  • 16. More on Implications  If P  Q and Q  P , then PQ.  If PQ then PQ is a tautology.  Ex: Show that ( P Q )  ( P  Q )  Since columns 3 and 5 are identical, The result follows P Q PQ P PQ F F T T F T F T T T F T T T F F T T F T
  • 17. Ex.Construct truth table for [(pq) (r)]  p]  The truth table is given below p q r pq r (pq) (r) [(pq) (r)] p] F F F F F T F T F F T T T F F T F T T T F T T T F F F F F F T T T F T F T F T F T F T F T F T T F T F T T F T T
  • 18. Ex. Show that (PQ)  (Q  P)  Let us prove the result using truth table. P Q PQ Q P (Q P) F F T T F T F T T T F T T F T F T T F F T T F T
  • 19. Ex. Using truth tables, show that ( P  Q )  (Q) is a tautology  The truth table is given below. P Q P  Q ( P  Q ) Q ( P  Q )  (Q) F F T T F T F T T T F T F F T F T F T F T T T T
  • 20. Equivalences Commutative laws:  P  Q  Q  P  P  Q  Q  P Asociative laws:  ( P  Q )  R  P  ( Q  R )  ( P  Q )  R  P  ( Q  R ) Distributive laws:  P  ( Q  R )  ( P  Q )  ( P  R )  P  ( Q  R )  ( P  Q )  ( P  R ) Demorgan’s laws:   ( P  Q)   P   Q   ( P  Q)   P   Q
  • 21. More Equivalences   ( P )  P (Double negation)  P  P  P  P  P  P  P   P  T  P   P  F  R  ( P   P )  R  R  ( P   P )  R  R  ( P   P )  T  R  ( P   P )  F  P  Q  ( P  Q)  ( P  Q )  (P   Q)  P  Q  ( Q   P )
  • 22. More Equivalences • P  F  P • P  T  T • P  F  F • P  T  P • P  ( Q  R)  ( P  Q )  R   ( P  Q )  (P   Q) • (P  Q )  [( P  Q)  ( Q  P )] • ( P  Q )  [( P  Q)  ( P   Q )] • Absorption laws • P  ( P  Q )  P • P  ( P  Q )  P
  • 23. Ex. Without using truth tables, Show that P  ( Q  R)  ( P  Q )  R  Proof: L.H.S = P  (Q  R)  P  (Q  R) (Since A  B  ( A  B))  P  (Q  R)  (P  Q)  R (By associative property)  ( P  Q )  R (By demorgan’s law)  ( P  Q )  R = R.H.S
  • 24. Ex. Without using truth tables, Show that ( P  Q )  P is a tautology. Proof: Consider, ( P  Q )  P  ( Q  P )  P ( By commutative law )  Q  (P  P ) ( By associative property)  Q  T  T  ( P  Q )  P is a tautology.
  • 25. Ex. Show that the Statement formula ( P  Q )  (PQ)  P is a tautology.  Proof : Consider,  {( P  Q )  (PQ)}  P (Associative law)  {(P  Q )  (PQ)}  P ( Demorgan’s law)   {P  (Q  Q)}  P (Distributive law)   {P  T }  P   {P }  P   T   ( P  Q )  (PQ)  P is a tautology
  • 26. Ex. Show that [{( P  Q )  ( P  Q )}  R ]  R  Proof: L.H.S = {( P  Q )  ( P  Q )}  R   { T }  R (Since P  Q  ( P  Q))   R  = R.H.S  Ex. Show that {( P  Q )  ( P  Q )} is a Contradiction.  Proof : Let P  Q = R  Consider, {( P  Q )  ( P  Q )}   { R  R }   F   { ( P  Q )  ( P  Q )} is a contradiction.
  • 27. Ex. Show that (P  (Q  R))  ( Q  R )  (P  R)  R  Proof : Consider,  {P  (Q  R)}  ( Q  R )  (P  R)   {(P  Q)  R}  {( Q  R )  (P  R)}, By associative law   { (P  Q)  R}  {(Q  P )  R} , By distributive law   {(P Q)  R}  {(Q  P )  R} , By Demorgan’s law   {(P Q)  (Q  P ) } R, By distributive law   {T } R (Since, A  A  T)   R
  • 28. Ex. S.T. ((P  Q)  (P  (Q  R)))  ( P  Q)  (P   R) is a tautology.  Consider,  [(P  Q)  {P  (Q  R)}]  {(P  Q)  (P  R)}  [(P  Q)  {P  (Q  R)}]  {(P  Q)  (P  R)} (By De morgan’s laws)  [(P  Q)  {P  (Q  R)}]  {(P  Q)  (P  R)} (By De morgan’s laws)  [(P  Q)  {P  Q) (P  R)}]  {(P  Q)  (P  R)} (By Distributive law)   {(P  Q)  (P  R)}  {(P  Q)  (P  R)} (Since A  A  A)   T ( Since A  A T)
  • 29. Normal forms  Elementary product:A product of the variables and their negations in a formula is called an Elementary product. Ex: P, PQ, PQ, PQ R  Elementary Sum: A Sum of the variables and their negations in a formula is called an Elementary Sum. Ex: P, P  Q, P  Q, P Q R  Disjunctive normal form: A formula which is equivalent to a given formula and which consists of a sum of elementary products is called a disjunctive normal form.  Ex: (P )  ( PQ )  (PQ).  Ex: ( PQ )  (PQ)  (PQ R ).
  • 30. Normal forms (contd.,)  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. Ex: (P )  ( P  Q ) (P  Q). Ex: ( P  Q )  (P  Q) (P  Q  R ).  Min terms: Let P and Q are two statement variables. Let us construct all possible formulas which consist of conjunctions of P or its negation and conjunctions of Q or its negation. For two variables P and Q, there are 22 such formulas given by PQ, PQ, PQ, PQ These formulas are called ‘min terms’.
  • 31. Normal forms (contd.,)  For three variables P,Q and R, there are 23 such formulas given by PQ R, PQ R, PQ R, PQ R, PQ R, PQ R, PQ R, PQ R These min terms are denoted by m0, m1 , …, m7 respectively.  In general, there are 2n min terms for n variables.  Principal Disjunctive normal form (Sum of products canonical form) : For a given formula, an equivalent formula consisting of disjunctions of min terms only is known as Principal Disjunctive normal form .
  • 32. Ex. Obtain the Principal Disjunctive normal forms of the following PQ , P  Q, (PQ)  Solution:  PQ  (PQ)  (PQ)  (PQ)  P  Q  (PQ)  (PQ)  (PQ)  (PQ)  (PQ)  (PQ)  (PQ) P Q PQ P  Q PQ (PQ) F F T T F T F T T T F T F T T T F F F T T T T F
  • 33. Ex. Obtain the Principal Disjunctive normal form of the following P  {(PQ)  (P  Q)}  Given formula is, [ P  {(PQ)  (P  Q)} ] = A (say) The truth table for A is given below.  A  (PQ)  (PQ)  (PQ)  Which is the PDNF for A . P Q PQ P  Q {(PQ)  (P  Q)} A F F T T F T F T T T F T F F F T F F F T T T F T
  • 34. Ex. Obtain the Principal Disjunctive normal form of the following (P  Q)  (Q  R)  (P  R )  Solution: Consider, (P  Q)  (Q  R)  (P  R )   {(P  Q)  (R  R)}  {(P  P)  (Q  R) }  {(P  R )  (Q  Q)} (PQ R)  (PQ R)  (PQ R) (PQ R) Which is the PDNF for the given formula.
  • 35. Ex. Obtain the Principal Disjunctive normal form of the following (P  Q)  (P  R ) = A (say)  A  (PQ R)  (PQ R)  (PQ R) =  (m1, m6, m7) P Q R P  Q P (P  R) A F F F F T T T T F F T T F F T T F T F T F T F T T T F F F F T T T T T T F F F F F T F T T T T T F T F F F F T T
  • 36. Principal Conjunctive normal forms (Product of Sums canonical forms)  Max terms: For a given number of variables, the max term consists of disjunctions in which each variable or its negation, but not both, appears only once. For two variables P and Q, there are 22 such formulas given by (P  Q), (P  Q), (P  Q), (P  Q). These formulas are called ‘max terms’.  For three variables P,Q and R, there are 23 such formulas given by P  Q  R , P  Q  R, P  Q  R, P  Q  R, P  Q  R, P  Q  R, P  Q  R, P  Q  R These max terms are denoted by M0, M1 , …, M7 respectively.  In general, there are 2n Max terms for n variables.
  • 37. PCNF (Contd.,)  Mi =  mi  M0 =  m0 = (PQ R) = (P  Q  R)  M1 =  m1 = (PQ R) = (P  Q   R)  M2 =  m2 = (PQ R) = (P   Q  R)  Principal Conjunctive normal form (Product of Sums canonical form) : For a given formula, an equivalent formula consisting of conjunctions of max terms only is known as Principal Conjunctive normal form.
  • 38. Ex. Obtain the Principal Conjunctive normal forms of the following PQ , P  Q, (PQ)  The PCNF’s are  PQ  (P  Q)  P  Q  (P  Q)  (P  Q)  (P  Q)  (PQ)  (P  Q)  (P  Q) P Q PQ P  Q PQ (PQ) F F T T F T F T T T F T F F F T T F F T F T T F
  • 39. EX. Obtain the Principal Conjunctive normal form of the formula given by (P  R)  (Q  P)  Solution: (P  R)  (Q  P)  (P  R)  {(PQ)  (QP)}  (P  R)  (P  Q)  (Q  P)  { (P  R)  (Q  Q) }  { (P  Q)  (R  R) }  { (Q  P)  (R  R) }  (P  Q  R)  (P  Q  R)  (P  Q  R)  ( P  Q  R)  (P  Q  R) = (0,2,3,4,5) Which is the required PCNF.
  • 40. Max terms and Min terms  * P Q R Min terms mi Max terms Mi F F F F T T T T F F T T F F T T F T F T F T F T m0 : PQ R m1 : PQ R m2 : PQ R m3 : PQ R m4 : PQ R m5 : PQ R m6 : PQ R m7 : PQ R M0 : P  Q  R M1 : P  Q  R M2 : P  Q  R M3 : P  Q  R M4 : P  Q  R M5 : P  Q  R M6 : P  Q  R M7 : P  Q  R
  • 41. Ex. Obtain the Principal Conjunctive normal form and Principal disjunctive normal form of A, where A = (P  Q) (P  R ) The PCNF of A = (0,2,4,5) A  (P  Q  R)  (P  Q  R)  (P  Q  R) (P  Q  R) P Q R P  Q P P  R A F F F F T T T T F F T T F F T T F T F T F T F T F F F F F F T T T T T T F F F F F T F T F F F F F T F T F F T T
  • 42. Contd., The PDNF of A = (1,3,6,7) A  (PQ R)  (PQ R)  (PQ R)  (PQ R)
  • 43. Implications ,Arguments,Inferences  Inference (Argument): From a set of premises (called Hypotheses) {H1, H2, …., Hn } a conclusion C follows logically iff H1  H2  ….  Hn  C. • The rules of inference are criteria for determining the validity of an argument. • Any conclusion which is arrived at by following these rules is called a valid conclusion, and the argument is called a valid argument. • The following statements are equivalent. • 1. {H1 , H2 , …. , Hn }  C is a logical implication. • 2. ( H1  H2  ….  Hn) C is a tautology. • 3. {H1 , H2 ,…. , Hn }  C is a valid argument.
  • 44. Rules of Inference There are two rules of Inference 1) Rule P: A premise may be introduced at any point in the derivation. 2) Rule T: A formula S may be introduced in a derivation if S is tautologically implied by and/or equivalent to any one or more of the preceding formulas in thederivation.
  • 45. Rules of Inference (Logical Implications) List of Implications
  • 46. Rules of Inference (contd.,) List of Equalence
  • 47. Rules of Inference (contd.,) List of Equalence
  • 48. Rules of Inference (contd.,) Simplification rules:  (P  Q)  P (P  Q)  P is a tautology. P logically follows from (P  Q)  (P  Q)  Q (P  Q)  Q is a tautology. Q logically follows from (P  Q) Addition rules: • P  (P  Q) P  (P  Q) is a tautology (P  Q) logically follows from P
  • 49. Rules of Inference (contd.,)  Q  ( P  Q ) Q  (P  Q) is a tautology (P  Q) logically follows from Q  P (P  Q) P (P  Q) is a tautology (P  Q) logically follows from P  Q  ( P  Q) Q (P  Q) is a tautology (P  Q) logically follows from Q  (P  Q)  P (P  Q)  P is a tautology (or) P follows from (P  Q)
  • 50. Rules of Inference (Contd.,)  (P  Q )  (Q) (P  Q )  (Q) is a tautology Q logically follows from (P  Q)  Disjunctive syllogism {P, P  Q}  Q {P  ( P  Q)}  Q is a tautology. The inference P  Q  P ----------------  Q is valid
  • 51. Modus ponens (Rule of detachment)  {P, PQ}  Q  { P  (PQ) }  Q is a Tautology  The argument PQ P ------------  Q is valid  Ex: The following argument is valid. A) If today is a Sunday then today is a Holiday B) Today is Sunday C : Hence, Today is Holiday
  • 52. Modus tollens  { PQ, Q }  P  { (PQ)  Q}  (P) is a Tautology  The argument PQ Q ------------  P is valid  Ex: The following argument is valid. A) If today is a Sunday then today is a Holiday B) Today is not Holiday C : Hence, Today is not Sunday
  • 53. Rule of Transitivity (Hypothetical Syllogism)  { PQ, QR }  (PR)  { (PQ)  (QR}  (PR) is a Tautology  The argument PQ QR ------------  PR is valid  Ex: The following argument is valid. A) If I Study well, then I will get distinction. B) If I get distinction, then I will get a Good Job. C:  If I Study well, then I will get a good job
  • 54. Dilemma  The Inference P  Q P  R Q  R ------------  R is a valid Inference.  {P  Q, PR, QR }  R is a logical implication.  {(PQ)  (PR}  (QR) }  R is a Tautology
  • 55. Constructive dilemma  The Inference P  Q P  R Q  S ------------  R  S is a valid Inference.  {P  Q, PR, QS }  ( R  S ) is a logical implication.  {(PQ)  (PR}  (QS) }  (R  S) is a Tautology
  • 56. Destructive Dilemma  The Inference P  R Q  S R  S ----------------  P  Q is a valid Inference.  { PR, QS, R  S }  (P  Q ) is a logical implication.  {(PR)  (QS)  (R  S )}  (P  Q) is a Tautology
  • 57. Conjunction and Conjunctive Syllogism  Conjunction P, Q ----------  (PQ)  Conjunctive Syllogism:  {(PQ), P }  Q  {(PQ) P } Q is a tautology.  (PQ) P -------- Q
  • 58. Fallacies  1. The fallacy of affirming the Consequent (or affirming the converse): PQ Q _________  P Fallacy Ex: Consider, the following argument If today is Mahatma Gandhi’s Birth day, then today is October 2nd. Today is October 2nd.  Today is Mahatma Gandhi’s Birth day. The argument is not valid
  • 59. 2. Fallacy of denying the antecedent ( Or Assuming the opposite)  Consider the following PQ P _________ Q Fallacy  Ex: Consider the following argument: H1 : If today is Sunday, then today is Holiday H2 : Today is not Sunday C :  Today is not Holiday The argument is not Valid.This is the fallacy of assuming the opposite.
  • 60. The non sequitur fallacy  P , Q ---------  R is a fallacy. Ex: Consider the following argument: 1. India’s Capital is New Delhi 2. Milk is White C:  Sun rises in the East. The conclusion does not follow from the premises. Hence, the argument is invalid.
  • 61. Ex: Show that R follows logically from the premises PQ, QR, P  Proof: Consider the premises, PQ -----(1) QR -----(2) P ------(3) {1} (1) P  Q Rule P {2} (2) P Rule P {1, 2} (3) Q Rule T, (1), (2), and I11. {4} (4) Q  R Rule P {1, 2, 4} (5) R Rule T, (3), (4) and I11.
  • 62. Ex: Show that R follows logically from the premises PQ, QR, P  Proof: Consider the premises, PQ -----(1) QR -----(2) P ------(3) From (1) and (2), By the rule of transitivity,we have PR --------(4) From (3) and (4), By the rule of Modus ponens, R follows.  R logically follows from the given premises
  • 63. Ex: Show that P follows logically from the premises PQ, QR, R  Proof: Consider the premises, PQ -----(1) QR -----(2) R ------(3) From (1) and (2), By the rule of transitivity,we have PR --------(4) From (3) and (4), By the rule of Modus tollens, P follows.  P logically follows from the given premises
  • 64. Ex: Show that R follows logically from the premises PQ, QR, PM, M  Proof: Consider the premises, P  Q -----(1) Q  R -----(2) P  M -----(3) M ------(4) From (3) and (4), By the rule of Modus tollens, we have P --------(5) From (1) and (5), By the rule of Disjunctive Syllogism,we have Q --------(4) From (2) and (4), By the rule of Modus ponens, R follows.
  • 65. Ex: Show that (R  S) follows logically from the premises C  D, (C  D) H, H (A B), (A B)  (R  S )  Proof: Consider the premises, (C  D) -----(1) (C  D)  H -----(2) H  (A B) -----(3) (A B)  (R  S ) ------(4) From (2),(3) and (4), By the rule of Transitivity, we have (C  D)  (R  S ) --------(5) From (1) and (5), By the rule of Modus ponens, (R  S) follows.
  • 66. Ex: Show that S follows logically from the premises P  (R S), RP, P  Proof: Consider the premises, P  (R S) -----(1) R  P -----(2) P -----(3) From (1) and (3), By the rule of Modus ponens, we have (R S) ------(4) From (2), By Contra positive equivalence, we have P  R -------(5) (3) and (5), By the rule of Modus ponens, we have R --------(6) From (4) and (6), By the rule of Modus ponens, S follows.
  • 67. Ex: Show that W follows logically from the premises TR, S, T  W, R  S.  Proof: Consider the premises, T  R ------(1) S -----(2) T  W -----(3) R  S -----(4) From (1), By Contra positive equivalence, we have R  T -------(5) From, (5) and (3), By the rule of Transitivity, we have R W --------(6) From (4) and (2), By the rule of Disjunctive syllogism,we have R ---------- (7)  From(6)and (7), By the rule of Modus ponens, W follows
  • 68. Ex: Show that TP follows logically from the premises R(ST), R  W, P S, W  Proof: Consider the premises, R(ST) ------(1) R  W -----(2) P S -----(3) W -----(4) From (2) and (4), By the rule of Disjunctive syllogism,we have R ---------(5) From(1)and (5), By the rule of Modus ponens, we have S T ---------(6) From, (3) and (6), By the rule of Transitivity, we have P  T ---------(7)  ( T P ) (By Contra positive equivalence)
  • 69. Conditional Proof (CP rule)  Theorem: If {H1, H2, …., Hn } and P imply Q, then {H1, H2, …., Hn } imply (PQ).  Proof: From our assumption we have, (H1 H2  ….  Hn  P)  Q This assumption means (H1 H2  ….  Hn  P)  Q is a tautology. Using the equivalence P (Q R)  (P  Q)  R We can say that (H1 H2  ….  Hn)  ( PQ ) is a tautology. Hence the theorem.  Rule CP : If we can derive Q from P and a set of premises,then we can derive PQ from the set of premises alone
  • 70. Ex:Show that RS can be derived from the premises p (Q S), RP, Q  Solution: Instead of deriving RS, we shall include R as an additional premise and show S first. p (Q S) …..(1) RP …..(2) Q ……(3) R …….(4) From (2) and (4), By the rule of Disjunctive syllogism,we have P ---------(5) From(1)and (5), By the rule of Modus ponens, we have Q S ………….(6) From(3)and (6), By the rule of Modus ponens, S follows  By CP rule, RS follows from the given premises.
  • 71. Consistency, Inconsistency and Proof by Contradiction  A set of formulas {H1, H2, …., Hn} is said to be consistent, if their conjunction has truth value T for some assignment of the truth values to the atomic variables appearing in H1, H2, …., Hn .  A set of formulas {H1, H2, …., Hn} is said to be inconsistent, if their conjunction implies a contradiction. that is (H1 H2  ….  Hn )  (R  R) where R is any formula.  Proof by Contradiction : In order to show that,a conclusion C logically follows from the premises H1, H2, …., Hn ,We assume that C is false and Consider C as additional premise. If the new set of premises is inconsistent, then our assumption is wrong. Hence C follows.
  • 72. Ex: Show that (PQ) follows from (P  Q)  Solution: Let us introduce (PQ) as an additional premise and show that this leads to contradiction. (PQ) ….(1) Which is equivalent to (PQ) ….(2) From (2), P follows Given that, (P  Q) …..(3) From (3), P follows But, P and P cannot be simultaneously true (Contradiction).  Our assumption is false. Hence (PQ) follows from (P  Q)
  • 73. Ex: Show that P follows from the premises PQ, (P  Q)  Solution: Let us introduce P as an additional premise and show that this leads to contradiction. P ….(1) PQ …..(2) (PQ) ….(3) From (1) and (2), By the rule of Moden ponens, we have Q …….(4) From (1) and (4), We have ( PQ) …….(5) But, (3) and (5) cannot be simultaneously true (Contradiction).  Our assumption is false. Hence, P follows from the premises PQ, (P  Q)
  • 74. Ex: Show that the following set of premises are inconsistent. P Q, P R, Q  R, P  Proof: Consider the premises, P  Q ------(1) P  R -----(2) Q R -----(3) P ----(4) From (1) and (3), By the rule of transitivity, we have P R …….(5) From(2)and (4), By the rule of Modus ponens, R follows From(4)and (5), By the rule of Modus ponens, R follows But, R and R cannot be simultaneously true (Contradiction). Hence, the given premises are inconsistent.
  • 75. Ex: Show that the following set of premises are inconsistent. R  M, R  S, M, S  Proof: Consider the premises, R  M ------(1) R  S ----(2) M -----(3) S ----------(4) From (1) and (3), By the rule of Disjunctive Syllogism,we have R ……….(5) From(2)and (4), By the rule of Disjunctive Syllogism, We have R ………..(6) But, R and R cannot be simultaneously true (Contradiction). Hence, the given premises are inconsistent.
  • 76. Ex: Verify that the following argument is valid by using the rules of inference (Here, H1 , H2 , …. are premises and C is conclusion) : H1 : If Joe is a Mathematician, then he is ambitious. H2 : If Joe is an early riser, then he does not like oat meal. H3 : If Joe is ambitious, then he is an early riser C : Hence, if Joe is a Mathematician, then he does not like oat meal.  Solution: Let us make the following representations p : Joe is a Mathematician. q : Joe is ambitious r : Joe is an early riser s : Joe likes oat meal The symbolic form of the given argument is
  • 77. Contd., H1 : pq ….(1) H2 : rs ….(2) H3 : qr …..(3) From (1) and (3), By the rule of transitivity, we have pr ……(4) From (4) and (2), By the rule of transitivity, we have p  s ……(5) i.e., if Joe is a Mathematician, then he does not like oat meal.  The conclusion logically follows from the premises. Hence, the argument is valid
  • 78. Ex: Verify that the following argument is valid by using the rules of inference (Here, H1 , H2 , …. are premises and C is conclusion) : H1 : If Cliffton does not live in France, then he does not speak French. H2 : Cliffton does not drive a Datsun. H3 : If Cliffton lives in France, then he rides a Bicycle. H4 : Either Cliffton speaks French,or he drives a Datsun. C : Hence, Cliffton drives a bicycle.  Solution: Let us make the following representations p : Cliffton lives in France. q : Cliffton speaks French. r : Cliffton drives a Datsun. s : Cliffton drives a Bicycle. The symbolic form of the given argument is
  • 79. Contd.,  H1 : p q …..(1) H2 : r …..(2) H3 : p  s …..(3) H4 : q  r …….(4) From (2) and (4), By the rule of Disjunctive Syllogism,we have q ……..(5) (1)  q  p …….(6) From (5) and (6), By the rule of Modus ponens, we have P ……(7) From (3) and (7), By the rule of Modus ponens, s follows  The conclusion logically follows from the premises. Hence, the argument is valid
  • 80. Ex:Using Symbolic logic, 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.  Solution: Let us make the following representations p : Jack misses many classes through illness q : Jack fails high school r : Jack is uneducated s : Jack reads a lot of books Now, the given premises can be represented as
  • 81. Contd., p  q …..(1) q  r …..(2) s  r …..(3) p  s …..(4) From (1) and (2), By transitivity, p r …..(5) From(3), By Contra positive equivalence, r  s ….. (6) From (5) and (6), By transitivity, we have p s …..(7) From(4), we have p …..(8) From (7) and (8), By the rule of modus ponens, s follows From (4), s follows But, s and s cannot be simultaneously true (Contradiction). Hence, the given premises are inconsistent
  • 82. Ex:Using Symbolic logic,prove the following argument If A works hard, then either B or C will enjoy themselves. If B enjoys himself, then A will not work hard. If D enjoys himself, then C will not enjoy himself. Therefore, If A works hard, then D will not enjoy himself .  Solution: Let us use the following representations. A : A works hard. B : B will enjoy himself. C : C will enjoy himself. D : D will enjoy himself. Now, we have to show that, A  D follows from A (B  C) , B  A and D  C
  • 83. Contd., A (B  C) ….(1) B  A ….(2) D  C ….(3) A …. (4) ( Additional premise) From, (1) and (4), By modus ponens, We have (B  C) ……(5) (2)  A  B …. (6) From, (4) and (6), By modus ponens, B ….(7) follows. From (5) and (7), By the rule of Disjunctive Syllogism, we have C ….(8) (3)  C D …. (9) From (8) and (9), By modus ponens, D follows Hence, By CP rule, A  D follows