0% found this document useful (0 votes)
9 views

Module 5-Boolean Algebra

Uploaded by

ahassimon005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Module 5-Boolean Algebra

Uploaded by

ahassimon005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Regulation-2018 (CBCS Scheme) Discrete mathematical structure-18CS36

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.

Prepared by: Venkatesh.P Sri Sairam college of engineering Page | 1


Regulation-2018 (CBCS Scheme) Discrete mathematical structure-18CS36

Truth table for Negation

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: √2 is an irrational number and 9 is a prime number.


Truth table for conjunction

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:

Prepared by: Venkatesh.P Sri Sairam college of engineering Page | 2


Regulation-2018 (CBCS Scheme) Discrete mathematical structure-18CS36

p: All triangles are equilateral.


q: 2+5=7.
p ˅ q: All triangles are equilateral or 2+5=7.
Truth table for Disjunction

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.

Prepared by: Venkatesh.P Sri Sairam college of engineering Page | 3


Regulation-2018 (CBCS Scheme) Discrete mathematical structure-18CS36

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

p q p→q q→p p↔q

0 0 1 1 1

0 1 1 0 0

1 0 0 1 0

1 1 1 1 1

Prepared by: Venkatesh.P Sri Sairam college of engineering Page | 4


Regulation-2018 (CBCS Scheme) Discrete mathematical structure-18CS36

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.

Prepared by: Venkatesh.P Sri Sairam college of engineering Page | 5


Regulation-2018 (CBCS Scheme) Discrete mathematical structure-18CS36

p q r ¬q ¬r ¬q˅r q˄¬r p ˄ ((¬ q) ˅ r) p ˅ (q ˄ (¬ r))

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

Sl. No Name of laws Laws of logic


1 Laws of double negation ¬ ¬ p⇔p
¬ (p ˅ q)⇔(¬ p ˄ ¬ q)
2 De Morgan’s laws
¬ (p ˄ q)⇔(¬ p ˅ ¬ q)
(p ˅ q)⇔(q ˅ p)
3 Commutative laws
(p ˄ q)⇔(q ˄ p)
p ˅ (q ˅ r) ⇔ (p ˅ q) ˅ r
4 Associative laws
p ˄ (q ˄ r) ⇔ (p ˄ q) ˄ r
p ˅ (q ˄ r)⇔(p ˅ q) ˄ (p ˅ r)
5 Distributive laws
p ˄ (q ˅ r)⇔(p ˄ q) ˅ (p ˄ r)
p ˅ p⇔p
6 Idempotent laws
p ˄ p⇔p
p ˅ Fo⇔p
7 Identity laws
p ˄ To⇔p
p ˅ ¬ p⇔To
8 Inverse laws
p ˄ ¬ p⇔Fo
p ˅ To⇔To
9 Domination laws
p ˄ Fo⇔Fo
p ˅ (p ˄ q)⇔p
10 Absorption laws
p ˄ (p ˅ q)⇔p

Prepared by: Venkatesh.P Sri Sairam college of engineering Page | 15


Regulation-2018 (CBCS Scheme) Discrete mathematical structure-18CS36

Problems:

1. Prove distributive law p ˅ (q ˄ r)⇔(p ˅ q) ˄ (p ˅ r)


Solution:
p q r q˄r p ˅ (q ˄ r) p˅q p˅r (p ˅ q) ˄ (p ˅ r)

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).

2. Prove De Morgan’s law ¬ (p ˅ q) ⇔ ¬ p ˄ ¬ q


Solution:
p q ¬p ¬q p˅q ¬ (p ˅ q) ¬p˄¬q

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

Prepared by: Venkatesh.P Sri Sairam college of engineering Page | 16

You might also like