Module 5-Boolean Algebra
Module 5-Boolean Algebra
Module-1
Mathematical Logic
☻Syllabus:
Fundamentals of Logic: Basic Connectives and Truth Tables, Logic Equivalence – The Laws
of Logic, Logical Implication – Rules of Inference. The Use of Quantifiers, Quantifiers,
Definitions and the Proofs of Theorems.
☻Basic Connectives and Truth table:
Proposition:
A proposition is a declarative sentence that is either true or false, but not both.
Example:
1. 2 is a prime number. (true)
2. All sides are equal in scalene triangle. (false)
3. 2+3=4. (false)
4. What is the time now?
5. Read this carefully.
From the above examples we note that 1, 2, 3 are proposition, whereas 4 and 5 are not the
propositions.
Logical Connectives and Truth table:
New propositions are obtained by starting with given propositions with the aid of words or
phrases like ‘not’, ‘and’, ‘if … then, and ‘if and only if’. Such words or phrases are called
Logical connectives.
1. Negation:
A proposition is obtained by inserting the word ‘not’ at an appropriate place in the given
proposition is called the negation of the given proposition.
The negation of a Proposition p is denoted by ¬ p (read ‘not p’). For any Proposition p, if p
is true, then ¬ p is false, and if p is false, then ¬ p is true. i.e., If the truth value of a proposition
p is 1 then the truth value of ¬ p is 0 and If the truth value of a proposition p is 0 then the truth
value of ¬ p is 1.
Example:
p: 4 is an even number.
¬ p: 4 is not an even number.
p ¬p
0 1
1 0
2. Conjunction:
A compound proposition obtained by combining two given propositions by inserting the
word ‘and’ in between them is called the conjunction of the given proposition.
The conjunction of two propositions p and q is denoted by p ˄ q (read ‘p and q’). The
conjunction p ˄ q is true only when p is true and q is true, in all other cases it is false. i.e., the
truth value of the conjunction p ˄ q is 1 only when the truth value of p is 1 and truth value of
q is 1, in all other cases the truth value of p ˄ q is 0.
Example:
p: √2 is an irrational number.
q: 9 is a prime number.
p q p˄q
0 0 0
0 1 0
1 0 0
1 1 1
3. Disjunction:
A compound proposition obtained by combining two given propositions by inserting the word
‘or’ in between them is called the disjunction of the given propositions.
The disjunction of two propositions p and q is denoted by p ˅ q (read ‘p or q’). The disjunction
p ˅ q is false only when p is false and q is false, in all other cases it is true. i.e., the truth value
of the disjunction p ˅ q is 0 only when the truth value of p is 0 and truth value of q is 0, in all
other cases the truth value of p ˅ q is 1.
Example:
p q p˅q
0 0 0
0 1 1
1 0 1
1 1 1
4. Exclusive Disjunction:
We require that the compound proposition “p or q” to be true only when either p is true or q
is true but not both. The exclusive or is denoted by the ⊻.
The compound proposition p ⊻ q (read as either p or q but not both) is called as exclusive
disjunction of the propositions p and q. i.e., p ⊻ q = (p ˄ ¬ q) ⅴ (q ˄ ¬ p)
Example:
p:9 is a prime number
q: all triangles are isosceles.
p ⊻ q: Either 9 is prime number or all triangles are isosceles, but not both
Truth table for Exclusive Disjunction
p q p⊻q
0 0 0
0 1 1
1 0 1
1 1 0
5. Conditional:
A compound proposition obtained by combining two given propositions by using the words
‘if’ and ‘then’ at appropriate places is called a conditional.
The Conditional “If p, then q” is denoted by p → q and the Conditional “If q, then p” is
denoted by q → p. The Conditional p → q is false only when p is true and q is false, in all
other cases it is true. i.e., the truth value of the conditional p → q is 0 only when the truth
value of p is 1 and the truth value of q is 0, in all other cases the truth value of p → q is 1.
Example:
p: 3 is a prime number.
q: 9 is a multiple of 6
Truth table for Conditional
p q p→q
0 0 1
0 1 1
1 0 0
1 1 1
6. Biconditional:
Let p and q be two sample propositions then the conjunction of the conditionals p → q and q
→ p is called the biconditional of p and q. It is denoted by p ↔ q and it is same as (p → q) ˄
(q → p) is read as “If p then q and if q then p”.
Truth table for Biconditional
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1
Problems:
1. Construct the truth tables for the following propositions.
(i). p ˄ (¬ q) (ⅱ). (¬ p) ˅ q (ⅲ). p → (¬ q) (ⅳ). (¬ p) ⊻ (¬ q)
Solution:
The desired truth tables are obtained by considering all possible combinations of the
truth values of p and q. the combined form of required truth table is given below
p q ¬p ¬q p ˄ (¬ q) (¬ p) ˅ q p → (¬ q) (¬ p) ⊻ (¬ q)
0 0 1 1 0 1 1 0
0 1 1 0 0 1 1 1
1 0 0 1 1 0 1 1
1 1 0 0 0 1 0 0
2. Let p, q and r be propositions having truth values 0, 0 and 1 respectively. Find the truth
values if the following compound propositions:
(ⅰ). (p ˅ q) ˅ r (ⅱ). (p ˄ q) ˄ r (ⅲ). (p ˄ q) → r
(ⅳ). p → (q ˄ r) (ⅴ). p ˄ (q → r) (ⅵ). p → (q →¬ r)
Solution:
(ⅰ) Since both p and q are false then (p ˅ q) is also false. Since r true it follows that (p ˅ q) ˅ r
is true. Thus, the truth value of (p ˅ q) ˅ r is 1.
(ⅱ) Since both p and q are false, (p ˄ q) is false. Since (p ˄ q) is false and r is true (p ˄ q) ˄ r is
false. Thus, the truth value of (p ˄ q) ˄ r is 0.
(ⅲ) Since (p ˄ q) is false and r is true, (p ˄ q) → r is true. Thus, the truth value of (p ˄ q) → r
is 1.
(ⅳ) Since q is false and r is true, (q ˄ r) is false. Also, p is false, therefore p → (q ˄ r) is true.
Thus, the truth value of p → (q ˄ r) is 1.
(ⅴ) Since r is true and q is false (q → r) is true. Also, p is false. Therefore, p ˄ (q → r) is false.
Thus, the truth value of p ˄ (q → r) is 0
(ⅵ) Since r is true, ¬ r is false. Since q is false, q → (¬ r) is true. Also, p is false. Therefore,
p → (q →¬ r) is true. Thus, the truth value of p → (q→¬ r) is 1.
0 0 0 1 1 1 0 0 0
0 0 1 1 0 1 0 0 0
0 1 0 0 1 0 1 0 1
0 1 1 0 0 1 0 0 0
1 0 0 1 1 1 0 1 1
1 0 1 1 0 1 0 1 1
1 1 0 0 1 0 1 0 1
1 1 1 0 0 1 0 1 1
From the last two rows we note that p ˄ ((¬ q) ˅ r) and p ˅ (q ˄ (¬ r)) do not have the same
values in all possible situations. Therefore, they are not logically equivalent.
The Laws of Logic:
For any primitive statements p, q, r any tautology To and any contradiction Fo
Problems:
0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 0 1 1 1 1
From columns 5 and 8 of the above table, we find that {p ˅ (q ˄ r)} and {(p ˅ q) ˄ (p ˅ r)}
has same truth values in all possible situations. Therefore, p ˅ (q ˄ r)⇔(p ˅ q) ˄ (p ˅ r).
Similarly, we can prove p ˄ (q ˅ r)⇔(p ˄ q) ˅ (p ˄ r).
0 0 1 1 0 1 1
0 1 1 0 1 0 0
1 0 0 1 1 0 0
1 1 0 0 1 0 0
From columns 5 and 8 of the above table, we find that ¬ (p ˅ q) and ¬ p ˅ ¬ q has same truth
values in all possible situations. Therefore, ¬ (p ˅ q) ⇔ ¬ p ˄ ¬ q.
Similarly, we can prove ¬ (p ˄ q) ⇔ ¬ p ˅ ¬ q