1
Mathematical Logic
PROPOSITIONAL LOGIC
A declarative sentence that is either true or false, but not both, is called a proposition or statement.
The set {0,1} is called truth-value set for the proposition. Sometimes it is denoted by the abbreviations
T and F respectively.
Logical Connectives
Negation (NOT): The negation of a proposition p, denoted by p (or ~ p or ¬ p) is the proposition
not p i.e. ~ p = 1 – p.
Table 1: Logical connectives
Terminology
Logical Connectives
Explanation
NOT
∼
AND
∧
OR
∨
If and then
⇒
If and only if
⇔
NOR
↓
The statement ∼) is true if and
only if ) is false.
The statement ) ∧ * is true if )
and * are both true; else it is false.
The statement ) ∨ * is true if ) or
* (or both) are true; if both are
false, the statement is false.
) ⇒ * means if ) is true then * is
also true; if ) is false then nothing
is said about *.
) ⇔ *means) is true if * is true
and ) is false if * is false.
A ↓ B =~( A ∨ B )
NAND
↑
A ↑ B =~( A ^ B )
XOR
⊕
The statement ) ⊕ * is true when
either ) or *, but not both,
are true.
Note 1: Statements without connectives like ‘but’, ‘or’, ‘and’ etc. are called atomic
or primary statements.
1
2
GATE Mathematics
Table 2: Truth table
p
∼p
1
0
0
1
Conjunction (AND): Let p and q be propositions. The compound proposition “p and q”, denoted
by p ∧ q, is the proposition that is true when both p and q are true and is false otherwise. The
proposition p ∧ q is called the conjunction of p and q, i.e.
p∧q = min(p, q) or p∧q = (p. q).
Table 3: Truth table
p
q
p∧q
1
1
0
0
1
0
1
0
1
0
0
0
Disjunction (OR ): Let p and q be propositions. The compound proposition “p or q”, denoted by
p ∨ q, is the proposition that is false when both p and q are false and is true otherwise. The
proposition p ∨ q is called the disjunction of p or q, i.e.
p∨q = max (p, q) or p ∨ q = p + q.
Table 4: Truth table
F
G
F∨G
1
1
0
0
1
0
1
0
1
1
1
0
Exclusive (XOR ): Let p and q be propositions. The compound proposition exclusive (xor) of p
and q, denoted by p ⊕ q, is the proposition that is true when exactly one of p and q is true and is false
otherwise. i.e. p ⊕ q = p ~ q + ~ p q.
Table 5: Truth table for the exclusive (xor) of two propositions
p
1
1
0
0
p⊕q
0
1
1
0
q
1
0
1
0
Implication: Let p and q be any two propositions. The implication or conditional statement,
denoted by ‘p ⇒ q’ or ‘p → q’ is the proposition that is false when p is true and q is false and true
otherwise, i.e.
p ⇒ q = min(1, 1 + q – p) or p ⇒ q =
p ∨ q.
Mathematical Logic
3
Table 6: Truth table
p
q
1
1
0
0
1
0
1
0
p⇒q
1
0
1
1
Tautology: A compound proposition P = P (P1, P2, P3,…Pn) where P1, P2, P3,…Pn are variables
(elemental propositions), is called a tautology, if it is true for every truth assignment for P1, P2,…Pn.
P is called contradiction, if it is false for every truth assignment for P, P2,...Pn .
Order of Connectives
1. Negation ∼
2. Conjunction ∧
3. Disjunction ∨
4. Conditional →
5. Biconditional ↔
Biconditional: Let p and q be any two propositions. The biconditional p ⇔ q is the proposition that
is true when p and q have the same truth-values and is false otherwise.
The converse of p ⇒ q is the conditional q ⇒ p and the biconditional p ⇔ q is the conjunction of the
conditionals p ⇒ q and q ⇒ p. The biconditional can be formed with the words ‘if and only if ’ i.e.,
the symbols p ⇔ q is read ‘p if and only if q’, i.e.
p ⇔ q = 1 – p – q = (p ⇒ q) ∧ (q ⇒ p)
Table 7: Truth table
F
G
F⇔ G
1
1
0
0
1
0
1
0
1
0
0
1
Contrapositive: Let p and q be two propositions. If p ⇒ q then ~q ⇒ ~p is called its contrapositive,
q ⇒ p is called its converse and ~ p ⇒ ~ q its inverse.
Table 8: Truth table for contrapositive, converse and inverse
p
q
1
1
0
0
1
0
1
0
p⇒q
1
0
1
1
∼p
0
0
1
1
∼q
0
1
0
1
∼q ⇒ ∼p
1
0
1
1
q⇒p
1
1
0
1
∼p ⇒ ∼q
1
1
0
1
4
GATE Mathematics
Tautology: A compound proposition that is always true, no matter what the truth-values of the
propositions that occur in it, is called a tautology.
Contradiction: A compound proposition that is always false under all possible truth-values for its
simple proposition is called a contradiction.
Contingency: A proposition that is neither a tautology nor a contradiction is called a contingency.
Note (1) The connective ‘NAND’ is denoted by the symbol ↑ and for any two formulae P and Q
P ↑ Q ⇔ (P ∧ Q)
(2) The connective ‘NOR’ is denoted by the symbol ↑. For any two formulae
P↓Q⇔
(P ∨ Q).
Replacement Process
Let us consider formulae A : p → (q → r). The formulae q → r is a part of the formula A. If we
replace q → r by an equivalent formula q ∨ r in A. We get another formula B: p → ( q ∨ r). It
can be easily verified A ≡ B. The process of obtaining B from A is called Replacement process.
e.g., 1 p → (Q → R) ⇔ p → ( Q ∨ R) ⇔ (P ∧ Q) → R.
We know that
Q→R⇔
Q ∨ R.
∴ P → (Q → R) is equivalent P → ( Q ∨ R)
Again in same rule,
P ∨ ( Q ∨ R) ⇔ (
⇔
P∨
Q) ∨ R
(p ∧ Q) ∨ R
⇔ (P ∧ Q) → R.
Example 1: The truth table for the propositions forms p ∧ ∼ p and p ∨ ∼ p is presented on table.
Table 9: Truth table
p
1
0
∼p
0
1
p∧∼p
0
0
p∨∼p
1
1
Here, p ∧ ~ p with value 0 is a contradiction while p ∨ ~ p with truth-value 1 is a tautology.
In some cases, two different compound propositions have the same truth-values irrespective of the
truth-values of their constituent propositions. Such propositions are said to be logically equivalent.
Equivalent Proposition: Suppose that compound propositions P and Q are made up of the
propositions p1, p2,..., pn. We say that P and Q are logically equivalent and write P ≡ Q, provided that
given any truth values of p1, p2,..., pn, either P and Q are both true or both false.
The propositions p and q are logically equivalent if P ⇔ Q is a tautology. The notation p ⇔ q
denotes that p and q are logically equivalent. P ⇔ Q if and only if the truth tables of P and Q are
same.
Mathematical Logic
5
Example 2: We will verify that ~ (p ∨ q) and ~p ∧ ~q are logically equivalent. This equivalence is
one of the De Morgan’s laws of propositions.
The truth-values for the propositions are displayed in the following table:
Table 10: Truth table for example 2
p
q
1
1
0
0
1
0
1
0
∼p
0
0
1
1
∼q
0
1
0
1
p∨q
1
1
1
0
∼ (p ∨ q )
0
0
0
1
∼p ∧ ∼q
0
0
0
1
Table 11: Laws of Algebra of Propositions
Sl. no.
1.
2.
3.
4.
5.
6.
7.
8.
9.
Name of law
Idempotent law
Identity
Dominant law
Complement
Commutative
Associative
Distributive
Absorption
Demorgan
Primal form
P∨P≡P
P∨F≡P
P ∨T ≡T
P ∨ P ≡T
p∨q≡q∨p
p∨ (q ∨ r) ≡ (p ∨ q) ∨r
p∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∧ r)
p∨ (p ∧ q) ≡ p
( p ∨ q) = p ∧ q
Dual form
P∧P≡P
P∧Γ≡P
P∧F≡F
P∨ P≡F
p∧q≡q∨p
p∧ (q ∧ r) ≡ (p ∧ q) ∧r
p∧ (q ∨ r) = (p ∧ q) ∨ (p ∧ r)
p∧ (p ∨ q) ≡ p
( p ∧ q) = p ∨ q
Equivalence Involving Conditionals
1.
2.
3.
4.
5.
6.
7.
8.
9.
p→q≡¬p∨q
p→q≡¬q→¬p
p∨q≡¬p→q
(p ∧ q) ≡ ¬ ( p → ¬ q)
¬ (p → q) ≡ p ∧ ¬ q
(p → q) ∧ (p → r) ≡ p → (q ∧ r)
(p → r) ∧ (q → r) ≡ (p ∨ q) → r
(p → q) ∨ (p → r) ≡ p → (q ∨ r)
(p → q) ∧ (q → r) ≡ (p ∨ q) → r
Equivalence Involving Biconditionals
1.
2.
3
4.
p ↔ q ≡ (p → q) ∧ (q → p)
p ↔ q ≡ ¬ q ↔¬ p
p ↔ q ≡ (p ∧ q) ∨ (¬ p ∧ ¬ q)
¬ (p ↔ q) ≡ p ↔ ¬ q
Results: The distributive law of disjunction over conjunction are logical equivalence, i.e.,
p ∨ ( q ∧ r ) and ( p ∨ q ) ∧ (p ∨ r) are logically equivalent.
6
GATE Mathematics
Table 12: Some well-known logical equivalence
Laws
Equivalences
Identity
Domination
Complement
Idempotent
Double Negation
Commutative
Absorption
Associative
Distributive
De Morgan's
Other Connectives
Tautology Implications
1.
p∧q⇒p
2.
p∧q⇒q
3.
p⇒p∧q
p ⇒ ( p →q)
4.
5.
q ⇒ ( p → q)
6.
( p→q) ⇒ p
7.
( p→q) ⇒ q
8.
p∧ (p→ q) ⇒ q
p ∧ (p∨q) ⇒ q
9.
10.
q ∨ (p→q) ⇒ q
11.
( p→q) ∧ (q→r) ⇒ ( p→r)
12. ( p∨q) ∧ ( p→r) ∧ (q→r) ⇒r
Normal Forms
To determine whether a given compound proposition A(P1, P2,…, Pn ) is a tautology or a contradictor
and whether A (P1, P2, P3,…, Pn), B (P1, P2, P3,..., Pn ) are equivalent or not, we can reduce A and B
to some normal forms instead of using truth table:
There are two normal forms:
(i) Conjunctive normal forms
(ii) Disjunctive normal forms
Mathematical Logic
7
A product of the variables and their negations (a conjunction of primary statement and their negations)
is called elementary product e.g., p, q, p ∧ q, q ∧ q, p ∧ q and p ∧ q are some elementary
products in 2 variables.
Similarly a sum of the variables and their negations is called an elementary sum. For example, p, q,
q p, p ∨ q, p ∨ q, p ∨ q, p ∨ q are elementary sum in 2 variables.
Example 3: Establish the equivalence P ⇔ Q ≡ ~ (P ∨ Q) ∨ (P ∧ Q).
Solution: RHS ≡ ∼(P ∨ Q) ∨ (P ∧ Q)
≡ (∼P ∧ ∼ Q) ∨ (P ∧ Q)
≡ [(∼P ∧ ∼ Q) ∨ P] ∧ [(∼P ∧ ∼Q) ∨ Q]
≡ [(∼P ∨ P) ∧ (∼ Q ∨ P)] ∧ [(∼P ∨ Q) ∧ (∼Q ∨ Q)]
≡ (∼Q ∨ P) ∧ (∼ P ∨ Q)
≡ (Q ⇒ P) ∧ (P ⇒ Q)
≡ P ⇔ Q.
Example 4: Show that p ∧ q ⇒ p ∨ q is a tautology.
Solution: p ∧ q ⇒ p ∨ q ⇔ ∼ (p ∧ q) ∨ (p ∨ q)
⇔ (∼ p ∨ ∼ q) ∨ (p ∨ q) by De Morgan’s Law
⇔ (∼ p ∨ p) ∨ (∼ q ∨ q) by Associative law
⇔ 1∨ 1
⇔1
Procedures to Obtain DNF or CNF of a Given Formulae
Step1: If the connective → and ↔ are present, they are replaced by ∧ ∨,
(i) p → q ≡ p ∧ q
(ii) p ↔ q ≡ (p ∧ q) ∨ ( p ∧ q) ≡ (p ∨ q) ∧ ( q ∨ p)
by using
Step 2: If the negation is present before the given formulae or a part of the given formulae (not a
variable); De Morgan’s laws are applied so that the negation is brought before the variables only.
Step 3: If necessary distributive law and idempotent law are applied.
Step 4: If there is an elementary product which is equivalent to truth value F in DNF, it is omitted.
Similarly if there is an elementary sum which is equivalent to truth value. T in CNF, it is omitted.
Principal Disjunctive and Principal Conjunctive Normal Forms
Minterm: Given a no. of variables, the products conjuctions in which each variable or its negation,
but not both, occurs only once are called minterms. For two variables p & q, p ∧ q, p ∧ q, p ∧ q,
p ∧ q are possible minterms.
Maxterm: Given a no. of variables, the sum (disjunctions) in each variable or its negation, but not
both occurs only once are called Maxterm. For two variables p, q, p ∨ q, p ∨ q, p ∨ q, p ∨ q
are possible maxterm.
Note: For n variables, 2n minterm or maxterm are possible.
S.O.P. (sum of products) or PDNF (principal disjunctive normal form)
8
GATE Mathematics
Example 5 a: DNF of q → (q → P) is given by
º ¬ q ∨ (q→P) ≡ ¬ q∨ (¬ q∨ P) ≡ (¬ q∨ ¬ q) ∨P
= (¬ q∨ P)
Example 5 b: CNF of ¬ (P ∨ q) ↔ P ∧ q is given by
(¬ (p ∨ q) ∧ (P ∧ q)) ∨ (¬ ( (P ∨ q)) ∨ (P ∧ q))
((¬ P ∧ ¬ q) ∧ (P ∧ q)) ∨ ((P ∨ q) ∧ (¬ P ∨ ¬ q))
((¬ P ∧ P) ∧ (q ∧ ¬ q)) ∨ ((P ∨ q) ∧ (¬ p ∨ ¬ q))
F ∧ F ∨ (P ∨ q) ∧ (¬ P ∨ q)
(P ∨ q) ∧ (¬ p ∨ ¬ q)
The Use of Quantifiers
Statement
∃x p ( x )
∀x p ( x )
∃x ¬p ( x )
∀x ¬p ( x )
When is it True?
For some (at least one) a
in the universe, p(a) is
true
For every replacement a
from the universe, p(a)
is true.
When is it False?
For every a in the
universe, p(a) is false
There is at least one
replacement a from the
universe for which p(a)
is false.
For at least one choice a For every replacement a
in the universe, p(a) is in the universe, p(a) is
false, so its negation ture.
¬ p(a) is true.
For every replacement a There is at least one
from the universe, p(a) replacement a from the
is false and its negation universe for which ¬
¬ p(a) is ture.
p(a) is false and p(a) is
true.
Logical Equivalences variable and logical implications for quantified statements in one variable.
For a prescribed universe and any open statements p(x), q(x) in the variable x:
∃x [ p ( x) ∧ q ( x)] ⇒ [∃x p( x) ∧ ∃x q ( x)]
∃x [ p( x) ∨ q( x)] ⇔ [∃x p( x) ∨ ∃x q( x)]
∀x [ p( x) ∧ q( x)] ⇔ [∀x p( x) ∧ ∀x q ( x)]
∀x [ p ( x) ∨ ∀x q ( x)] ⇔ ∀x[ p ( x) ∨ x q ( x )]
Rules for Negating Statement with One Quantifier
¬ [∀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 ¬ ¬p( x) ⇔ ∀x p( x)
Mathematical Logic
Converse, Inverse and Contrapositive proposition
If p → q is a conditional statement, then
(i) q → p is calles its converse
(ii) ~ p → ~ q is called its inverse,
(iii) ~ q → ~ q is called its contrapositive.
Example 6: Use the laws of logic to simplify the expression : p ∨ ¬ ( ¬p → q ).
Implication law (with ¬ q in
Solution: p ∨ ¬ (¬p → q ) ≡ p ∨ ¬(¬¬ p ∨ q )
place of p)
≡ p ∨ ¬( p ∨ q)
Double negation law
≡ ( p ∨ ( ¬p ∧ ¬ q )
Second de Morgan’s law
≡ ( p ∨ ¬p ) ∧ ( p ∨ ¬ q )
Second distributive law
(with ¬ p and ¬ q ) in place of q
and r respectively)
≡ T ∧ ( p ∨ ¬ q)
Second inverse law
≡ ( p ∨ ¬ q)
first commutative law (with T and
( ( p ∨ ¬ q ) in place of p and q
respectively)
≡ p ∨¬q
First identity law (with
( p ∨ ¬ q) in place of p)
Example 7: Use the laws of logic to show that [( p → q) ∧ ¬q] → ¬p is a tautology.
Solution: [( p → q ) ∧ ¬q ] → ¬p ≡ ¬ [( ¬ p ∨ q ) ∧ ¬ q ] ∨ ¬ p
Implication law
(twice)
≡ ¬ [( ¬ q ∧ ( ¬ p ∨ q)] ∨ ¬ p
First
commutative law
≡ ¬ [( ¬ q ∧ ¬ p) ∨ ( ¬ q ∧ q)] ∨ ¬ p First distributive
law
≡ ¬ [( ¬ q ∧ ¬ p) ∨ (q ∧ ¬ q)] ∧ ¬ p First
commutative law
≡ ¬ [( ¬ q ∧ ¬ p) ∨ F ] ∨ ¬ p
First inverse law
≡ ¬ ( ¬ q ∧ ¬ p) ∨ ¬ p
Second identity
law
≡ ( ¬ ¬ q ∨ ¬ ¬ p ) ∨ ¬p
First de Morgan’s
law
≡ (q ∨ p) ∨ ¬p
Double negation
law (twice)
≡ q ∨ ( p ∨ ¬p )
Second
associative law
≡ q ∨T
Second inverse
law
Second
≡T
annihilation law
Therefore [( p → q) ∧ ¬ q ] → ¬ p is a tautology.
9
10
GATE Mathematics
EXERCISES
1. If P, Q, R are subsets of the universal set U, then (P∩ Q∩R) ∪(PC∩ Q∩R) ∪ QC∪RC is
(GATE - 08)
(A) Q ∪R
C
(C) P ∪Q R
C
(B) P∪Q ∪R
C
C
C
C
C
(D) U
2. Let Graph (x) be a predicate which denotes that (x) is a graph. Let connected (x) be a predicate
which denotes that (x) is connected. Which of the following first order logic sentences DOES
NOT represent the statement: “Not every graph is connected ”?
(GATE - 07)
(A) ¬∀ x(Graph( x) ⇒ Connected ( x))
(B) ∃ x(Graph( x) ∧ ¬Connected ( x))
(C) ¬∀ x(¬Graph( x) ∨ Connected ( x))
(D) ∀ x(Graph( x) ⇒ ¬Connected ( x))
3. Which of the following tuple relational calculus expression(s) is/are equivalent to ∀t ∈ r ( P (t ))?
(GATE - 09)
I.
¬∃t ∈ r ( P (t ))
II.
III.
¬∃t ∈ r (¬P (t ))
IV. ∃t ∉ r (¬P (t ))
(A) I only
(B) II only
∃t ∉ r ( P (t ))
(C) III only
(D) III and IV only
4. If P, Q, R are Boolean variables, then
(P + Q) (P.Q + P.R) (P.R + Q) simplifies to
(A) P.Q
(B) P.R
(GATE - 08)
(C) P.Q + R
(D) P.R + Q
5. P and Q are two propositions. Which of the following logical expressions are equivalent?
(GATE - 08)
I.
P∨ ~ Q
II.
~ (~ P ∨ Q)
III. (P ∧ Q) ∨ (P ∧ ~ Q) ∨ (~ P ∧ ~ Q)
(A) Only I and II
IV. (P ∧ Q) ∨ (P ∧ ~ Q) ∨ (~ P ∧ Q)
(B) Only I, II and III
(C) Only I, II and IV
(D) All of I, II, III and IV
6. Which one of the following is the most appropriate logical formula to represent the statement?
“Gold and Silver ornaments are precious.”
(GATE - 09)
The following notations are used:
G (x): x is a gold ornament
S (x): x is a silver ornament
P (x): x is precious
(A) ∀x ( P( x ) → (G( x ) ∧ S( x)))
(B) ∀x ( (G( x) ∧ S( x)) → P( x))
(C) ∃x ( (G( x) ∧ S( x )) → P( x))
(D) ∀x ( (G( x) ∨ S( x) ) → P (x))
Mathematical Logic
11
7. The binary operation W is defined as follows:
P
T
T
F
F
(GATE - 09)
PW Q
T
T
F
T
Q
T
F
T
F
Which one of the following is equivalent to P ∨ Q?
(A) ¬Q W ¬P
(B) P W ¬Q
(C) ¬P W Q
(D) ¬P W ¬Q
8. Consider the following well-formed formulae:
I. ¬∀x ( P( x))
II. ¬∃x ( P( x))
(GATE - 09)
III. ¬∃x ( ¬P( x))
IV. ¬∃x ( P( x))
(C) II and III
(D) II and IV
Which of the above are equivalent?
(A) I and III
(B) I and IV
9. Which one of the first order predicate calculus statements given below correctly expresses the
following English statement?
(GATE - 06)
Tigers and lions attack if they are hungry or threatened.
(A) ∀x [ (tiger( x) ∧ lion( x)) → {(hungry( x) ∨ threatened( x)) → attacks( x)}]
(B) ∀x [ (tiger( x) ∨ lion( x)) → {(hungry( x) ∨ threatened( x)) ∧ attacks( x)}]
(C) ∀x [ (tiger( x) ∨ lion( x)) → {attacks( x) → (hungry( x) ∨ threatened( x))}]
(D) ∀x [ (tiger( x) ∨ lion( x)) → {(hungry( x) ∨ threatened( x)) → attacks( x)}]
10. Consider the following propositional statements:
P1 : ( (A ∧ B) → C) ≡ ( (A → C) ∧ (B → C))
P 2 : ( (A ∨ B) → C) ≡ ((A → C) ∨ (B → C) )
Which one of the following is true?
(A) P1 is a tautology, but not P2
(B) P2 is a tautology, but not P1
(C) P1 and P2 are both tautologies
(D) Both P1 and P2 are not tautologies
11. Which of the following is/are tautology ?
(GATE - 92)
(A) a ∨ b → b ∧ c
(B) a ∧ b → b ∨ c
(C) a ∨ b → (b → c )
(D) a → b → b (b → c)
12. The proposition p ∧ (~ p ∨ q) is:
(GATE - 93)
(A) A tautology
(B) Logically equivalent to p ∧ q
(C) Logically equivalent to p ∨ q
(D) A contradiction
(E) None of the above
© Copyright 2025 Paperzz