discrete tics unit-i
TRANSCRIPT
Celestine Bernard
LOGIC
Statement:
Any meaningful sentence.
Any sentence with subject, predicate
and verb
Ex:
1) Canada is a country
2)1+101=110
3) X=2 is a solution of =4.
Compound proposition:
A proposition consists of two or more
simple propositions.
Ex:
Consider any two propositions.
1) Roses are red in color.
2) Shirt is blue in color
Then the compound proposition is
Roses are red and shirts are blue in
color.
Connectors:
1. Disjunction:
Symbol: [V]
Operator name: And
Consider two propositions P and Q.
The symbolic representation will be
P V Q
Example:
P: It is raining today
Q: There are ten tables in this room.
P V Q: it is raining today or there are
Ten tables are in this room.
Truth table:
P
Q P V Q
T T T
T F T
F T T
F F F
2) Conjunction:
Symbol: [ʌ]
Operator name: OR
Explanation:
Consider any two propositions P and Q
Then the Symbolic representation will be
P Λ Q
Example:
P: It is raining today.
Q: there are ten tables in this room.
P Λ Q: It is raining today and there are ten
tables in this room.
Q Λ P: there are ten tables in this room
And it is raining today.
Truth table:
P
Q P Λ Q
T T T
T F F
F T F
F F F
3. Negation:
Symbol: ~
Operator name: negation
Explanation:
Consider a proposition P
The symbolic representation will be
~ P
Example:
P: London is a city
~P: London is not a city.
Truth table:
P ~P
T F
F T
Conditional Propositions:
Symbol: P Q (If P then Q)
Truth table:
P
Q P → Q
T T T
T F F
F T T
F F T
Ex:
P: 3=8 …………………………….F
Q: 3+5=8 ….………………………T
P Q T
If 3=8 then 3+5=8.
Biconditional propositions:
Symbol: P ↔ Q (P if and only if Q)
Truth table:
P
Q P ↔ Q
T T T
T F F
F T F
F F T
NOTE:
P → Q is direct proposition.
Q → P is transverse of P → Q.
~P → ~Q is inverse function.
~Q → ~P is contra positive.
Q → P ≡ ~P → ~Q
(Transverse ≡ Inverse)
P → Q ≡ ~Q → ~P
(Direct Proposition ≡ Contra positive)
P ↔ Q ≡ (P → Q) ʌ (Q → P)
(Biconditional ≡Direct Prop., Λ transverse)
Examples:
1) Construct truth table:
Q Λ (P Q) P
P Q PQ QΛ(PQ) QΛ(PQ)P
T T T T T
T F F F T
F T T T F
F F F F T
2) (P Q) Λ (Q P)
Truth table:
P Q PQ (QP) (PQ)Λ(QP)
T T T T T
T F T F F
F T F T F
F F T T T
3) ~( P Λ Q) ↔ (~P V ~Q)
P Q ~P ~Q (~PV~Q) PΛQ ~(PΛQ) ~(PΛQ)↔(~PV~Q)
T T F F F T F T
T F F T T F T T
F T T F T F T T
F F T T T F T T
Logical Equivalence:
Suppose that compound propositions
P and Q are made up of the propositions
P1, P2,P3,…………………………………….… Pn
Then P ≡ Q provided that given any truth
values of
P1, P2, P3 ,……………………………………….P n
either P and Q are both true or P and Q
both false.
Properties of Equivalence:
Idempotent law:
Disjunction Conjunction
P V P ≡ P P Λ P ≡ P
Associative law:
Disjunction
(P V Q) V R ≡ P V (Q V R) Conjunction
(P Λ Q) Λ R ≡ P Λ (Q Λ R)
Commutative law:
Disjunction
(P V Q) ≡ (Q V P) Conjunction (P Λ Q) ≡ (Q Λ P)
Distributive law:
Disjunction
P V (Q Λ R) ≡ (P V Q) Λ (P V R) Conjunction P Λ (Q V R) ≡ (P Λ Q) V (P Λ R)
Identity law:
Disjunction Conjunction
T V P ≡ T T Λ P ≡ P F V P ≡ P F Λ P ≡ F
Component law:
Disjunction Conjunction
P V ~P ≡ T P Λ ~P ≡ F ~T ≡ F ~F ≡ T
Absorption law:
Disjunction
P V( P V Q) P Conjunction P Λ( P Λ Q) P
DE Morgan’s law:
Disjunction
~(P V Q) ≡ ~P Λ ~Q Conjunction ~(P Λ Q) ≡ ~P V ~Q
Innovation law:
~(~P) ≡ P
Tautologies and Contradictions:
Tautology:
A statement is called a tautology (or) a
universally valid formula (or) logically
truth when the last column of the
statement is true.
Cheat sheet value: Last column will be
true
Ex: Find the tautology and contradiction.
1) P (PVQ)
Sol:
P Q PVQ P(PVQ)
T T T T
T F T T
F T T T
F F F T
Ans: It’s a Tautology
Contradiction:
A statement is called a contradiction if
the last column of the statement.
Cheat sheet value: Last column will be
false
Ex:
1) Find the tautology and contradiction.
(~Q Λ P) Λ Q
Sol:
P Q ~Q (~QΛP) (~QΛP)ΛQ
T T F T F
T F T T F
F T F T F
F F T F F
Ans: It’s a contradiction
Tautology (or) Contradiction:
Cheat sheet value: Last column will have
Both (True and False) values
Ex:
1) Find the tautology and contradiction
P Q PΛQ (PΛQ)↔P
T T T T
T F F F
F T F T
F F F T
Ans:
It’s neither tautology nor contradiction.
Exercise:
1) Construct truth table for the
following. And find whether it is
tautology or contradiction.
(P~P)~P
(~PQ)(QP)
[P(QR)][(PQ)(PR)]
[PΛ(PQ)](PΛQ)
[(P↔Q)]↔*(PΛQ)V(~PΛ~Q)+
Substitution instance:
A formula X is called a substitution
instance of another formula Y, If X can be
obtain from Y by substituting formula’s for
some variables of Y.
Ex:
P V Q ≡ ~(~P) V ~(~Q)
Important substitution formulae:
P ↔ Q ≡ (P→Q) V (Q P)
P Q ≡ ~P V Q
Cheat sheet value:
Any substitution instance of a
tautology is tautology
Replacement process:
It is just like substitution instance.
You can replace a formula by another
formula if it equals.
Ex:
P Λ Q (P V Q) Λ Q
Example sum:
Show that
P(QR) (P(~Q VR)) ((PΛQ) R)
Sol:
There are three parts. Consider any two
statements and prove.
P (QR) P (~Q V R)
~P V (~QVR)
Using PQ ~P V Q
(~P V~Q) V R
Using associative property
(P V Q) V R ≡ P V (Q V R)
~ (P Λ Q) V R
Using DE Morgan’s law
~P V ~Q ~ (P Λ Q)
(P Λ Q) R
Using ~P V Q P Q
2. Show that
{(PVQ) Λ~ [PΛ (~QV~R)]} V
{(~PΛ~Q) V (~PΛ~R)}
is a tautology
Sol:
This statement has two parts. So take
the first part and reduce it. Same way do it
for the second one. Finally combine those
two equations and make that as true.
(PVQ)Λ [~PΛ (~Q V~R)]
(PVQ) Λ ~ (~P Λ ~ (Q Λ R))
Using DE Morgan’s law
(PVQ) Λ ~~ (PV (QΛR))
Using DE Morgan’s law
(PVQ)Λ (PV (QVR))
Using ~~PP
(PVQ)Λ * (PVQ) Λ (PVR) +
Using distributive law
*(PVQ) Λ (PVQ)+ Λ (PVR)
Using associative law
(PVQ)Λ (PVR) ……………………….(1)
Now,
Take the second part and reduce it.
*(~PΛ~Q) V (~PΛ~R)+
~ (PVQ) V ~ (PVR)
Using DE Morgan’s law
~ *(PVQ) Λ (PVR)+…………………. (2)
Combine equations 1 & 2
[(PVQ) Λ (PVR)]V ~ *(PVQ) Λ (PVR)+
We know that
P V ~P ≡ T
PV~P
T
So it is a tautology.
For more formulae………….
Refer CHEAT SHEET
Attached with this short notes
Duality law:
Two formulae A and A* are said to be
duals of each other if either one can be
obtained from other one by replacing
V by Λ and Λ by V.
The connectives V and Λ are known as
duals of each other.
Cheat sheet value:
Replace...
V by Λ
Λ by V
T by F
F by T
Example:
Write the duals for the following.
1) (PVQ) Λ R (PΛQ) V R
2) (PΛQ) V T (PVQ) Λ F
Sol:
1) (PΛQ)V R (PVQ) Λ R
2) (PVQ)Λ F (PΛQ) V T
Cheat sheet value:
Proving methods:
Consider a question like this
Prove that A B CQ
Method I
By using property of equivalence
Ex: Associative law, DE Morgan’s law…
Method II
By using tautology
(i.e) make AB and CD as true.
Ex: AB T
CD T
Here you can write ABCD
Example for Method 2:
Prove that
P (QP) [~P (PQ)]
Sol:
Method II
P (QP) ~P V (~QVP)
(~PVP) V ~Q
T V~Q
T ………………………..(1)
[~P(PQ)]~P(~PVQ)
PV(~PVQ)
(P V~P) VQ
T VQ
T …………………………(2)
From 1 & 2, P (QP) [~P (PQ)]
Example for method I:
Prove that
P(QVR) (P Q) V(PR)
Sol:
R.H.S (PQ)V(PR)
(~PVQ) V (~PVR)
(~PV~P) V(QVR)
~P V (QVR)
P(QVR)
L.H.S
Tautological implications:
A statement M is said to be
tautologically implied to a statement N if
and only if MN is a tautology.
Tautological implications:
P Λ Q P
P Λ Q Q
P P V Q
~P P Q
Q P Q
~ (P Q) P
~ (P Q) ~Q
P Λ ( P Q) Q
~ Q Λ ( P Q) ~P
~P Λ ( P V Q) Q
( P Q) Λ (Q R) PR
( P V Q) Λ (P R) Λ (Q R) R
Cheat sheet value:
PΛQ P
Antecedent consequent
Proof:
1) PΛQ P
Sol:
P Q P V Q P V QP
T T T T
T F F T
F T F T
F F F T
It is a tautology.
Therefore PΛQP
Same way we can prove all statements.
Normal forms:
DNF :( Disjunctive Normal Form)
Cheat sheet value:
DNF is not unique
It should have only Λ and V symbols
It shouldn’t have any other symbols
Ex: and ↔
Syntax:
(… A ...) V (...B...)
Example:
Find DNF of the following
(I) PΛ(PQ)
(II) P[(PQ)Λ~(~QV~P)+
Sol:
(i) PΛ(PQ)
PΛ (~PVQ)
(PV~P) V (PVQ)……………….. (DNF)
(ii) P[(PQ)Λ(~QΛ~P)+
Sol:
~PV [(PQ) Λ (~QΛ~P)+
~PV *(~PVQ) Λ~~ (QVP)+
~PV *(~PVQ) Λ (PVQ)+
~PV *(~PVQ) Λ (PΛQ)+
~PV ,*~PΛ (PΛQ)+ V *QΛ (PΛQ)+-
Using distributive law
~PV *(~PΛPΛQ) V (QΛPΛQ)+
~PV *(TΛQ) V (PΛQ)+
~PV *F V (QΛP)+
~PV (QΛP) …………………… (DNF)
Conjunctive normal form (CNF):
Cheat sheet value:
(… A …) Λ (… B …)
It should have only Λ and V symbols
It shouldn’t have any other symbols
Ex: and ↔
Example:
Find the CNF for the following
a) PΛ(PQ)
b) *PΛ~(PVR)+V , *(PΛQ)V~R+ Λ P-
Sol:
a) PΛ(PQ)
PΛ (~P V Q)………………………. (CNF)
b) *PΛ~(PVR)+V { *(PΛQ)V~R+ Λ P-
*PΛ~ (PVR)+V ,*(PΛQ) V~R+ Λ P-
*PΛ (~PΛ~R)+V ,*(PΛQ) ΛP] V
[~RΛP+- …using distributive law
*(PΛ~P) Λ~R+V ,*(PΛP) ΛQ+ V
*~RΛP+-
*FΛ~R+ V *(PΛQ) V (~RΛP)+
F V *(PΛQ) V (~RΛP)+
(PΛQ) V (~RΛP) ……………….. (CNF)
Principle disjunctive normal form (PDNF):
Let P and Q be two statement
variables. Let us construct all possible
formulas which consist of P, ~P, Q, ~Q.
The possible forms are
PΛQ, ~PΛQ, PΛ~Q, ~PΛ~Q
These formulas are called minterms or
Boolean conjunctions.
For a given formula, an equivalent
formula consisting of disjunctions of
minterms only is known as its PDNF.
Such a normal form is also called the
Sum of products canonical form.
Cheat sheet value(PDNF):
Syntax:
(…V…) Λ (…V…) Λ(…V…)
Obtain PDNF for the following.
1) ~P V Q
2) (PΛQ) V (~PΛR) V (QΛR)
Sol:
1) ~P V Q
Introduce a variable T
(~PVT) V (QVT)
Introduce the missing variable using
component law.
[~PV (~QVQ)] V [QV (PV~P)]
(~PΛQ) V (~PΛ~Q) V (QΛP)V(QΛ~P)
Using distributive law
(~PΛQ) V (~PV ~Q) V (QΛP)
If a minterm repeats just negate 1
PDNF
2) (PΛQ) V (~PΛR) V (QΛR)
Introduce the new variable T
*(PΛQ)ΛT+V*(~PΛR)ΛT+ V*(QΛR) ΛT+
*(PΛQ) Λ(RV~R)+V*(~PΛR)Λ(QV~Q)+
V *(QΛR)(PV~P)+
(PΛQΛR) V (PΛQΛ~R) V(~PΛRΛ~Q)
V (~PΛRΛ~Q) V(QΛRΛP)V (QΛRΛ~P)
Using distributive law.
If a minterm repeats just negate 1.
(PΛQΛR) V (PΛQΛ~R) V
(~PΛQΛR) V (~PΛ~QΛR)
PDNF
Principle conjunctive normal form (PCNF):
Let us consider two variables P & Q
Let us write all possible maxterms.
The maxterms are,
P V Q
~P V ~Q
~P V Q
P V ~Q
For a given formula, an equivalent formula
consisting of conjunctions of maxterms
only is known as its PCNF. This form is also
called as the product of sums of canonical
form.
Cheat sheet value:
Syntax:
(…Λ…) V (…Λ…) V(…Λ…)
Example:
Obtain PCNF for the following.
P↔Q
Sol:
Step 1: construct the truth table
P Q Minterms P↔Q
T T P Λ Q T T F P Λ~Q F F T ~PΛQ F F F ~PΛ~Q T
*T=P & F=~P ⌂ *T=Q & F=~Q
Step 2:
Write down the minterms which has true
value and make that as A
A (PΛQ) V (~PΛ~Q)
Step 3:
Find ~A
~A (~PΛ ~Q) V (P ΛQ)
*P=~P *Q=~Q
Step 4:
Find ~ (~A)
~(~A)~{ (~PΛ ~Q) V (P ΛQ)-….PCNF of A
For more theory refer discrete maths I-2
Celestine Bernard
Discrete mathematics
Cheat Sheet
Disjunction:
Truth table:
P
Q P V Q
T T T
T F T
F T T
F F F
Conjunction:
Truth table:
P
Q P Λ Q
T T T
T F F
F T F
F F F
Negation:
Truth table:
P ~P
T F
F T
Conditional propositions:
Truth table:
P
Q P → Q
T T T
T F F
F T T
F F T
Biconditional propositions:
Truth table:
P
Q P ↔ Q
T T T
T F F
F T F
F F T
NOTE:
P → Q is direct proposition.
Q → P is transverse of P → Q.
~P → ~Q is inverse function.
~Q → ~P is contra positive.
Q → P ≡ ~P → ~Q
(Transverse ≡ Inverse)
P → Q ≡ ~Q → ~P
(Direct Proposition ≡ Contra positive)
P ↔ Q ≡ (P → Q) ʌ (Q → P)
(Biconditional ≡Direct Prop., Λ transverse)
Properties of Equivalence:
Idempotent law:
Disjunction Conjunction
P V P ≡ P P Λ P ≡ P
Associative law:
Disjunction
(P V Q) V R ≡ P V (Q V R) Conjunction (P Λ Q) Λ R ≡ P Λ (Q Λ R)
Commutative law:
Disjunction
(P V Q) ≡ (Q V P) Conjunction (P Λ Q) ≡ (Q Λ P)
Distributive law:
Disjunction
P V (Q Λ R) ≡ (P V Q) Λ (P V R) Conjunction P Λ (Q V R) ≡ (P Λ Q) V (P Λ R)
Identity law:
Disjunction Conjunction
T V P ≡ T T Λ P ≡ P F V P ≡ P F Λ P ≡ F
Component law:
Disjunction Conjunction
P V ~P ≡ T P Λ ~P ≡ F ~T ≡ F ~F ≡ T
Absorption law:
Disjunction
P V( P V Q) P Conjunction P Λ( P Λ Q) P
DE Morgan’s law:
Disjunction
~(P V Q) ≡ ~P Λ ~Q Conjunction ~(P Λ Q) ≡ ~P V ~Q
Innovation law:
~(~P) ≡ P
Substitution instance:
P ↔ Q ≡ (P→Q) V (Q P)
P Q ≡ ~P V Q
Tautological implications:
P Λ Q P
P Λ Q Q
P P V Q
~P P Q
Q P Q
~ (P Q) P
~ (P Q) ~Q
P Λ ( P Q) Q
~ Q Λ ( P Q) ~P
~P Λ ( P V Q) Q
( P Q) Λ (Q R) PR
( P V Q) Λ (P R) Λ (Q R) R
Implication, Equivalence formula’s for
Inference theory:
Implication formulae:
P P V Q ……………………………….(I -1)
Q P V Q ……………………………….(I-2)
P Λ Q P ………………………………..(I-3)
P Λ Q Q ……………………………….(I-4)
P , PQ Q …………………………..(I-5)
~Q , PQ ~P ……………………….(I-6)
~P, P V Q Q ………………………….(I-7)
P Q, Q R PR ………………(I-8)
P , Q P Λ Q ……………………………(I-9)
Q PQ ……………………………….(I-10)
P V Q , PR , QR R ………….(I-11)
~P PQ ……………………………….(I-12)
~(P Q) P …………………………..(I-13)
~(P Q) ~P ………………………..(I-14)
Equivalence formulae:
~ ~ P P …………………………………(E-1)
P Q ~P V Q ……………………….(E-2)
P Q ~Q ~P ……………………(E-3)
P ↔ Q (P Q) Λ (QP) …….(E-4)
P (Q R) (P Λ Q) R …….(E-5)
~(P Λ Q) (~P V ~Q) ………………..(E-6)
(P ↔ Q ) (P Λ Q) V (~P V ~Q)…(E-7)
Quantifiers:
There are two types of quantifiers.
Universal quantifier
Symbol: (Ɏ) Meaning: All
Existential quantifier
Symbol :( ƭ) Meaning: some
Equivalent formulae :( Quantifiers)
(Ɏx) *P(x)+ ~(Ɏx) *~P(x)+
(Ɏx) *~P(x)+ ~(ƭx) P(x)
~(Ɏx) *P(x)+ (ƭx)*~P(x)+
~(Ɏx) *~P(x)+ (ƭx) *~P(x)+
(ƭx) *A(x) V B(x)+ *(ƭx)A(x) V (ƭx)B(x)+
(Ɏx)*A(x) Λ B(x)+ *(Ɏx)A(x)V(Ɏx)B(x)+
(Ɏx)*A Λ B(x)+ A V (Ɏx)B(x)
(ƭx)*A Λ B(x)+ A Λ (ƭx) B(x)
(Ɏx) A(x) B (ƭx) (A-1(x)B)
(ƭx) A(x) B (Ɏx)*A(x)B]
A(Ɏx)B(x) (Ɏx)*AB(x)]
A(ƭx)B(x) (ƭx)* AB(x)]
Implication formulae:
(Ɏx)A(x) V(Ɏx)B(x) (Ɏx)*A(x) VB(x)+
(ƭx) *A(x) Λ B(x)+ (ƭx) A(x) Λ (ƭx) B(x)
P(y) (ƭx)P(x)
(Ɏx)P(x) (ƭx) P(x)
(Ɏx)*P(x)Q(x)] (Ɏx)P(x)(Ɏx)Q(x)
Theory of inference:
Rules:
1. Universal specification(UF):
(Ɏx) A(x) A(y)
2. Universal generation(UG):
A(y) (Ɏx)A(x)
3. Existential specification(ES):
(ƭx)A(x) A(y)
4. Existential generation(EG):
A(y) (ƭx)A(x)