Mathematical Logic This Document Is About The Subject Work of Engineering This Material Helps
Mathematical Logic This Document Is About The Subject Work of Engineering This Material Helps
Unit – I
Mathematical Logic
INTRODUCTION
Proposition: A proposition or statement is a declarative sentence which is either
true or false but not both. The truth or falsity of a proposition is called its truth-value.
These two values ‗true‘ and ‗false‘ are denoted by the symbols T and F
respectively. Sometimes these are also denoted by the symbols 1 and 0 respectively.
Example 1: Consider the following sentences:
Connectives
The words or phrases or symbols which are used to make a proposition by two or more
propositions are called logical connectives or simply connectives. There are five basic
connectives called negation, conjunction, disjunction, conditional and biconditional.
Negation
The negation of a statement is generally formed by writing the word ‗not‘ at a
proper place in the statement (proposition) or by prefixing the statement with the phrase
‗It is not the case that‘. If p denotes a statement then the negation of p is written as p and
read as ‗not p‘. If the truth value of p is T then the truth value of p is F. Also if the truth
value of p is F then the truth value of p is T.
Table 1. Truth table for negation
p ¬p
T F
F T
Example 2: Consider the statement p: Kolkata is a city. Then ¬p: Kolkata is not a city.
Although the two statements ‗Kolkata is not a city‘ and ‗It is not the case that Kolkata is a
city‘ are not identical, we have translated both of them by p. The reason is that both these
statements have the same meaning.
Conjunction
The conjunction of two statements (or propositions) 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 the truth
value T. Otherwise it has truth value F.
p q p∧ q
T T T
T F F
F T F
F F F
‗Jack and Jill went up the hill‘ into symbolic form using conjunction.
Solution: Let p : Jack went up the hill, q : Jill went up the hill.
Then the given statement can be written in symbolic form as p ∧ q.
Disjunction
The disjunction of two statements 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 the truth value F. Otherwise
it has truth value T.
p q p∨ q
T T T
T F T
F T T
F F F
5
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Conditional proposition
If p and q are any two statements (or propositions) then the statement p → q which is read as,
‗If p, then q‘ is called a conditional statement (or proposition) or implication and the connective
is the conditional connective.
p q p→q
T T T
T F F
F T T
F F T
To understand better, this connective can be looked as a conditional promise. If the promise
is violated (broken), the conditional (implication) is false. Otherwise it is true. For this reason, the
only circumstances under which the conditional p → q is false is when p is true and q is false.
‘The crop will be destroyed if there is a flood’ into symbolic form using conditional
connective.
(i) You will get a speeding ticket if you drive over 70 km per hour.
(ii) Driving over 70 km per hour is sufficient for getting a speeding ticket.
(iii) If you do not drive over 70 km per hour then you will not get a speeding ticket.
(iv) Whenever you get a speeding ticket, you drive over 70 km per hour.
6
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
7
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
consequent in a conditional statement are not required to refer to the same subject matter. For
example, the statement ‗If I get sufficient money then I shall purchase a high-speed computer‘
sounds reasonable. On the other hand, a statement such as ‗If I purchase a computer then this pen is
red‘ does not make sense in our conventional language. But according to the definition of
conditional, this proposition is perfectly acceptable and has a truth-value which depends on the
truth-values of the component statements.
2. Some of the alternative terminologies used to express p → q (if p, then q) are the
following: (i) p implies q
(ii) p only if q (‗If p, then q‘ formulation emphasizes the antecedent, whereas ‗p only if q‘
formulation emphasizes the consequent. The difference is only stylistic.)
(iii) q if p, or q when p.
(v) p is sufficient for q, or a sufficient condition for q is p. (vi) q is necessary for p, or a necessary
condition for p is q. (vii) q is consequence of p.
Converse, Inverse and Contrapositive
If P → Q is a conditional statement, then
(1). Q → P is called its converse
P Q ¬Q ¬P ¬Q → ¬P
T T F F T
T F T F F
F T F T T
F F T T T
8
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
P : It rains.
Q: The crop will grow.
The implication P → Q states that
R: If it rains then the crop will grow.
The converse of the implication P → Q, namely Q → P sates that S: If
the crop will grow then there has been rain.
The inverse of the implication P → Q, namely ¬P → ¬Q sates that
T T T T T
T F F T F
F T T F F
F F T T T
Biconditional proposition
If p and q are any two statements (propositions), then the statement p↔ q which is read as ‗p if
and only if q‘ and abbreviated as ‗p iff q‘ is called a biconditional statement and the connective is
the biconditional connective.
It may be noted that p q is true only when both p and q are true or when both p and q are
false. Observe that p q is true when both the conditionals p → q and q → p are true, i.e., the truth-
values of (p → q) ∧ (q → p), given in Ex. 9, are identical to the truth-values of p q defined here.
Tautology: A statement formula which is true regardless of the truth values of the
statements which replace the variables in it is called a universally valid formula or a logical
truth or a tautology.
Contradiction: A statement formula which is false regardless of the truth values of the
statements which replace the variables in it is said to be a contradiction.
9
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
10
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Substitution Instance
A formula A is called a substitution instance of another formula B if A can be obtained form
B by substituting formulas for some variables of B, with the condition that the same formula
is substituted for the same variable each time it occurs.
Example: Let B : P → (J ∧ P ).
(i): (R ↔ S) → (J ∧ (R ↔ S))
Equivalence of Formulas
Two formulas A and B are said to equivalent to each other if and only if A↔ B is a
tautology.
If A↔B is a tautology, we write A ⇔ B which is read as A is equivalent to B.
Note : 1. ⇔ is only symbol, but not connective.
2. A ↔ B is a tautology if and only if truth tables of A and B are the same.
3. Equivalence relation is symmetric and transitive.
Method I. Truth Table Method: One method to determine whether any two statement
formulas are equivalent is to construct their truth tables.
Example: Prove P ∨ Q ⇔ ¬(¬P ∧ ¬Q).
Solution:
P Q P∨Q ¬P ¬Q ¬P ∧ ¬Q ¬(¬P ∧ ¬Q) (P ∨ Q) ⇔ ¬(¬P ∧ ¬Q)
T T T F F F T T
T F T F T F T T
F T T T F F T T
F F F T T T F T
Solution:
P Q P→Q ¬P ¬P ∨ Q (P → Q) (¬P ∨ Q)
T T T F T T
T F F F F T
F T T T T T
F F T T T T
Equivalence Formulas:
1. Idempotent laws:
(a) P ∨ P ⇔ P (b) P ∧ P ⇔ P
2. Associative laws:
(a) (P ∨ Q) ∨ R ⇔ P ∨ (Q ∨ R) (b) (P ∧ Q) ∧ R ⇔ P ∧ (Q ∧ R)
3. Commutative laws:
(a) P ∨ Q ⇔ Q ∨ P (b) P ∧ Q ⇔ Q ∧ P
4. Distributive laws:
P ∨ (Q ∧ R) ⇔ (P ∨ Q) ∧ (P ∨ R) P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
5. Identity laws:
(a) (i) P ∨ F ⇔ P (ii) P ∨ T ⇔ T
(b) (i) P ∧ T ⇔ P (ii) P ∧ F ⇔ F
6. Component laws:
(a) P ∨ (P ∧ Q) ⇔ P (b) P ∧ (P ∨ Q) ⇔ P
8. Demorgan‘s laws:
Method II. Replacement Process: Consider a formula A : P → (Q → R). The formula 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). One can easily verify that the formulas A and B are equivalent to each
other. This process of obtaining B from A as the replacement process.
⇔ ¬P ∨ (¬Q ∨ R) [∵ P → Q ⇔ ¬P ∨ Q]
⇔ (P ∧ Q) → R[∵ P → Q ⇔ ¬P ∨ Q].
12
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ (¬P ∧ ¬R) ∨ Q ⇔
¬(P ∨ R) ∨ Q ⇔ P ∨
R→Q
13
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬P ∨ (¬Q ∨ P )
⇔ (¬P ∨ P ) ∨ ¬Q
⇔ T ∨ ¬Q
⇔T
and
¬P → (P → Q) ⇔ ¬(¬P ) ∨ (P → Q)
⇔ P ∨ (¬P ∨ Q) ⇔
(P ∨ ¬P ) ∨ Q ⇔ T
∨Q
⇔T
So, P → (Q → P ) ⇔ ¬P → (P → Q).
⇔T∧ R [∵ ¬P ∨ P ⇔ T ]
⇔R
**Example: Show ((P ∨ Q) ∧ ¬(¬P ∧ (¬Q ∨ ¬R))) ∨ (¬P ∧ ¬Q) ∨ (¬P ∧ ¬R) is tautology.
Solution: By De Morgan‘s laws, we have
¬P ∧ ¬Q ⇔ ¬(P ∨ Q)
¬P ∨ ¬R ⇔ ¬(P ∧ R)
Therefore
14
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬((P ∨ Q) ∧ (P ∨ R))
⇔ P ∨ (Q ∧ R)
⇔ (P ∨ Q) ∧ (P ∨ R)
⇔ (P ∨ Q) ∧ (P ∨ R)
15
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔T
⇔T
¬P ∧ ¬Q: Jan will not take a job in industry and he will not go to graduate school.
(b). Let P : James will bicycle.
Q: James will run tomorrow.
The given statement can be written in the symbolic as P ∨ Q.
The negation of P ∨ Q is given by ¬(P ∨ Q).
¬(P ∨ Q) ⇔ ¬P ∧ ¬Q.
¬P ∧ ¬Q: James will not bicycle and he will not run tomorrow.
(c). Let P : The processor is fast.
Q: The printer is slow.
The given statement can be written in the symbolic as P → Q.
17
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬(¬p ∨ q) ∨ r ⇔
(p ∧ ¬q) ∨ r
and
⇔ (p ∧ r) ∨ (¬q ∧ r)
p → (q → r) ⇔ p → (¬q ∨ r)
⇔ ¬p ∨ (¬q ∨ r) ⇔
¬p ∨ ¬q ∨ r.
Consider the statement: ‖If you study hard, then you will excel‖. Write its converse,
contra positive and logical negation in logic.
Duality Law
Two formulas A and A∗ are said to be duals of each other if either one can be obtained from the
other by replacing ∧ by ∨ and ∨ by ∧. The connectives ∨ and ∧ are called duals of each other. If the
18
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
formula A contains the special variable T or F , then A∗, its dual is obtained by replacing T by F and
F by T in addition to the above mentioned interchanges.
Example: Write the dual of the following formulas:
19
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Result 1: The negation of the formula is equivalent to its dual in which every variable
is replaced by its negation.
We can prove
Example: Prove that (a). ¬(P ∧ Q) → (¬P ∨ (¬P ∨ Q)) ⇔ (¬P ∨ Q) (b).
(P ∨ Q) ∧ (¬P ∧ (¬P ∧ Q)) ⇔ (¬P ∧ Q)
⇔ (P ∧ Q) ∨ (¬P ∨ Q)
⇔ (P ∧ Q) ∨ ¬P ∨ Q
⇔ ((P∧ Q) ∨ ¬P )) ∨ Q
⇔ ((P ∨ ¬P ) ∧ (Q ∨ ¬P )) ∨ Q
⇔ (T ∧ (Q ∨ ¬P )) ∨ Q
⇔ (Q ∨ ¬P ) ∨ Q
⇔ Q ∨ ¬P
⇔ ¬P ∨ Q
Tautological Implications
A statement formula A is said to tautologically imply a statement B if and only if A → B
is a tautology.
In this case we write A ⇒ B, which is read as ‘A implies B‘.
Note: ⇒ is not a connective, A ⇒ B is not a statement formula.
A ⇒ B states that A → B is tautology.
20
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Clearly A ⇒ B guarantees that B has a truth value T whenever A has the truth value T .
One can determine whether A ⇒ B by constructing the truth tables of A and B in the same manner as
was done in the determination of A ⇔ B. Example: Prove that (P → Q) ⇒ (¬Q → ¬P ).
21
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Solution:
P Q ¬P ¬Q P→Q ¬Q → ¬P (P → Q) → (¬Q → ¬P )
T T F F T T T
T F F T F F T
F T T F T T T
F F T T T T T
Since all the entries in the last column are true, (P → Q) → (¬Q → ¬P ) is a
tautology.
Hence (P → Q) ⇒ (¬Q → ¬P ).
tional leads to the truth value T for the consequent. This procedure guarantees that the
conditional becomes tautology, thereby proving the implication.
Solution: Assume that the antecedent ¬Q ∧ (P → Q) has the truth value T , then both ¬Q and P →
Q have the truth value T , which means that Q has the truth value F , P → Q has the truth value T .
Hence P must have the truth value F .
Therefore the consequent ¬P must have the truth value T.
¬Q ∧ (P → Q) ⇒ ¬P .
Another method to show A ⇒ B is to assume that the consequent B has the truth value F and then
show that this assumption leads to A having the truth value F . Then A → B must have the truth
value T .
Example: Show that ¬(P → Q) ⇒ P .
Solution: Assume that P has the truth value F . When P has F , P → Q has T , then ¬(P → Q) has F
¬(P → Q) ⇒ P
Other Connectives
We introduce the connectives NAND, NOR which have useful applications in the design of
computers.
NAND: The word NAND is a combination of ‘NOT‘ and ‘AND‘ where ‘NOT‘ stands for negation
and ‘AND‘ for the conjunction. It is denoted by the symbol ↑.
If P and Q are two formulas then
P ↑ Q ⇔ ¬(P ∧ Q)
The connective ↑ has the following equivalence:
P ↑ P ⇔ ¬(P ∧ P ) ⇔ ¬P ∨ ¬P ⇔ ¬P .
22
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬(Q ∧ P ) ⇔
(Q ↑ P )
∴ NAND is commutative.
NAND is not Associative: Let P , Q and R be any three statement formulas.
Consider ↑ (Q ↑ R) ⇔ ¬(P ∧ (Q ↑ R)) ⇔ ¬(P ∧ (¬(Q ∧ R)))
⇔ ¬P ∨ (Q ∧ R))
(P ↑ Q) ↑ R ⇔ ¬(P ∧ Q) ↑ R
⇔ ¬(¬(P ∧ Q) ∧ R) ⇔
(P ∧ Q) ∨ ¬R
P ↓ P ⇔ ¬(P ∨ P ) ⇔ ¬P ∧ ¬P ⇔ ¬P .
⇔ ¬(Q ∨ P ) ⇔
(Q ↓ P )
∴ NOR is commutative.
NOR is not Associative: Let P , Q and R be any three statement formulas. Consider
P↓ (Q ↓ R) ⇔ ¬(P ∨ (Q ↓ R))
23
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬P ∧ (Q ∨ R)
(P ↓ Q) ↓ R ⇔ ¬(P ∨ Q) ↓
R
⇔ ¬(¬(P ∨ Q) ∨ R) ⇔
(P ∨ Q) ∧ ¬R
Since
24
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
¬(P ∧ Q) ⇔ ¬P ∨ ¬Q
¬(P ∨ Q) ⇔ ¬P ∧ ¬Q.
⇔ (P ∨ Q) ↑ (P ∨ Q)
⇔ (P ∧ Q) ↓ (P ∧ Q)
Truth Tables
Example: Show that (A ⊕ B) ∨ (A ↓ B) ⇔ (A ↑ B). (May-2012)
Solution: We prove this by constructing truth table.
A B A⊕B A↓B (A ⊕ B) ∨ (A ↓ B) A↑B
T T F F F F
T F T F T T
F T T F T T
F F F T T T
As columns (A ⊕ B) ∨ (A ↓ B) and (A ↑ B) are identical.
∴ (A ⊕ B) ∨ (A ↓ B) ⇔ (A ↑ B).
Normal Forms
n
If a given statement formula A(p1, p2, ...pn) involves n atomic variables, we have 2
possible combinations of truth values of statements replacing the variables.
The formula A is a tautology if A has the truth value T for all possible assignments of the
truth values to the variables p1, p2, ...pn and A is called a contradiction if A has the truth
value F for all possible assignments of the truth values of the n variables. A is said to be satis
able if A has the truth value T for atleast one combination of truth values assigned to p1, p2,
...pn.
The problem of determining whether a given statement formula is a Tautology, or a
Contradiction is called a decision problem.
The construction of truth table involves a finite number of steps, but the construc-tion
may not be practical. We therefore reduce the given statement formula to normal form and
find whether a given statement formula is a Tautology or Contradiction or atleast satisfiable.
It will be convenient to use the word ‖product‖ in place of ‖conjunction‖ and ‖sum‖ in
25
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
26
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Any part of an elementary sum or product which is itself an elementary sum or product is
called a factor of the original elementary sum or product. Thus ¬Q,∧ ¬P , and ¬Q ∧ P are
some of the factors of ¬Q ∧ P ∧ ¬P .
A formula which is equivalent to a given formula and which consists of a sum of elementary
products is called a disjunctive normal form of the given formula.
⇔ (P ∧ ¬P ) ∨ (P ∧ Q)
R↔ S ⇔ (R ∧ S) ∨ (¬R ∧ ¬S)
The method for obtaining conjunctive normal form of a given formula is similar to the one
27
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
given for disjunctive normal form. Again, the conjunctive normal form is not unique.
28
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ (Q ∨ (P ∨ ¬P )) ∧ (Q ∨ ¬Q)
⇔ (Q ∨ P ∨ ¬P ) ∧ (Q ∨ ¬Q)
Since each of the elementary sum is a tautology, hence the given formula is tautology.
Minterm: For a given number of variables, the minterm consists of conjunctions in which each
statement variable or its negation, but not both, appears only once.
Let P and Q be the two statement variables. Then there are 2 minterms given by P ∧ Q, P ∧ ¬Q,
2
¬P ∧ Q, and ¬P ∧ ¬Q.
P Q P∧Q P ∧ ¬Q ¬P ∧ Q ¬P ∧ ¬Q
T T T F F F
T F F T F F
F T F F T F
F F F F F T
variables P and Q.
Definition: For a given formula, an equivalent formula consisting of disjunctions of minterms only
is called the Principal disjunctive normal form of the formula.
The principle disjunctive normal formula is also called the sum-of-products canonical form.
30
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
T T T P ∧Q
T F F P ∧ ¬Q
F T T ¬P ∧ Q
F F T ¬P ∧ ¬Q
T T T P∧Q∧R T F T T
T T F P ∧ Q ∧ ¬R T F F T
T F T P ∧ ¬Q ∧ R F F F F
T F F P ∧ ¬Q ∧ ¬R F F F F
F T T ¬P ∧ Q ∧ R F T T T
F T F ¬P ∧ Q ∧ ¬R F F F F
F F T ¬P ∧ ¬Q ∧ R F T F T
F F F ¬P ∧ ¬Q ∧ ¬R F F F F
In order to obtain the principal disjunctive normal form of a given formula is con-
structed as follows:
31
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Solution:
(a) ¬P ∨ Q ⇔ (¬P ∧ T ) ∨ (Q ∧ T ) [∵ A ∧ T ⇔ A]
⇔ (¬P ∧ (Q ∨ ¬Q)) ∨ (Q ∧ (P ∨ ¬P )) [∵ P ∨ ¬P ⇔ T ]
[∵ P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
⇔ (P ∧ Q ∧ T ) ∨ (¬P ∧ R ∧ T ) ∨ (Q ∧ R ∧ T )
∨ (Q ∧ R ∧ P ) ∨ (Q ∧ R ∧ ¬P )
P ∨ (P ∧ Q) ⇔ P
P ∨ (¬P ∧ Q) ⇔ P ∨ Q
Solution: We write the principal disjunctive normal form of each formula and com-pare these
normal forms.
(a) P ∨ (P ∧ Q) ⇔ (P ∧ T ) ∨ (P ∧ Q) [∵ P ∧ Q ⇔ P ]
⇔ (P ∧ (Q ∨ ¬Q)) ∨ (P ∧ Q) [∵ P ∨ ¬P ⇔ T ]
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) [∵ P ∨ P ⇔ P ]
which is the required PDNF.
32
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Now, ⇔ P ∧T
⇔ P ∧ (Q ∨ ¬Q)
⇔ (P ∧ Q) ∨ (P ∧ ¬Q)
which is the required PDNF.
Hence, P ∨ (P ∧ Q) ⇔ P .
33
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ (P ∧ (Q ∨ ¬Q)) ∨ (¬P ∧ Q)
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (¬P ∧ Q)
which is the required PDNF.
Now,
P ∨ Q ⇔ (P ∧ T ) ∨ (Q ∧ T )
⇔ (P ∧ (Q ∨ ¬Q)) ∨ (Q ∧ (P ∨ ¬P ))
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (Q ∧ P ) ∨ (Q ∧ ¬P )
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (¬P ∧ Q)
which is the required PDNF.
Hence, P ∨ (¬P ∧ Q) ⇔ P ∨ Q.
→ ((P → Q) ∧ ¬(¬Q ∨ ¬P )) ⇔ ¬P
∨ ((¬P ∨ Q) ∧ (Q ∧ P ))
⇔ ¬P ∨ ((¬P ∧ Q ∧ P ) ∨ (Q ∧ Q ∧ P )) ⇔
¬P ∨ F ∨ (P ∧ Q)
⇔ ¬P ∨ (P ∧ Q)
⇔ (¬P ∧ T ) ∨ (P ∧ Q)
⇔ (¬P ∧ (Q ∨ ¬Q)) ∨ (P ∧ Q)
35
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
For a given formula, an equivalent formula consisting of conjunctions of the max-terms only is
known as its principle conjunctive normal form. This normal form is also called the product-of-sums
canonical form.The method for obtaining the PCNF for a given formula is similar to the one
described previously for PDNF.
Example: Obtain the principal conjunctive normal form of the formula (¬P→R)∧(Q↔P)
Solution:
(¬P → R) ∧ (Q ↔ P )
⇔ (P ∨ R ∨ F ) ∧ [(¬Q ∨ P ∨ F ) ∧ (¬P ∨ Q ∨ F )]
⇔ (P ∨ R ∨ Q) ∧ (P ∨ R ∨ ¬Q) ∧ (P ∨ ¬Q ∨ R) ∧ (P ∨ ¬Q ∨ ¬R)
Note: If the principal disjunctive (conjunctive) normal form of a given formula A containing n
variables is known, then the principal disjunctive (conjunctive) normal form of ¬A will consist of
the disjunction (conjunction) of the remaining minterms (maxterms) which do not appear in the
principal disjunctive (conjunctive) normal form of A. From A ⇔ ¬¬A one can obtain the principal
conjunctive (disjunctive) normal form of A by repeated applications of De Morgan‘s laws to the
principal disjunctive (conjunctive) normal form of ¬A.
Solution:
⇔ P ∨ (¬P → (Q ∨ (¬Q → R)))
⇔ P ∨ (P ∨ Q ∨ (Q ∨ R)))
⇔ P ∨ (P ∨ Q ∨ R)
⇔ P ∨ Q ∨R
which is the PCNF.
Now PCNF of ¬S is the conjunction of remaining maxterms, so
36
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
∨ ( P ∧ ¬Q ∧ R) ∨ (P ∧ Q ∧ ¬R) ∨ (P ∧ Q ∧ R)
37
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Definition: If a conclusion is derived from a set of premises by using the accepted rules of
reasoning, then such a process of derivation is called a deduction or a formal proof and the argument
is called a valid argument or conclusion is called a valid conclusion.
Definition: Let A and B be two statement formulas. We say that ‖B logically follows from A‖ or
H1 ∧ H2 ∧ ... ∧ Hm ⇒ C
(1)
38
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Note: To determine whether the conclusion logically follows from the given premises, we use the
following methods:
Truth table method
Without constructing truth table method.
Let P1, P2, · · · , Pn be all the atomic variables appearing in the premises H1, H2, · · · , Hm and
in the conclusion C. If all possible combinations of truth values are assigned to P1, P2, · · · , Pn and if
the truth values of H1, H2, ..., Hm and C are entered in a table. We look for the rows in which all H1,
H2, · · · , Hm have the value T. If, for every such row, C also has the value T, then (1) holds. That is,
the conclusion follows logically.
Alternatively, we look for the rows on which C has the value F. If, in every such row, at
least one of the values of H1, H2, · · · , Hm is F, then (1) also holds. We call such a method a
‗truth table technique‘ for the determination of the validity of a conclusion.
Example: Determine whether the conclusion C follows logically from the premises
H1 and H2.
(a) H1 : P → Q H2 : P C : Q
(b) H1 : P → Q H2 : ¬P C : Q
(c) H1 : P → Q H2 : ¬(P ∧ Q) C : ¬P
(d) H1 : ¬P H2 : P Q C : ¬(P ∧ Q)
(e) H1 : P → Q H2 : Q C : P
Solution: We first construct the appropriate truth table, as shown in table.
P Q P→Q ¬P ¬(P ∧ Q) P Q
T T T F F T
T F F F T F
F T T T T F
F F T T T T
39
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
(a) We observe that the first row is the only row in which both the premises have the value T
. The conclusion also has the value T in that row. Hence it is valid.
In (b) the third and fourth rows, the conclusion Q is true only in the third row, but not in
the fourth, and hence the conclusion is not valid.
Similarly, we can show that the conclusions are valid in (c) and (d) but not in (e).
Rules of Inference
The following are two important rules of inferences.
Implication Formulas
I1 : P ∧ Q ⇒ P (simplification)
I2 : P ∧ Q ⇒ Q
I3 : P ⇒ P ∨ Q
I4 : Q ⇒ P ∨ Q
I5 : ¬P ⇒ P → Q I6
: Q ⇒ P → Q I7 :
¬(P → Q) ⇒ P
I8 : ¬(P → Q) ⇒ ¬Q
I9 : P, Q ⇒ P ∧ Q
I :
1
¬P, P ∨ Q ⇒ Q (disjunctive syllogism)
I
11 : P, P → Q ⇒ Q (modus ponens)
I
12 : ¬Q, P → Q ⇒ ¬P (modus tollens)
I
13 : P → Q, Q → R ⇒ P → R (hypothetical syllogism)
I
14 : P ∨ Q, P → R, Q → R ⇒ R (dilemma)
Example: Demonstrate that R is a valid inference from the premises P → Q, Q → R, and P .
Solution:
{1} (1) P → Q Rule P
{2} (2) P Rule P,
26
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
27
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Show that R∨S follows logically from the premises C ∨D, (C ∨D) → ¬H, ¬H → (A ∧
Solution:
Q → R, P → M, and ¬M.
Solution:
28
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
‖If you work hard, you will pass the exam. You did not pass. Therefore, you did not work
hard‖.
‖If Sachin hits a century, then he gets a free car. Sachin does not get a free car.
29
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
(P ∧ R) → S ⇔ P → (R → S)
Let P denote the conjunction of the set of premises and let R be any formula. The above
equivalence states that if R is included as an additional premise and S is derived from P ∧ R, then
R → S can be derived from the premises P alone.
Rule CP is also called the deduction theorem and is generally used if the conclu-sion of the form
R → S. In such cases, R is taken as an additional premise and S is derived from the given
premises and R.
Example: Show that R → S can be derived from the premises P → (Q → S), ¬R ∨ P , and Q.
(Nov. 2011)
30
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: By using the method of derivation, show that following statements con-stitute a valid
argument: ‖If A works hard, then either B or C will enjoy. If B enjoys, then A will not work hard.
If D enjoys, then C will not. Therefore, if A works hard, D will not enjoy.
Example: Determine the validity of the following arguments using propositional logic:
‖Smoking is healthy. If smoking is healthy, then cigarettes are prescribed by physi-
cians. Therefore, cigarettes are prescribed by physicians‖. (May-2012)
Solution: Let us indicate the statements as follows:
P : Smoking is healthy.
Q: Cigarettes are prescribed by physicians.
Consistency of Premises
A set of formulas H1, H2, · · · , Hm is said to be consistent if their conjunction has the
truth value T for some assignment of the truth values to the atomic variables appearing in H1,
H2,
· · · , Hm.
If, for every assignment of the truth values to the atomic variables, at least one of
the formulas H1, H2, · · · , Hm is false, so that their conjunction is identically false, then the
formulas H1, H2, · · · , Hm are called inconsistent.
Thus, the given set of premises leads to a contradiction and hence it is inconsistent.
32
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Show that the following set of premises is inconsistent: ‖If the contract is valid, then
John is liable for penalty. If John is liable for penalty, he will go bankrupt. If the bank will loan
him money, he will not go bankrupt. As a matter of fact, the contract is valid, and the bank will
loan him money.‖
Solution: Let us indicate the statements as follows:
V : The contract is valid.
L: John is liable for penalty.
M: Bank will loan him money.
B: John will go bankrupt.
In order to show that a conclusion C follows logically from the premises H1, H2, · · · ,
Hm, we assume that C is false and consider ¬C as an additional premise. If the new set of
premises is inconsistent, so that they imply a contradiction. Therefore, the assump-tion that ¬C is
true does not hold.
Hence, C is true whenever H1, H2, · · · , Hm are true. Thus, C follows logically from
the premises H1, H2, · · · , Hm.
33
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Solution: We introduce ¬¬(P ∧Q) as additional premise and show that this additional premise
leads to a contradiction.
Example: Show that the following set of premises are inconsistent, using proof by contradiction
P → (Q ∨ R), Q → ¬P, S → ¬R, P ⇒ P → ¬S.
Solution: We include ¬(P → ¬S) as an additional premise. Then we show that this leads to a
contradiction.
∴ ¬(P → ¬S) ⇔ ¬(¬P ∨ ¬S) ⇔ P ∧ S.
35
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Quantifiers
Quantifiers: Quantifiers are words that are refer to quantities such as ‘some‘ or ‘all‘.
Universal Quantifier: The phrase ‘forall‘ (denoted by ∀) is called the universal quantifier.
For example, consider the sentence ‖All human beings are mortal‖.
Let P (x) denote ‘x is a mortal‘.
Then, the above sentence can be written
as (∀x ∈ S)P (x) or ∀xP (x)
Existential Quantifier: The phrase ‘there exists‘ (denoted by ∃) is called the exis-tential
quantifier.
36
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
M(x) : x is an integer
N(x) : x either positive or negative
Express the following using quantifiers:
All men are mortal
Any integer is either positive or negative.
Solution: (a) The given statement can be written as
for all x, if x is a man, then x is mortal and this can be expressed as
(x)(K(x) → L(x)).
(b) The given statement can be written as
for all x, if x is an integer, then x is either positive or negative and this can be expressed
as (x)(M(x) → N(x)).
37
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
(x)P (x, y)
(x)(P (x) → Q(x))
(x)(P (x) → (∃y)R(x, y))
(x)(P (x) → R(x)) ∨ (x)(R(x) → Q(x))
(∃x)(P (x) ∧ Q(x))
(∃x)P (x) ∧ Q(x).
In (1), P (x, y) is the scope of the quantifier, and occurrence of x is bound occurrence,
while the occurrence of y is free occurrence.
In (2), the scope of the universal quantifier is P (x) → Q(x), and all concrescences of x are
bound.
In (3), the scope of (x) is P (x) → (∃y)R(x, y), while the scope of (∃y) is R(x, y). All
occurrences of both x and y are bound occurrences.
In (4), the scope of the first quantifier is P (x) → R(x) and the scope of the second is
R(x) → Q(x). All occurrences of x are bound occurrences.
In (6), the scope of (∃x) is P (x) and the last of occurrence of x in Q(x) is free.
Example: Let P (x) denote the statement ‖x is a professional athlete‖ and let Q(x) denote the
statement ‖x plays soccer‖. The domain is the set of all people.
(a). Write each of the following proposition in English.
(x)(P (x) → Q(x)
(∃x)(P (x) ∧ Q(x))
(x)(P (x) ∨ Q(x))
(b). Write the negation of each of the above propositions, both in symbols and in words.
Solution:
(a). (i). For all x, if x is an professional athlete then x plays soccer.
‖All professional athletes plays soccer‖ or ‖Every professional athlete plays
soccer‖.
(ii). There exists an x such that x is a professional athlete and x plays soccer.
38
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
There exists an x such that, x is a professional athlete and x does not paly soccer.
In words: ‖Some professional athlete do not play soccer‖.
(ii). ¬(∃x)(P (x) ∧ Q(x)) ⇔ (x)(¬P (x) ∨ ¬Q(x))
In words: ‖Every people is neither a professional athlete nor plays soccer‖ or All people
either not a professional athlete or do not play soccer‖.
(iii). ¬(x)(P (x) ∨ Q(x)) ⇔ (∃x)(¬P (x) ∧ ¬Q(x)).
In words: ‖Some people are not professional athlete or do not paly soccer‖.
Equivalence formulas:
E31 : (∃x)[A(x) ∨ B(x)] ⇔ (∃x)A(x) ∨ (∃x)B(x)
40
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Establish the validity of the following argument:‖All integers are ratio-nal numbers.
Some integers are powers of 2. Therefore, some rational numbers are powers of 2‖.
Solution: Let P (x) : x is an integer
R(x) : x is rational number
S(x) : x is a power of 2
Hence, the given statements becomes
42
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Show that (x)(P (x) → Q(x)) ∧ (x)(Q(x) → R(x)) ⇒ (x)(P (x) → R(x)).
Solution:
43
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Here in step (4), y is fixed, and it is not possible to use that variable again in step (5).
Hence, the converse is not true.
Example: Show that from (∃x)[F (x) ∧S(x)] → (y)[M(y) → W (y)] and (∃y)[M(y) ∧ ¬W (y)] the
conclusion (x)[F (x) → ¬S(x)] follows.
{1, 6} (7) ¬(∃x)[F (x) ∧ S(x)] Rule T, (5), (6) and I12
44
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
45
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
w
i
t INTRODUCTION
h
46
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
U I
n Mathematical Logic
i
t
–
Proposition: A proposition or statement is a declarative sentence which is either
true or false but not both. The truth or falsity of a proposition is called its truth-value.
These two values ‗true‘ and ‗false‘ are denoted by the symbols T and F
respectively. Sometimes these are also denoted by the symbols 1 and 0 respectively.
Example 1: Consider the following sentences:
Connectives
The words or phrases or symbols which are used to make a proposition by two or more
propositions are called logical connectives or simply connectives. There are five basic
connectives called negation, conjunction, disjunction, conditional and biconditional.
Negation
The negation of a statement is generally formed by writing the word ‗not‘ at a
proper place in the statement (proposition) or by prefixing the statement with the phrase
‗It is not the case that‘. If p denotes a statement then the negation of p is written as p and
read as ‗not p‘. If the truth value of p is T then the truth value of p is F. Also if the truth
value of p is F then the truth value of p is T.
Table 1. Truth table for negation
p ¬p
T F
F T
47
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example 2: Consider the statement p: Kolkata is a city. Then ¬p: Kolkata is not a city.
Although the two statements ‗Kolkata is not a city‘ and ‗It is not the case that Kolkata is a
city‘ are not identical, we have translated both of them by p. The reason is that both these
statements have the same meaning.
Conjunction
The conjunction of two statements (or propositions) 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 the truth
value T. Otherwise it has truth value F.
p q p∧ q
T T T
T F F
F T F
F F F
‗Jack and Jill went up the hill‘ into symbolic form using conjunction.
Solution: Let p : Jack went up the hill, q : Jill went up the hill.
Then the given statement can be written in symbolic form as p ∧ q.
Disjunction
The disjunction of two statements 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 the truth value F. Otherwise
it has truth value T.
p q p∨ q
T T T
T F T
F T T
F F F
5
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Conditional proposition
If p and q are any two statements (or propositions) then the statement p → q which is read as,
‗If p, then q‘ is called a conditional statement (or proposition) or implication and the connective
is the conditional connective.
p q p→q
T T T
T F F
F T T
F F T
To understand better, this connective can be looked as a conditional promise. If the promise
is violated (broken), the conditional (implication) is false. Otherwise it is true. For this reason, the
only circumstances under which the conditional p → q is false is when p is true and q is false.
‘The crop will be destroyed if there is a flood’ into symbolic form using conditional
connective.
(v) You will get a speeding ticket if you drive over 70 km per hour.
(vi) Driving over 70 km per hour is sufficient for getting a speeding ticket.
(vii) If you do not drive over 70 km per hour then you will not get a speeding ticket.
(viii) Whenever you get a speeding ticket, you drive over 70 km per hour.
6
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
7
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
consequent in a conditional statement are not required to refer to the same subject matter. For
example, the statement ‗If I get sufficient money then I shall purchase a high-speed computer‘
sounds reasonable. On the other hand, a statement such as ‗If I purchase a computer then this pen is
red‘ does not make sense in our conventional language. But according to the definition of
conditional, this proposition is perfectly acceptable and has a truth-value which depends on the
truth-values of the component statements.
3. Some of the alternative terminologies used to express p → q (if p, then q) are the
following: (i) p implies q
(vi) p only if q (‗If p, then q‘ formulation emphasizes the antecedent, whereas ‗p only if q‘
formulation emphasizes the consequent. The difference is only stylistic.)
(vii) q if p, or q when p.
P Q ¬Q ¬P ¬Q → ¬P
T T F F T
T F T F F
F T F T T
F F T T T
8
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
P : It rains.
Q: The crop will grow.
The implication P → Q states that
R: If it rains then the crop will grow.
The converse of the implication P → Q, namely Q → P sates that S: If
the crop will grow then there has been rain.
The inverse of the implication P → Q, namely ¬P → ¬Q sates that
T T T T T
T F F T F
F T T F F
F F T T T
Biconditional proposition
If p and q are any two statements (propositions), then the statement p↔ q which is read as ‗p if
and only if q‘ and abbreviated as ‗p iff q‘ is called a biconditional statement and the connective is
the biconditional connective.
It may be noted that p q is true only when both p and q are true or when both p and q are
false. Observe that p q is true when both the conditionals p → q and q → p are true, i.e., the truth-
values of (p → q) ∧ (q → p), given in Ex. 9, are identical to the truth-values of p q defined here.
Tautology: A statement formula which is true regardless of the truth values of the
statements which replace the variables in it is called a universally valid formula or a logical
truth or a tautology.
Contradiction: A statement formula which is false regardless of the truth values of the
statements which replace the variables in it is said to be a contradiction.
9
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
10
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Substitution Instance
A formula A is called a substitution instance of another formula B if A can be obtained form
B by substituting formulas for some variables of B, with the condition that the same formula
is substituted for the same variable each time it occurs.
Example: Let B : P → (J ∧ P ).
(i): (R ↔ S) → (J ∧ (R ↔ S))
Equivalence of Formulas
Two formulas A and B are said to equivalent to each other if and only if A↔ B is a
tautology.
If A↔B is a tautology, we write A ⇔ B which is read as A is equivalent to B.
Note : 1. ⇔ is only symbol, but not connective.
2. A ↔ B is a tautology if and only if truth tables of A and B are the same.
3. Equivalence relation is symmetric and transitive.
Method I. Truth Table Method: One method to determine whether any two statement
formulas are equivalent is to construct their truth tables.
Example: Prove P ∨ Q ⇔ ¬(¬P ∧ ¬Q).
Solution:
P Q P∨Q ¬P ¬Q ¬P ∧ ¬Q ¬(¬P ∧ ¬Q) (P ∨ Q) ⇔ ¬(¬P ∧ ¬Q)
T T T F F F T T
T F T F T F T T
F T T T F F T T
F F F T T T F T
Solution:
P Q P→Q ¬P ¬P ∨ Q (P → Q) (¬P ∨ Q)
T T T F T T
T F F F F T
F T T T T T
F F T T T T
Equivalence Formulas:
7. Idempotent laws:
(a) P ∨ P ⇔ P (b) P ∧ P ⇔ P
8. Associative laws:
(a) (P ∨ Q) ∨ R ⇔ P ∨ (Q ∨ R) (b) (P ∧ Q) ∧ R ⇔ P ∧ (Q ∧ R)
9. Commutative laws:
(a) P ∨ Q ⇔ Q ∨ P (b) P ∧ Q ⇔ Q ∧ P
10. Distributive laws:
P ∨ (Q ∧ R) ⇔ (P ∨ Q) ∧ (P ∨ R) P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
(a) P ∨ (P ∧ Q) ⇔ P (b) P ∧ (P ∨ Q) ⇔ P
8. Demorgan‘s laws:
Method II. Replacement Process: Consider a formula A : P → (Q → R). The formula 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). One can easily verify that the formulas A and B are equivalent to each
other. This process of obtaining B from A as the replacement process.
⇔ ¬P ∨ (¬Q ∨ R) [∵ P → Q ⇔ ¬P ∨ Q]
⇔ (P ∧ Q) → R[∵ P → Q ⇔ ¬P ∨ Q].
12
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ (¬P ∧ ¬R) ∨ Q ⇔
¬(P ∨ R) ∨ Q ⇔ P ∨
R→Q
13
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬P ∨ (¬Q ∨ P )
⇔ (¬P ∨ P ) ∨ ¬Q
⇔ T ∨ ¬Q
⇔T
and
¬P → (P → Q) ⇔ ¬(¬P ) ∨ (P → Q)
⇔ P ∨ (¬P ∨ Q) ⇔
(P ∨ ¬P ) ∨ Q ⇔ T
∨Q
⇔T
So, P → (Q → P ) ⇔ ¬P → (P → Q).
⇔T∧ R [∵ ¬P ∨ P ⇔ T ]
⇔R
**Example: Show ((P ∨ Q) ∧ ¬(¬P ∧ (¬Q ∨ ¬R))) ∨ (¬P ∧ ¬Q) ∨ (¬P ∧ ¬R) is tautology.
Solution: By De Morgan‘s laws, we have
¬P ∧ ¬Q ⇔ ¬(P ∨ Q)
¬P ∨ ¬R ⇔ ¬(P ∧ R)
Therefore
14
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬((P ∨ Q) ∧ (P ∨ R))
⇔ P ∨ (Q ∧ R)
⇔ (P ∨ Q) ∧ (P ∨ R)
⇔ (P ∨ Q) ∧ (P ∨ R)
15
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔T
⇔T
¬P ∧ ¬Q: Jan will not take a job in industry and he will not go to graduate school.
(b). Let P : James will bicycle.
Q: James will run tomorrow.
The given statement can be written in the symbolic as P ∨ Q.
The negation of P ∨ Q is given by ¬(P ∨ Q).
¬(P ∨ Q) ⇔ ¬P ∧ ¬Q.
¬P ∧ ¬Q: James will not bicycle and he will not run tomorrow.
(c). Let P : The processor is fast.
Q: The printer is slow.
The given statement can be written in the symbolic as P → Q.
17
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬(¬p ∨ q) ∨ r ⇔
(p ∧ ¬q) ∨ r
and
⇔ (p ∧ r) ∨ (¬q ∧ r)
p → (q → r) ⇔ p → (¬q ∨ r)
⇔ ¬p ∨ (¬q ∨ r) ⇔
¬p ∨ ¬q ∨ r.
Consider the statement: ‖If you study hard, then you will excel‖. Write its converse,
contra positive and logical negation in logic.
Duality Law
Two formulas A and A∗ are said to be duals of each other if either one can be obtained from the
other by replacing ∧ by ∨ and ∨ by ∧. The connectives ∨ and ∧ are called duals of each other. If the
18
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
formula A contains the special variable T or F , then A∗, its dual is obtained by replacing T by F and
F by T in addition to the above mentioned interchanges.
Example: Write the dual of the following formulas:
19
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Result 1: The negation of the formula is equivalent to its dual in which every variable
is replaced by its negation.
We can prove
Example: Prove that (a). ¬(P ∧ Q) → (¬P ∨ (¬P ∨ Q)) ⇔ (¬P ∨ Q) (b).
(P ∨ Q) ∧ (¬P ∧ (¬P ∧ Q)) ⇔ (¬P ∧ Q)
⇔ (P ∧ Q) ∨ (¬P ∨ Q)
⇔ (P ∧ Q) ∨ ¬P ∨ Q
⇔ ((P∧ Q) ∨ ¬P )) ∨ Q
⇔ ((P ∨ ¬P ) ∧ (Q ∨ ¬P )) ∨ Q
⇔ (T ∧ (Q ∨ ¬P )) ∨ Q
⇔ (Q ∨ ¬P ) ∨ Q
⇔ Q ∨ ¬P
⇔ ¬P ∨ Q
Tautological Implications
A statement formula A is said to tautologically imply a statement B if and only if A → B
is a tautology.
In this case we write A ⇒ B, which is read as ‘A implies B‘.
Note: ⇒ is not a connective, A ⇒ B is not a statement formula.
A ⇒ B states that A → B is tautology.
20
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Clearly A ⇒ B guarantees that B has a truth value T whenever A has the truth value T .
One can determine whether A ⇒ B by constructing the truth tables of A and B in the same manner as
was done in the determination of A ⇔ B. Example: Prove that (P → Q) ⇒ (¬Q → ¬P ).
21
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Solution:
P Q ¬P ¬Q P→Q ¬Q → ¬P (P → Q) → (¬Q → ¬P )
T T F F T T T
T F F T F F T
F T T F T T T
F F T T T T T
Since all the entries in the last column are true, (P → Q) → (¬Q → ¬P ) is a
tautology.
Hence (P → Q) ⇒ (¬Q → ¬P ).
tional leads to the truth value T for the consequent. This procedure guarantees that the
conditional becomes tautology, thereby proving the implication.
Solution: Assume that the antecedent ¬Q ∧ (P → Q) has the truth value T , then both ¬Q and P →
Q have the truth value T , which means that Q has the truth value F , P → Q has the truth value T .
Hence P must have the truth value F .
Therefore the consequent ¬P must have the truth value T.
¬Q ∧ (P → Q) ⇒ ¬P .
Another method to show A ⇒ B is to assume that the consequent B has the truth value F and then
show that this assumption leads to A having the truth value F . Then A → B must have the truth
value T .
Example: Show that ¬(P → Q) ⇒ P .
Solution: Assume that P has the truth value F . When P has F , P → Q has T , then ¬(P → Q) has F
¬(P → Q) ⇒ P
Other Connectives
We introduce the connectives NAND, NOR which have useful applications in the design of
computers.
NAND: The word NAND is a combination of ‘NOT‘ and ‘AND‘ where ‘NOT‘ stands for negation
and ‘AND‘ for the conjunction. It is denoted by the symbol ↑.
If P and Q are two formulas then
P ↑ Q ⇔ ¬(P ∧ Q)
The connective ↑ has the following equivalence:
P ↑ P ⇔ ¬(P ∧ P ) ⇔ ¬P ∨ ¬P ⇔ ¬P .
22
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬(Q ∧ P ) ⇔
(Q ↑ P )
∴ NAND is commutative.
NAND is not Associative: Let P , Q and R be any three statement formulas.
Consider ↑ (Q ↑ R) ⇔ ¬(P ∧ (Q ↑ R)) ⇔ ¬(P ∧ (¬(Q ∧ R)))
⇔ ¬P ∨ (Q ∧ R))
(P ↑ Q) ↑ R ⇔ ¬(P ∧ Q) ↑ R
⇔ ¬(¬(P ∧ Q) ∧ R) ⇔
(P ∧ Q) ∨ ¬R
P ↓ P ⇔ ¬(P ∨ P ) ⇔ ¬P ∧ ¬P ⇔ ¬P .
⇔ ¬(Q ∨ P ) ⇔
(Q ↓ P )
∴ NOR is commutative.
NOR is not Associative: Let P , Q and R be any three statement formulas. Consider
P↓ (Q ↓ R) ⇔ ¬(P ∨ (Q ↓ R))
23
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ ¬P ∧ (Q ∨ R)
(P ↓ Q) ↓ R ⇔ ¬(P ∨ Q) ↓
R
⇔ ¬(¬(P ∨ Q) ∨ R) ⇔
(P ∨ Q) ∧ ¬R
Since
24
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
¬(P ∧ Q) ⇔ ¬P ∨ ¬Q
¬(P ∨ Q) ⇔ ¬P ∧ ¬Q.
⇔ (P ∨ Q) ↑ (P ∨ Q)
⇔ (P ∧ Q) ↓ (P ∧ Q)
Truth Tables
Example: Show that (A ⊕ B) ∨ (A ↓ B) ⇔ (A ↑ B). (May-2012)
Solution: We prove this by constructing truth table.
A B A⊕B A↓B (A ⊕ B) ∨ (A ↓ B) A↑B
T T F F F F
T F T F T T
F T T F T T
F F F T T T
As columns (A ⊕ B) ∨ (A ↓ B) and (A ↑ B) are identical.
∴ (A ⊕ B) ∨ (A ↓ B) ⇔ (A ↑ B).
Normal Forms
n
If a given statement formula A(p1, p2, ...pn) involves n atomic variables, we have 2
possible combinations of truth values of statements replacing the variables.
The formula A is a tautology if A has the truth value T for all possible assignments of the
truth values to the variables p1, p2, ...pn and A is called a contradiction if A has the truth
value F for all possible assignments of the truth values of the n variables. A is said to be satis
able if A has the truth value T for atleast one combination of truth values assigned to p1, p2,
...pn.
The problem of determining whether a given statement formula is a Tautology, or a
Contradiction is called a decision problem.
The construction of truth table involves a finite number of steps, but the construc-tion
may not be practical. We therefore reduce the given statement formula to normal form and
find whether a given statement formula is a Tautology or Contradiction or atleast satisfiable.
It will be convenient to use the word ‖product‖ in place of ‖conjunction‖ and ‖sum‖ in
25
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
26
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Any part of an elementary sum or product which is itself an elementary sum or product is
called a factor of the original elementary sum or product. Thus ¬Q,∧ ¬P , and ¬Q ∧ P are
some of the factors of ¬Q ∧ P ∧ ¬P .
A formula which is equivalent to a given formula and which consists of a sum of elementary
products is called a disjunctive normal form of the given formula.
⇔ (P ∧ ¬P ) ∨ (P ∧ Q)
R↔ S ⇔ (R ∧ S) ∨ (¬R ∧ ¬S)
The method for obtaining conjunctive normal form of a given formula is similar to the one
27
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
given for disjunctive normal form. Again, the conjunctive normal form is not unique.
28
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ (Q ∨ (P ∨ ¬P )) ∧ (Q ∨ ¬Q)
⇔ (Q ∨ P ∨ ¬P ) ∧ (Q ∨ ¬Q)
Since each of the elementary sum is a tautology, hence the given formula is tautology.
Minterm: For a given number of variables, the minterm consists of conjunctions in which each
statement variable or its negation, but not both, appears only once.
Let P and Q be the two statement variables. Then there are 2 minterms given by P ∧ Q, P ∧ ¬Q,
2
¬P ∧ Q, and ¬P ∧ ¬Q.
P Q P∧Q P ∧ ¬Q ¬P ∧ Q ¬P ∧ ¬Q
T T T F F F
T F F T F F
F T F F T F
F F F F F T
variables P and Q.
Definition: For a given formula, an equivalent formula consisting of disjunctions of minterms only
is called the Principal disjunctive normal form of the formula.
The principle disjunctive normal formula is also called the sum-of-products canonical form.
30
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
T T T P ∧Q
T F F P ∧ ¬Q
F T T ¬P ∧ Q
F F T ¬P ∧ ¬Q
T T T P∧Q∧R T F T T
T T F P ∧ Q ∧ ¬R T F F T
T F T P ∧ ¬Q ∧ R F F F F
T F F P ∧ ¬Q ∧ ¬R F F F F
F T T ¬P ∧ Q ∧ R F T T T
F T F ¬P ∧ Q ∧ ¬R F F F F
F F T ¬P ∧ ¬Q ∧ R F T F T
F F F ¬P ∧ ¬Q ∧ ¬R F F F F
In order to obtain the principal disjunctive normal form of a given formula is con-
structed as follows:
31
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Solution:
(a) ¬P ∨ Q ⇔ (¬P ∧ T ) ∨ (Q ∧ T ) [∵ A ∧ T ⇔ A]
⇔ (¬P ∧ (Q ∨ ¬Q)) ∨ (Q ∧ (P ∨ ¬P )) [∵ P ∨ ¬P ⇔ T ]
[∵ P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
⇔ (P ∧ Q ∧ T ) ∨ (¬P ∧ R ∧ T ) ∨ (Q ∧ R ∧ T )
∨ (Q ∧ R ∧ P ) ∨ (Q ∧ R ∧ ¬P )
P ∨ (P ∧ Q) ⇔ P
P ∨ (¬P ∧ Q) ⇔ P ∨ Q
Solution: We write the principal disjunctive normal form of each formula and com-pare these
normal forms.
(a) P ∨ (P ∧ Q) ⇔ (P ∧ T ) ∨ (P ∧ Q) [∵ P ∧ Q ⇔ P ]
⇔ (P ∧ (Q ∨ ¬Q)) ∨ (P ∧ Q) [∵ P ∨ ¬P ⇔ T ]
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) [∵ P ∨ P ⇔ P ]
which is the required PDNF.
32
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Now, ⇔ P ∧T
⇔ P ∧ (Q ∨ ¬Q)
⇔ (P ∧ Q) ∨ (P ∧ ¬Q)
which is the required PDNF.
Hence, P ∨ (P ∧ Q) ⇔ P .
33
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
⇔ (P ∧ (Q ∨ ¬Q)) ∨ (¬P ∧ Q)
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (¬P ∧ Q)
which is the required PDNF.
Now,
P ∨ Q ⇔ (P ∧ T ) ∨ (Q ∧ T )
⇔ (P ∧ (Q ∨ ¬Q)) ∨ (Q ∧ (P ∨ ¬P ))
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (Q ∧ P ) ∨ (Q ∧ ¬P )
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (¬P ∧ Q)
which is the required PDNF.
Hence, P ∨ (¬P ∧ Q) ⇔ P ∨ Q.
→ ((P → Q) ∧ ¬(¬Q ∨ ¬P )) ⇔ ¬P
∨ ((¬P ∨ Q) ∧ (Q ∧ P ))
⇔ ¬P ∨ ((¬P ∧ Q ∧ P ) ∨ (Q ∧ Q ∧ P )) ⇔
¬P ∨ F ∨ (P ∧ Q)
⇔ ¬P ∨ (P ∧ Q)
⇔ (¬P ∧ T ) ∨ (P ∧ Q)
⇔ (¬P ∧ (Q ∨ ¬Q)) ∨ (P ∧ Q)
35
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
For a given formula, an equivalent formula consisting of conjunctions of the max-terms only is
known as its principle conjunctive normal form. This normal form is also called the product-of-sums
canonical form.The method for obtaining the PCNF for a given formula is similar to the one
described previously for PDNF.
Example: Obtain the principal conjunctive normal form of the formula (¬P→R)∧(Q↔P)
Solution:
(¬P → R) ∧ (Q ↔ P )
⇔ (P ∨ R ∨ F ) ∧ [(¬Q ∨ P ∨ F ) ∧ (¬P ∨ Q ∨ F )]
⇔ (P ∨ R ∨ Q) ∧ (P ∨ R ∨ ¬Q) ∧ (P ∨ ¬Q ∨ R) ∧ (P ∨ ¬Q ∨ ¬R)
Note: If the principal disjunctive (conjunctive) normal form of a given formula A containing n
variables is known, then the principal disjunctive (conjunctive) normal form of ¬A will consist of
the disjunction (conjunction) of the remaining minterms (maxterms) which do not appear in the
principal disjunctive (conjunctive) normal form of A. From A ⇔ ¬¬A one can obtain the principal
conjunctive (disjunctive) normal form of A by repeated applications of De Morgan‘s laws to the
principal disjunctive (conjunctive) normal form of ¬A.
Solution:
⇔ P ∨ (¬P → (Q ∨ (¬Q → R)))
⇔ P ∨ (P ∨ Q ∨ (Q ∨ R)))
⇔ P ∨ (P ∨ Q ∨ R)
⇔ P ∨ Q ∨R
which is the PCNF.
Now PCNF of ¬S is the conjunction of remaining maxterms, so
36
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
∨ ( P ∧ ¬Q ∧ R) ∨ (P ∧ Q ∧ ¬R) ∨ (P ∧ Q ∧ R)
37
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Definition: If a conclusion is derived from a set of premises by using the accepted rules of
reasoning, then such a process of derivation is called a deduction or a formal proof and the argument
is called a valid argument or conclusion is called a valid conclusion.
Definition: Let A and B be two statement formulas. We say that ‖B logically follows from A‖ or
H1 ∧ H2 ∧ ... ∧ Hm ⇒ C
(1)
38
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Note: To determine whether the conclusion logically follows from the given premises, we use the
following methods:
Truth table method
Without constructing truth table method.
Let P1, P2, · · · , Pn be all the atomic variables appearing in the premises H1, H2, · · · , Hm and
in the conclusion C. If all possible combinations of truth values are assigned to P1, P2, · · · , Pn and if
the truth values of H1, H2, ..., Hm and C are entered in a table. We look for the rows in which all H1,
H2, · · · , Hm have the value T. If, for every such row, C also has the value T, then (1) holds. That is,
the conclusion follows logically.
Alternatively, we look for the rows on which C has the value F. If, in every such row, at
least one of the values of H1, H2, · · · , Hm is F, then (1) also holds. We call such a method a
‗truth table technique‘ for the determination of the validity of a conclusion.
Example: Determine whether the conclusion C follows logically from the premises
H1 and H2.
(c) H1 : P → Q H2 : P C : Q
(d) H1 : P → Q H2 : ¬P C : Q
(c) H1 : P → Q H2 : ¬(P ∧ Q) C : ¬P
(f) H1 : ¬P H2 : P Q C : ¬(P ∧ Q)
(g) H1 : P → Q H2 : Q C : P
Solution: We first construct the appropriate truth table, as shown in table.
P Q P→Q ¬P ¬(P ∧ Q) P Q
T T T F F T
T F F F T F
F T T T T F
F F T T T T
39
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
(c) We observe that the first row is the only row in which both the premises have the value T
. The conclusion also has the value T in that row. Hence it is valid.
In (b) the third and fourth rows, the conclusion Q is true only in the third row, but not in
the fourth, and hence the conclusion is not valid.
Similarly, we can show that the conclusions are valid in (c) and (d) but not in (e).
Rules of Inference
The following are two important rules of inferences.
Implication Formulas
I1 : P ∧ Q ⇒ P (simplification)
I2 : P ∧ Q ⇒ Q
I3 : P ⇒ P ∨ Q
I4 : Q ⇒ P ∨ Q
I5 : ¬P ⇒ P → Q I6
: Q ⇒ P → Q I7 :
¬(P → Q) ⇒ P
I8 : ¬(P → Q) ⇒ ¬Q
I9 : P, Q ⇒ P ∧ Q
I :
1
¬P, P ∨ Q ⇒ Q (disjunctive syllogism)
I
11 : P, P → Q ⇒ Q (modus ponens)
I
12 : ¬Q, P → Q ⇒ ¬P (modus tollens)
I
13 : P → Q, Q → R ⇒ P → R (hypothetical syllogism)
I
14 : P ∨ Q, P → R, Q → R ⇒ R (dilemma)
Example: Demonstrate that R is a valid inference from the premises P → Q, Q → R, and P .
Solution:
{1} (1) P → Q Rule P
{2} (2) P Rule P,
26
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
27
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Show that R∨S follows logically from the premises C ∨D, (C ∨D) → ¬H, ¬H → (A ∧
Solution:
Q → R, P → M, and ¬M.
Solution:
28
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
‖If you work hard, you will pass the exam. You did not pass. Therefore, you did not work
hard‖.
‖If Sachin hits a century, then he gets a free car. Sachin does not get a free car.
29
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
(P ∧ R) → S ⇔ P → (R → S)
Let P denote the conjunction of the set of premises and let R be any formula. The above
equivalence states that if R is included as an additional premise and S is derived from P ∧ R, then
R → S can be derived from the premises P alone.
Rule CP is also called the deduction theorem and is generally used if the conclu-sion of the form
R → S. In such cases, R is taken as an additional premise and S is derived from the given
premises and R.
Example: Show that R → S can be derived from the premises P → (Q → S), ¬R ∨ P , and Q.
(Nov. 2011)
30
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: By using the method of derivation, show that following statements con-stitute a valid
argument: ‖If A works hard, then either B or C will enjoy. If B enjoys, then A will not work hard.
If D enjoys, then C will not. Therefore, if A works hard, D will not enjoy.
Example: Determine the validity of the following arguments using propositional logic:
‖Smoking is healthy. If smoking is healthy, then cigarettes are prescribed by physi-
cians. Therefore, cigarettes are prescribed by physicians‖. (May-2012)
Solution: Let us indicate the statements as follows:
P : Smoking is healthy.
Q: Cigarettes are prescribed by physicians.
Consistency of Premises
A set of formulas H1, H2, · · · , Hm is said to be consistent if their conjunction has the
truth value T for some assignment of the truth values to the atomic variables appearing in H1,
H2,
· · · , Hm.
If, for every assignment of the truth values to the atomic variables, at least one of
the formulas H1, H2, · · · , Hm is false, so that their conjunction is identically false, then the
formulas H1, H2, · · · , Hm are called inconsistent.
Thus, the given set of premises leads to a contradiction and hence it is inconsistent.
32
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Show that the following set of premises is inconsistent: ‖If the contract is valid, then
John is liable for penalty. If John is liable for penalty, he will go bankrupt. If the bank will loan
him money, he will not go bankrupt. As a matter of fact, the contract is valid, and the bank will
loan him money.‖
Solution: Let us indicate the statements as follows:
V : The contract is valid.
L: John is liable for penalty.
M: Bank will loan him money.
B: John will go bankrupt.
In order to show that a conclusion C follows logically from the premises H1, H2, · · · ,
Hm, we assume that C is false and consider ¬C as an additional premise. If the new set of
premises is inconsistent, so that they imply a contradiction. Therefore, the assump-tion that ¬C is
true does not hold.
Hence, C is true whenever H1, H2, · · · , Hm are true. Thus, C follows logically from
the premises H1, H2, · · · , Hm.
33
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Solution: We introduce ¬¬(P ∧Q) as additional premise and show that this additional premise
leads to a contradiction.
Example: Show that the following set of premises are inconsistent, using proof by contradiction
P → (Q ∨ R), Q → ¬P, S → ¬R, P ⇒ P → ¬S.
Solution: We include ¬(P → ¬S) as an additional premise. Then we show that this leads to a
contradiction.
∴ ¬(P → ¬S) ⇔ ¬(¬P ∨ ¬S) ⇔ P ∧ S.
35
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Quantifiers
Quantifiers: Quantifiers are words that are refer to quantities such as ‘some‘ or ‘all‘.
Universal Quantifier: The phrase ‘forall‘ (denoted by ∀) is called the universal quantifier.
For example, consider the sentence ‖All human beings are mortal‖.
Let P (x) denote ‘x is a mortal‘.
Then, the above sentence can be written
as (∀x ∈ S)P (x) or ∀xP (x)
Existential Quantifier: The phrase ‘there exists‘ (denoted by ∃) is called the exis-tential
quantifier.
36
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
M(x) : x is an integer
N(x) : x either positive or negative
Express the following using quantifiers:
All men are mortal
Any integer is either positive or negative.
Solution: (a) The given statement can be written as
for all x, if x is a man, then x is mortal and this can be expressed as
(x)(K(x) → L(x)).
(d) The given statement can be written as
for all x, if x is an integer, then x is either positive or negative and this can be expressed
as (x)(M(x) → N(x)).
37
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
(x)P (x, y)
(x)(P (x) → Q(x))
(x)(P (x) → (∃y)R(x, y))
(x)(P (x) → R(x)) ∨ (x)(R(x) → Q(x))
(∃x)(P (x) ∧ Q(x))
(∃x)P (x) ∧ Q(x).
In (1), P (x, y) is the scope of the quantifier, and occurrence of x is bound occurrence,
while the occurrence of y is free occurrence.
In (2), the scope of the universal quantifier is P (x) → Q(x), and all concrescences of x are
bound.
In (3), the scope of (x) is P (x) → (∃y)R(x, y), while the scope of (∃y) is R(x, y). All
occurrences of both x and y are bound occurrences.
In (4), the scope of the first quantifier is P (x) → R(x) and the scope of the second is
R(x) → Q(x). All occurrences of x are bound occurrences.
In (6), the scope of (∃x) is P (x) and the last of occurrence of x in Q(x) is free.
Example: Let P (x) denote the statement ‖x is a professional athlete‖ and let Q(x) denote the
statement ‖x plays soccer‖. The domain is the set of all people.
(c). Write each of the following proposition in English.
(x)(P (x) → Q(x)
(∃x)(P (x) ∧ Q(x))
(x)(P (x) ∨ Q(x))
(d). Write the negation of each of the above propositions, both in symbols and in words.
Solution:
(c). (i). For all x, if x is an professional athlete then x plays soccer.
‖All professional athletes plays soccer‖ or ‖Every professional athlete plays
soccer‖.
(ii). There exists an x such that x is a professional athlete and x plays soccer.
38
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
There exists an x such that, x is a professional athlete and x does not paly soccer.
In words: ‖Some professional athlete do not play soccer‖.
(ii). ¬(∃x)(P (x) ∧ Q(x)) ⇔ (x)(¬P (x) ∨ ¬Q(x))
In words: ‖Every people is neither a professional athlete nor plays soccer‖ or All people
either not a professional athlete or do not play soccer‖.
(iii). ¬(x)(P (x) ∨ Q(x)) ⇔ (∃x)(¬P (x) ∧ ¬Q(x)).
In words: ‖Some people are not professional athlete or do not paly soccer‖.
Equivalence formulas:
E31 : (∃x)[A(x) ∨ B(x)] ⇔ (∃x)A(x) ∨ (∃x)B(x)
40
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Establish the validity of the following argument:‖All integers are ratio-nal numbers.
Some integers are powers of 2. Therefore, some rational numbers are powers of 2‖.
Solution: Let P (x) : x is an integer
R(x) : x is rational number
S(x) : x is a power of 2
Hence, the given statements becomes
42
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Show that (x)(P (x) → Q(x)) ∧ (x)(Q(x) → R(x)) ⇒ (x)(P (x) → R(x)).
Solution:
43
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Here in step (4), y is fixed, and it is not possible to use that variable again in step (5).
Hence, the converse is not true.
Example: Show that from (∃x)[F (x) ∧S(x)] → (y)[M(y) → W (y)] and (∃y)[M(y) ∧ ¬W (y)] the
conclusion (x)[F (x) → ¬S(x)] follows.
{1, 6} (7) ¬(∃x)[F (x) ∧ S(x)] Rule T, (5), (6) and I12
44
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
45
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Example: Using predicate logic, prove the validity of the following argument:
‖Every husband argues with his wife. x is a husband. Therefore, x argues with his
wife‖.
UNIT-2
Set Theory
Set:A set is collection of well defined objects.
In the above definition the words set and collection for all practical purposes are Synonymous. We have
really used the word set to define itself.
Each of the objects in the set is called a member of an element of the set. The objects themselves can be
almost anything. Books, cities, numbers, animals, flowers, etc. Elements of a set are usually denoted by
lower-case letters. While sets are denoted by capital letters of English larguage.
Subset:
A set A is a subset of the set B if and only if every element of A is also an element of B. We also say that A is
contained in B, and use the notation A B.
Proper Subset:
A set A is called proper subset of the set B. If (i) A is subset of B and (ii) B is not a subset A i.e., A is said to be a
proper subset of B if every element of A belongs to the set B, but there is atleast one element of B, which is
not in A. If A is a proper subset of B, then we denote it by A B.
Null set: The set with no elements is called an empty set or null set. A Null set is designated by the symbol .
The null set is a subset of every set, i.e., If A is any set then A.
Universal set:
In many discussions all the sets are considered to be subsets of one particular set. This set is called the
universal set for that discussion. The Universal set is often designated by the script letter . Universal set
in
Power set:
The power set of A is denoted by P (A). If A has n elements in it, then P (A) has 2n elements:
Disjoint sets:
The union of two sets A and B is the set whose elements are all of the elements in A or in B or in both.
The union of sets A and B denoted by A B is read as ―A union B‖.
The intersection of two sets A and B is the set whose elements are all of the elements common to both A and B.
The intersection of the sets of ―A‖ and ―B‖ is denoted by A B and is read as ―A intersection B‖
Difference of sets:
If A and B are subsets of the universal set U, then the relative complement of B in Ais the set of all elements in
Complement of a set:
If U is a universal set containing the set A, then U – A is called the complement of A. It is denoted by A1 . Thus
A1 = {x: xA}
Inclusion-Exclusion Principle:
The inclusion–exclusion principle is a counting technique which generalizes the familiar method of
obtaining the number of elements in the unionof two finite sets; symbolically expressed as
where A and B are two finite sets and |S| indicates the cardinality of a set S (which may be considered as the
number of elements of the set, if the set is finite). The formula expresses the fact that the sum of the sizes of
the two sets may be too large since some elements may be counted twice. The double-counted elements are
those in the intersection of the two sets and the count is corrected by subtracting the size of the intersection.
The principle is more clearly seen in the case of three sets, which for the sets A, B and C is given by
Fig.Inclusion–exclusion illustrated by a
Venn diagram for three sets
This formula can be verified by counting how many times each region in the Venn diagram figure is included
in the right-hand side of the formula. In this case, when removing the contributions of over-counted
elements, the number of elements in the mutual intersection of the three sets has been subtracted too
often, so must be added back in to get the correct total.
Example: How many natural numbers n ≤ 1000 are not divisible by any of 2, 3?
Ans: Let A2 = {n ∈ N | n ≤ 1000, 2|n} and A3 = {n ∈ N | n ≤ 1000, 3|n}.
Then, |A2 ∪ A3| = |A2| + |A3| − |A2 ∩ A3| = 500 + 333 − 166 = 667.
Example: How many integers between 1 and 10000 are divisible by none of 2, 3, 5,
7? Ans: For i ∈ {2, 3, 5, 7}, let Ai = {n ∈ N | n ≤ 10000, i|n}.
Relations
Solution: If A = {5, 6, 7} and B = {x, y}, then the subset R = {(5, x), (5, y), (6, x), (6, y)} is a
relation from A to B.
Definition: Let S be any relation. The domain of the relation S is defined as the set of all first
elements of the ordered pairs that belong to S and is denoted by D(S).
D(S) = { x : (x, y) ∈ S, for some y }
The range of the relation S is defined as the set of all second elements of the ordered pairs that
belong to S and is denoted by R(S).
R(S) = { y : (x, y) ∈ S, for some x}
divides b.
Solution: We obtain R = {(2, 4), (2, 6), (3, 3), (3, 6), (4, 4)}.
Examples: (i). If R1 = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 3)} be a relation on A = {1, 2, 3}, then R1 is a
reflexive relation, since for every x ∈ A, (x, x) ∈ R1.
(ii). If R2 = {(1, 1), (1, 2), (2, 3), (3, 3)} be a relation on A = {1, 2, 3}, then R2 is not a reflexive
relation, since for every 2 ∈ A, (2, 2) R2.
(iii). If R3 = {(1, 1), (1, 2), (1, 3), (2, 2), (2, 1), (3, 1)} be a relation on A = {1, 2, 3}, then R3 is a symmetric
relation.
Example: Given S = {1, 2, ..., 10} and a relation R on S, where R = {(x, y)| x + y = 10}.
= {(1, 9), (9, 1), (2, 8), (8, 2), (3, 7), (7, 3), (4, 6), (6, 4), (5, 5)}.
(i). For any x ∈ S and (x, x) R. Here, 1 ∈ S but (1, 1)R.
⇒ the relation is symmetric, but it is not antisymmetric. (iii). (1, 9) ∈ R and (9, 1) ∈ R
⇒ (1, 1) R
Let X = {x1, x2, ..., xm} and Y = {y1, y2, ..., yn} be finite sets containing m and n elements,
respectively, and R be the relation from A to B. Then R can be represented by an m × n matrix
Example. Let A = {1, 2, 3, 4} and B = {b1, b2, b3}. Consider the relation R = {(1, b2), (1, b3), (3,
b2), (4, b1), (4, b3)}. Determine the matrix of the relation.
Relation R = {(1, b2), (1, b3), (3, b2), (4, b1), (4, b3)}.
Matrix of the relation R is written as
0 1 1
0 0 0
That is MR =
0 0
1
1 0 1
Example: Let A = {1, 2, 3, 4}. Find the relation R on A determined by the matrix
1 0 1 0
0 0 1 0
0 0
MR =
1
0
0 1
1 1
Solution: The relation R = {(1, 1), (1, 3), (2, 3), (3, 1), (4, 1), (4, 2), (4, 4)}.
Graph of a Relation: A relation can also be represented pictorially by drawing its graph. Let R
be a relation in a set X = {x1, x2, ..., xm}. The elements of X are represented by points or circles
called nodes. These nodes are called vertices. If (xi, xj ) ∈ R, then we connect the nodes xi and xj
by means of an arc and put an arrow on the arc in the direction from xi to xj . This is called
an
edge. If all the nodes corresponding to the ordered pairs in R are connected by arcs with proper
arrows, then we get a graph of the relation R.
Note: (i). If xiRxj and xj Rxi, then we draw two arcs between xi and xj with arrows pointing in
both directions.
(ii). If xiRxi, then we get an arc which starts from node xi and returns to node xi. This arc is called
a loop.
Properties of relations:
(i). If a relation is reflexive, then there must be a loop at each node. On the other hand, if the
relation is irreflexive, then there is no loop at any node.
(ii). If a relation is symmetric and if one node is connected to another, then there must be a return
arc from the second node to the first.
(iii). For antisymmetric relations, no such direct return path should exist.
(iv). If a relation is transitive, the situation is not so simple.
Example: Let X = {1, 2, 3, 4} and R={(x, y)| x > y}. Draw the graph of R and also give its matrix.
Solution: R = {(4, 1), (4, 3), (4, 2), (3, 1), (3, 2), (2, 1)}.
3 4
Graph of R
0 0 0 0
1 0 0 0
MR =
1 1 0 0
1 1 1 0
Ai S .
i 1
Then the set A is called a covering of S, and the sets A1, A2, · · · , Am are said to cover S. If, in
addition, the elements of A, which are subsets of S, are mutually disjoint, then A is called a
partition of S, and the sets A1, A2, · · · , Am are called the blocks of the partition.
Example: Let S = {a, b, c} and consider the following collections of subsets of S. A = {{a, b}, {b, c}},
B = {{a}, {a, c}}, C = {{a}, {b, c}}, D = {{a, b, c}}, E = {{a}, {b}, {c}}, and F = {{a}, {a, b}, {a,
Solution: The sets A, C, D, E, F are covering of S. But, the set B is not covering of S, since their
union is not S.
Example: Let S = {a, b, c} and consider the following collections of subsets of S. A = {{a, b}, {b,
c}}, B = {{a}, {b, c}}, C = {{a, b, c}}, D = {{a}, {b}, {c}}, and E= {{a}, {a, c}}.
Solution: The sets B, C and D are partitions of S and also they are covering. Hence, every partition
is a covering.
The set A is a covering, but it is not a partition of a set, since the sets {a, b} and {b, c} are not
disjoint. Hence, every covering need not be a partition.
The set E is not partition, since the union of the subsets is not S. The partition C has one block and
the partition D has three blocks.
Solution:
Example: Let X = {1, 2, 3, 4} and R == {(1, 1), (1, 4), (4, 1), (4, 4), (2, 2), (2, 3), (3, 2), (3, 3)}.
1 0 0 1
0 1 1
MR = 0
0
1 1 01
1 0 0 1
⇒ R is reflexive.
⇒ (x − y) + (y − z) is divisible by 3
⇒ x − z is divisible by 3
⇒ xRz
Hence, the relation R is transitive.
Thus, the relation R is an equivalence relation.
Congruence Relation: Let I denote the set of all positive integers, and let m be apositive
integer. For x ∈ I and y ∈ I, define R as R = {(x, y)| x − y is divisible by m }
The statement ‖x − y is divisible by m‖ is equivalent to the statement that both x and y have the
same remainder when each is divided by m.
In this case, denote R by ≡ and to write xRy as x ≡ y (mod m), which is read as ‖x equals to y
modulo m‖. The relation ≡ is called a congruence relation.
Example: 83 ≡ 13(mod 5), since 83-13=70 is divisible by 5.
Example: Prove that the relation ―congruence modulo m‖ over the set of positive integers is an
equivalence relation.
Solution: Let N be the set of all positive integers and m be a positive integer. We define the
relation ‖congruence modulo m‖ on N as follows:
Let x, y ∈ N. x ≡ y (mod m) if and only if x − y is divisible by m.
Downloaded by Sivahari R ([email protected])
lOMoARcPSD|28881680
Let x, y, z ∈ N. Then
(i). x − x = 0.m
Example: Let R denote a relation on the set of ordered pairs of positive integers such that (x,y)R(u,
v) iff xv = yu. Show that R is an equivalence relation.
Solution: Let R denote a relation on the set of ordered pairs of positive integers.
Let x, y, u and v be positive integers. Given (x, y)R(u, v) if and only if xv = yu.
(i). Since xy = yx is true for all positive integers
⇒ (x, y)R(x, y), for all ordered pairs (x, y) of positive integers.
∴ The relation R is reflexive. (ii). Let (x, y)R(u, v)
⇒ xv = yu ⇒ yu
= xv ⇒ uy = vx
⇒ (u, v)R(x, y)
Compatibility Relations
Definition: A relation R in X is said to be a compatibility relation if it is reflexive and symmetric.
Clearly, all equivalence relations are compatibility relations. A compatibility relation is sometimes
denoted by ≈.
Example: Let X = {ball, bed, dog, let, egg}, and let the relation R be given by
R = {(x, y)| x, y ∈ X ∧ xRy if x and y contain some common letter}.
Then R is a compatibility relation, and x, y are called compatible if xRy.
Note: ball≈bed, bed≈egg. But ball̸≈egg. Thus ≈ is not transitive.
Denoting ‖ball‖ by x1, ‖bed‖ by x2, ‖dog‖ by x3, ‖let‖ by x4, and ‖egg‖ by x5, the graph of ≈ is
given as follows:
Example: The subsets {x1, x2, x4}, {x2, x3, x5}, {x2, x4, x5}, {x1, x4, x5} are maximal compatibility
blocks.
Example: Let the compatibility relation on a set {x1, x2, ..., x6} be given by the matrix:
x2 1
x3 1 1
x4 0 0 1
x5 0 0 1 1
x6 1 0 1 0 1
x1 x2 x3 x4 x5
Draw the graph and find the maximal compatibility blocks of the relation.
Solution:
The maximal compatibility blocks are {x1, x2, x3},{x1, x3, x6},{x3, x5, x6},{x3, x4, x5}.
Example: Let R = {(1, 2), (3, 4), (2, 2)} and S = {(4, 2), (2, 5), (3, 1), (1, 3)}. Find R
◦ S, S ◦ R, R ◦ (S ◦ R), (R ◦ S) ◦ R, R ◦ R, S ◦ S, and (R ◦ R) ◦ R.
Solution: Given R = {(1, 2), (3, 4), (2, 2)} and S = {(4, 2), (2, 5), (3, 1), (1, 3)}.
(R ◦ S) ◦ R = {(3, 2)}
R ◦ (S ◦ R) = {(3, 2)} = (R ◦ S) ◦ R
Example: Let A = {a, b, c}, and R and S be relations on A whose matrices are as
given below:
1 0 1 1 0 0
MR = 0 1 0 and MS = 1 0 1
1 0 1 1
1 1
R = {(a, a), (a, c), (b, a), (b, b), (b, c), (c, b)}
S= {(a, a), (b, b), (b, c), (c, a), (c, c)}. From these, we find that
R ◦ S = {(a, a), (a, c), b, a), (b, b), (b, c), (c, b), (c, c)}
S ◦ R = {(a, a), (a, c), (b, b), (b, a), (b, c), (c, a), (c, b), (c, c)}
2
R ◦ R = R = {(a, a), (a, c), (a, b), (b, a), (b, c), (b, b), (c, a), (c, b),
2
(c, c)} S ◦ S = S = {(a, a), (b, b), (b, c), (b, a), (c, a), (c, c)}.
1 1 1 1 1 1
1 1 1
1 0 0
MSO S = 1 0 1
1 1 1
Transitive Closure
Let X be any finite set and R be a relation in X. The relation R = R∪R ∪R ∪· · ·∪R
+ 2 3 n
Example: Let the relation R = {(1, 2), (2, 3), (3, 3)} on the set {1, 2, 3}. What is the transitive closure of
R?
= {(1, 2), (2, 3), (3, 3)} ∪ {(1, 3), (2, 3), (3, 3)} ∪ {(1, 3), (2, 3), (3, 3)} ∪ ...
Partial Ordering
A binary relation R in a set P is called a partial order relation or a partial ordering in P iff R is
reflexive, antisymmetric, and transitive. i.e.,
Example: Show that the relation ‖greater than or equal to‖ is a partial ordering on the set of
integers.
′ ′
Solution: Let Z be the set of all integers and the relation R = ≥
′ ′
(i). Since a ≥ a for every integer a, the relation ≥ is reflexive.
(ii). Let a and b be any two integers.
Let aRb and bRa ⇒ a ≥ b and b ≥ a
⇒ a=b
′ ′
∴ The relation ≥ is antisymmetric. (iii).
Let a, b and c be any three integers.
⇒ a≥c
′ ′
∴ The relation ≥ is transitive.
′ ′ ′ ′
Since the relation ≥ is reflexive, antisymmetric and transitive, ≥ is partial ordering on the set of
integers. Therefore, (Z, ≥) is a poset.
Example: Show that the inclusion ⊆ is a partial ordering on the set power set of a set S.
Solution: Since (i). A ⊆ A for all A ⊆ S, ⊆ is reflexive.
(ii). A ⊆ B and B ⊆ A ⇒ A = B, ⊆ is antisymmetric.
(iii). A ⊆ B and B ⊆ C ⇒ A ⊆ C, ⊆ is transitive.
Note: On the set of all integers, the above relation is not a partial order as a and −a both divide
each other, but a = −a. i.e., the relation is not antisymmetric. Definition: Let (P, ≤) be a partially
ordered set. If for every x, y ∈ P we have either x ≤ y ∨ y ≤ x, then ≤ is called a simple ordering or
linear ordering on P , and (P, ≤) is called a totally ordered or simply ordered set or a chain.
Note: It is not necessary to have x ≤ y or y ≤ x for every x and y in a poset P . In fact, x may not be
related to y, in which case we say that x and y are incomparable. Examples:
(i). The poset (Z, ≤) is a totally ordered.
Since a ≤ b or b ≤ a whenever a and b are integers.
(ii). The divisibility relation / is a partial ordering on the set of positive integers.
+
Therefore (Z , /) is a poset and it is not a totally ordered, since it contain elements that are
incomparable, such as 5 and 7, 3 and 5.
Definition: In a poset (P, ≤), an element y ∈ P is said to cover an element x ∈ P if x < y and if
there does not exist any element z ∈ P such that x ≤ z and z ≤ y; that is, y covers x ⇔ (x < y ∧ (x ≤ z
≤ y ⇒ x = z ∨ z = y)).
Hasse Diagrams
A partial order ≤ on a set P can be represented by means of a diagram known as Hasse diagram of
(P, ≤). In such a diagram,
Note: For totally ordered set (P, ≤), the Hasse diagram consists of circles one below the other. The
poset is called a chain.
Example: Let P = {1, 2, 3, 4, 5} and ≤ be the relation ‖less than or equal to‖ then the Hasse
diagram is:
Example: Let X = {2, 3, 6, 12, 24, 36}, and the relation ≤ be such that x ≤ y if x divides y. Draw the
Hasse diagram of (X, ≤). Solution: The Hasse diagram is is shown below:
Example: Draw the Hasse diagram for the relation R on A = {1, 2, 3, 4, 5} whose relation matrix
given below:
1 0 1 1 1
0 1 1 1 1
0 0 1 1
1
MR =
0 0 0 1 0
0 0 0 0 1
Solution:
R= {(1, 1), (1, 3), (1, 4), (1, 5), (2, 2), (2, 3), (2, 4), (2, 5), (3, 3), (3, 4), (3, 5), (4, 4), (5.5)}.
4 5
1 2
Example: A partial order R on the set A = {1, 2, 3, 4} is represented by the following digraph.
Draw the Hasse diagram for R.
We check that R is reflexive, transitive and antisymmetric. Therefore, R is partial order relation
on A.
The hasse diagram of R is shown below:
Example: Let A be a finite set and ρ(A) be its power set. Let ⊆ be the inclusion relation on the
elements of ρ(A). Draw the Hasse diagram of ρ(A), ⊆) for
A = {a}
A = {a, b}.
Solution: (i). Let A = {a}
ρ(A) = {ϕ, a}
(ii). Let A = {a, b}. ρ(A) = {ϕ, {a}, {b}, {a, b}}. The
Hasse diagram for (ρ(A), ⊆) is shown in fig:
Example: Draw the Hasse diagram for the partial ordering ⊆ on the power set P (S) where S = {a,
b, c}.
Solution: S = {a, b, c}.
P (S) = {ϕ, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.
Example: Draw the Hasse diagram representing the positive divisions of 36 (i.e., D36).
Solution: We have D36 = {1, 2, 3, 4, 6, 9, 12, 18, 36} if and only a divides b. The Hasse diagram
Minimal and Maximal elements(members): Let (P, ≤) denote a partially or-dered set. An
element y ∈ P is called a minimal member of P relative to ≤ if for no x ∈ P , is x < y.
(i). The minimal and maximal members of a partially ordered set need not unique.
(ii). Maximal and minimal elements are easily calculated from the Hasse diagram.
They are the 'top' and 'bottom' elements in the diagram.
Example:
In the Hasse diagram, there are two maximal elements and two minimal elements.
The elements 3, 5 are maximal and the elements 1 and 6 are minimal.
Example: Let A = {a, b, c, d, e} and let the partial
order on A in the natural way.
Upper and Lower Bounds: Let (P, ≤) be a partially ordered set and let A ⊆ P . Any element x ∈ P
is called an upper bound for A if for all a ∈ A, a ≤ x. Similarly, any element x ∈ P is called a
lower bound for A if for all a ∈ A, x ≤ a. Example: A = {1, 2, 3, ..., 6} be ordered as pictured in
figure.
Solution: The upper bounds of {b, d, g} are g and h. Since g < h, g is the least upper bound. The
lower bounds of {b, d, g} are a and b. Since a < b, b is the greatest lower bound.
Example: Let A = {a, b, c, d, e, f, g, h} denote a partially ordered set whose Hasse diagram is
shown in Fig:
Example: Consider the poset A = {1, 2, 3, 4, 5, 6, 7, 8} whose Hasse diagram is shown in Fig and
let B = {3, 4, 5}
Functions
A function is a special case of relation.
Definition: Let X and Y be any two sets. A relation f from X to Y is called a function if for every x
∈ X, there is a unique element y ∈ Y such that (x, y) ∈ f. Note: The definition of function requires
that a relation must satisfies two additional conditions in order to qualify as a function. These
conditions are as follows:
(i) For every x ∈ X must be related to some y ∈ Y , i.e., the domain of f must be X and nor merely
a subset of X.
(ii). Uniqueness, i.e., (x, y) ∈ f and (x, z) ∈ f ⇒ y = z.
The notation f : X → Y , means f is a function from X toY .
Example: Let X = {1, 2, 3}, Y = {p, q, r} and f = {(1, p), (2, q), (3, r)} then f(1) = p, f(2) = q, f(3)
= r. Clearly f is a function from X to Y .
Domain and Range of a Function: If f : X → Y is a function, then X is called the Domain of f and
the set Y is called the codomain of f. The range of f is defined as the set of all images under f.
It is denoted by f(X) = {y| for some x in X, f(x) = y} and is called the image of X in Y . The Range
f is also denoted by Rf .
2
Example: If the function f is defined by f(x)=x + 1 on the set {−2, −1, 0, 1, 2}, find the range of
f.
2
Solution: f(−2) = (−2) + 1 = 5
2
f(−1) = (−1) + 1 = 2
f(0) = 0 + 1 = 1
f(1) = 1 + 1 = 2
f(2) = 4 + 1 = 5
Types of Functions
One-to-one(Injection): A mapping f : X → Y is called one-to-one if distinct elements of X are
mapped into distinct elements of Y , i.e., f is one-to-one if
x1 ≠ x2 ⇒ f(x1) ≠ f(x2)
because both 3 and -3 have 9 as their image, which is against the definition of a one-to-one
function.
⇒ x=y
⇒ 2x + 1 = y
⇒ x = (y-1)/2
Clearly, x = (y-1)/2∈ R
⇒x=y
⇒ Ix is one-to-one
Ix is onto since x = Ix(x) for all x.
Composition of Functions
Let f : X → Y and g : Y → Z be two functions. Then the composition of f and g denoted by g ◦ f, is
the function from X to Z defined as
Note. In the above definition it is assumed that the range of the function f is a subset of Y (the
Domain of g), i.e., Rf ⊆ Dg. g ◦ f is called the left composition g with f.
Example: Let X = {1, 2, 3}, Y = {p, q} and Z = {a, b}. Also let f : X → Y be f = {(1, p), (2, q), (3,
q) } and g : Y → Z be given by g = {(p, b), (q, b)}. Find g ◦ f. Solution: g ◦ f = {(1, b), (2, b), (3, b).
f = {(1, 2), (2, 3), (3, 1)} g = {(1, 2), (2, 1), (3, 3)}
h = {(1, 1), (2, 2), (3, 1)} s = {(1, 1), (2, 2), (3, 3)}
Find f ◦ f; g ◦ f; f ◦ h ◦ g; s ◦ g; g ◦ s; s ◦ s; and f ◦ s.
Solution:
f ◦ g = {(1, 3), (2, 2), (3, 1)}
∴ s◦g=g◦s=g
Thus, s ◦ s = s, f ◦ g ≠g ◦ f, s ◦ g = g ◦ s = g and h ◦ s = s ◦ h = h.
Example: Let f(x) = x + 2, g(x) = x − 2 and h(x) = 3x for x ∈ R, where R is the set of real
numbers. Find g ◦ f; f ◦ g; f ◦ f; g ◦ g; f ◦ h; h ◦ g; h ◦ f; and f ◦ h ◦ g.
f: R → R is defined by g(x) = x − 2
h : R → R is defined by h(x) = 3x
g◦f:R→R
Let x ∈ R. Thus, we can write
(g ◦ f)(x) = g(f(x)) = g(x + 2) = x + 2 − 2 = x
(f ◦ h ◦ g)(x) = [f ◦ (h ◦ g)](x)
f(h ◦ g(x)) = f(3x − 6) = 3x − 6 + 2 = 3x − 4
Inverse Functions
−1
A function f : X → Y is aid to be invertible of its inverse function f is also function from the
range of f into X.
Theorem: A function f : X → Y is invertible ⇔ f is one-to-one and onto.
Example: Let X = {a, b, c, d} and Y = {(1, 2, 3, 4} and let f : X → Y be given by f = {(a, 1), (b, 2), (c,
−1
2), (d, 3)}. Is f a function?
−1
Solution: f = {(1, a), (2, b), (2, c), (3, d)}. Here, 2 has two distinct images b and c.
Solution: The inverse of the given function is defined as f−1 = {(x2, x)| x ∈ R}.
Therefore, it is not a function.
Theorem: If f : X → Y and g : Y → X be such that g ◦ f = Ix and f ◦ g = Iy, then f and g are both
−1 −1
invertible. Furthermore, f = g and g = f.
Example: Let X = {1, 2, 3, 4} and f and g be functions from X to X given by f = {(1, 4), (2, 1), (3,
2) , (4, 3)} and g = {(1, 2), (2, 3), (3, 4), (4, 1)}. Prove that f and g are inverses of each other.
Solution: We check that
Example: Show that the functions f(x) = x and g(x) = x for x ∈ R are inverses of one another.
3 1/3
3 1/3
Solution: f : R → R is defined by f(x) = x ; f: R → R is defined by g(x) = x
1/3 3(1/3)
(f ◦ g)(x) = f(g(x)) = f(x )=x = x = Ix(x)
i.e., (f ◦ g)(x) = Ix(x)
3 3(1/3)
and (g ◦ f)(x) = g(f(x)) = g(x ) = x = x = Ix(x)
i.e., (g ◦ f)(x) = Ix(x)
−1 −1
Thus, f = g or g = f
⇒ ax1 + b = ax2 + b
⇒ ax1 = ax2
⇒ x1 = x2
∴ f is one-to-one.
To show that f is onto.
Let y ∈ R(codomain) such that y = f(x) for some x ∈ R.
⇒ y = ax + b
⇒ ax = y − b
⇒ x = (y-b)/a
∴ f is onto
−1
⇒ f is invertible and f (x)= (x-b)/a
3 −1
Example: Let f : R → R be given by f(x) = x − 2. Find f .
⇒ x 1−2=x 2−
3 3
2⇒ x 1=x 2
3 3
⇒ x1 = x2
∴ f is one-to-one.
To show that f is onto.
⇒ y=x −2
3
⇒ x = y+2
3
⇒ x= 3 y 2
Recursive Function
n n
Total function: Any function f : N → N is called total if it is defined for every n-tuple in N .
Example: f(x, y) = x + y, which is defined for all x, y ∈ N and hence it is a total function.
2 3 3 3
U 1 (x, y) = x, U 1(2, 6, 9) = 2, U (2,
2 6, 9) = 6, U (2,
3 6, 9) = 9.
In general, let f1, f2, ..., fn each be partial function of m variables and g be a partial function of n
variables. Then the composition of g with f1, f2, ..., fn produces a partial function h given by
h(x1, x2, ..., xm) = g(f1(x1, x2, ..., xm), ..., fn(x1, x2, ...xm)).
Note: The function h is total iff f1, f2, ..., fn and g are total.
2
Example: Let f1(x, y) = x + y, f2(x, y) = xy + y and g(x, y) = xy. Then
Recursion: The following operation which defines a function f(x1, x2, ..., xn, y) of n + 1 variables
by using other functions g(x1, x2, .., xn) and h(x1, x2, ..., xn, y, z) of n and n + 2 variables,
respectively, is called recursion.
f(x1, x2, ..., xn, y + 1) = h(x1, x2, ..., xn, y, f(x1, x2, ..., xn, y))
where y is the inductive variable.
Primitive Recursive: A function f is said to be Primitive recursive iff it can be obtained from the
initial functions by a finite number of operations of composition and recursion.
***Example: Show that the function f(x, y) = x + y is primitive recursive. Hence compute the
value of f(2, 4).
f(x, y + 1) = x + (y + 1)
= (x + y) + 1
= f(x, y) + 1.
Also, f(x, 0) = x. We
define f(x, 0) as
1
f(x, 0) = x = U 1(x)
= S(f(x, y))
3
=S(U 3(x, y, f(x, y)))
1 3
If we take g(x) = U1 (x) and h(x, y, z) = S(U3 (x, y, z)), we get f(x, 0) = g(x) and f(x, y + 1) =
h(x, y, z).
1 3
Thus, f is obtained from the initial functions U1 , U3 , and S by applying composition once and
recursion once.
Hence f is primitive recursive.
Here,
f(2, 0) = 2
=S(S(f(2, 2)))
=S(S(S(f(2, 1))))
=S(S(S(S(f(2, 0)))))
=S(S(S(S(2)))))
=S(S(S(3)))
=S(S(4))
=S(5)
=6
Example: Show that f(x, y) = x ∗ y is primitive recursion.
Solution: Given that f(x, y) = x ∗ y.
f(x, y + 1) = x f(x, y) + x
∗ (y + 1) = x
∗y
f(x, 0) = 0 =Z(x) and
3 3
f(x, y + 1) =f1(U3 (x, y, f(x, y)), U1 (x, y, f(x, y)))
where f1(x, y) = x + y, which is primitive recursive. By taking g(x) = Z(x) = 0 and h defined by h(x,
3 3
y, z) = f1(U3 (x, y, z), U1 (x, y, z)) = f(x, y + 1), we see that f defined by recursion. Since g and h
y
are primitive recursive, f is primitive recursive. Example: Show that f(x, y) = x is primitive
0 0
recursive function. Solution: Note that x = 1 for x ≠ 0 and we put x = 0 for x = 0.
=x ∗x
y+1 y
Also, x
y
Here f(x, y) = x is defined as
f(x, y + 1) = x ∗ f(x, y)
h(x, y, f(x, y) = f1(U1 (x, y, f(x, y)), U3 (x, y, f(x, y))) where f1(x, y) = x ∗ y, which is
3 3
primitive recursive.
Example: Consider the following recursive function definition: If x < y then f(x, y) = 0, if y ≤ x
then f(x, y) = f(x − y, y) + 1. Find the value of f(4, 7), f(19, 6).
0;x < y
Solution: Given f(x, y)
={ f(x -y,y)+ 1 ; yx
f(4, 7) = 0 [∴ 4 < 7]
f(19, 6) = f(19 − 6, 6) + 1
= f(13, 6) + 1
f(13, 6) = f(13 − 6, 6) + 1
= f(7, 6) + 1
f(7, 6) = f(7 − 6, 6) + 1
= f(1, 6) + 1
=0 + 1
=1
f(13, 6) = f(7, 6) + 1
=1 + 1
=2
f(19, 6) = 2 + 1
=3
Example: Consider the following recursive function definition: If x < y then f(x, y) = 0, if y ≤ x
then f(x, y) = f(x − y, y) + 1. Find the value of f(86, 17)
Permutation Functions
Definition: A permutation is a one-one mapping of a non-empty set onto itself.
Let S = {a1, a2, ..., an} be a finite set and p is a permutation on S, we list the elements of S and
the corresponding functional values of p(a1), p(a2), ..., p(an) in the following form:
a1 a2 ... an
p(a ) . . .
p(a )
p(a )
1 2 n
If p : S → S is a bijection, then the number of elements in the given set is called the degree of its
permutation.
Note: For a set with three elements, we have 3! permutations.
1 2 3 4
f=
2 1 4 3
Identity Permutation: If each element of a permutation be replaced by itself, then such
a permutation is called the identity permutation.
a1 a2 ... an
...
Example: Let S = {a1, a2, , an}.then I= a is the identity permutation on S.
a a
1 2 n
Equality of Permutations: Two permutations f and g of degree n are said to be equal if and only
if f(a) = g(a) for all a ∈ S.
1 2 3 4 4 1 3 2
f= ;g=
3 1 2 4 4 3 2 1
We have f(1) = g(1) = 3
f(2) = g(2) = 1
f(3) = g(3) = 2
f(4) = g(4) = 4
f (g(a)) f (g(h))
Clearly, f ◦ g is a permutation.
1 2 3 4 1 2 3 4
Example: Let S = {1, 2, 3, 4} and let f = and g = Find f ◦ g and g ◦
2 1 4 3 4 1 2 3
f in the permutation from.
1 2 3 4 1 2 3 4
Solution: f ◦ g = ;g ◦ f =
3 2 4 1
1 3 4 2
Note: The product of two permutations of degree n need not be commutative.
Inverse of a Permutation:
a1 a2 ... an
If f is a permutation on S = {a1, a2, , an} such that f
b b .... b
1 2 n
−1 −1 −1
then there exists a permutation called the inverse f, denoted f such that f ◦ f =f ◦f=
1 b1 b2 ... bn
where f a2 ...
a1 a n
1 −1
Example: If f = 2 3 4 −1 , and show that f =f
◦f = I
2 , then find f −1
4 3 1 ◦f
−1 2 4 3 1 1 2 3 4
Solution: f = =
1 2 3 4 4 1 3 2
−1 1 2 3 4 1 2 3 4 1 2 3 4
f ◦f =
2 4 3 1 o4 1 3 2 =
2 3 4
1
−1 −1 −1
Similarly, f ◦ f = I.⇒ f ◦ f =f ◦ f = I.
Cyclic Permutation: Let S = {a1, a2, ..., an} be a finite set of n symbols. A permutation f defined
on S is said to be cyclic permutation if f is defined such that
1 2 3 4
Then =(1 4)(2 3) is a cyclic permutation.
4 3 2 1
Disjoint Cyclic Permutations: Let S = {a1, a2, ..., an}. If f and g are two cycles on S such that
they have no common elements, then f and g are said to be disjoint cycles.
The above permutation f can be written as f = (1 2 3 4 5)(6 7). Which is a product of two disjoint
cycles.
transpositions.
1 2 3 4 5
Example: f =
2 4 5 1 =(1 2 4)(3 5) = (1 4)(1 2)(3 5).
3
Inverse of a Cyclic Permutation: To find the inverse of any cyclic permutation, we write its
elements in the reverse order.
−1
For example, (1 2 3 4) = (4 3 2 1).
Even and Odd Permutations: A permutation f is said to be an even permutation if f can be
expressed as the product of even number of transpositions.
Example: Determine whether the following permutations are even or odd permutations.
1 2 3 4 5
(i) f=
2 4 3 1 5
1 2 3 4 5 6 7 8
(ii) g =
2 5 7 8 6 1 4 3
1 2 3 4 5
(iii) h=
4 3 1 2 5
1 2 3 4 5
Solution: (i). For f = = (1 2 4) = (1 4)(1 2)
2 4 3 1 5
⇒ f is an even permutation
1
2 3 4 5 6 7 8
(ii). For g =
5 7 8 6 1 4 3
2
= (1 2 5 6)(3 7 4 8) = (1 6)(1 5)(1 2)(3 8)(3 4)(3 7)
⇒ g is an even permutation.
1 5
(iii) h= 2 3 4
4 3 1 2 = (1 4 2 3) = (1 3)(1 2)(1 4)
5
⇒ h is an odd permutation.
Lattices
In this section, we introduce lattices which have important applications in the theory and design
of computers.
Definition: A lattice is a partially ordered set (L, ≤) in which every pair of elements a, b ∈ L has
a greatest lower bound and a least upper bound.
+
Example: Let Z denote the set of all positive integers and let R denote the relation ‘division‘ in
Z , such that for any two elements a, b ∈ Z , aRb, if a divides b. Then (Z , R) is a lattice in
+ + +
which the join of a and b is the least common multiple of a and b, i.e.
a ∨ b = a ⊕ b = LCM of a and b,
and the meet of a and b, i.e. a ∗ b is the greatest common divisor (GCD) of a and b i.e.,
a ∧ b = a ∗ b = GCD of a and b.
We can also write a+b = a∨b = a⊕b=LCM of a and b and a.b = a∧b = a∗b=GCD of a and b.
Example: Let n be a positive integer and Sn be the set of all divisors of n If n = 30, S30 = {1, 2,
3, 5, 6, 10, 15, 30}. Let R denote the relation division as defined in Example 1. Then (S30, R) is
a Lattice see Fig:
Example: Let A be any set and P (A) be its power set. The poset P (A), ⊆) is a lattice in which the
meet and join are the same as the operations ∩ and ∪ on sets respectively.
S = {a}, P (A) = {ϕ, {a}}
The above properties (L1) to (L4) can be proved easily by using definitions of meet and
′ ′
join. We can apply the principle of duality and obtain (L1) to (L4) .
Theorem: Let (L, ≤) be a lattice in which ∗ and ⊕ denote the operations of meet and join
respectively. For any a, ∈ L, a ≤ b ⇔ a ∗ b = a ⇔ a ⊕ b = b.
Hence a ≤ b ⇒ a ∗ b = a.
but b ⊕ (a ∗ b) = b
(a ∗ b) ∗ (a ∗ c) = a ∗ (b ∗ a) ∗ c
= a ∗ (a ∗ b) ∗ c
= (a ∗ a) ∗ (b ∗ c)
= a ∗ (b ∗ c)
=a∗b
Consider,(a ⊕ b) ⊕ (a ⊕ c) = a ⊕ (b ⊕ a) ⊕ c
= a ⊕ (a ⊕ b) ⊕ c
= (a ⊕ a) ⊕ (b ⊕ c)
= a ⊕ (b ⊕ c)
=a⊕ b
∴ If b ≤ c then a ⊕ b ≤ a ⊕ c.
Viewing lattices as partially ordered sets, this says that the meet peration preserves nonempty
finite joins. It is a basic fact of lattice theory that the above condition is equivalent to its dual
x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z) for all x, y, and z in L.
Example: Show that the following simple but significant lattices are not distributive.
Solution a) To see that the diamond lattice is not distributive, use the middle elements of the
lattice: a ∧ (b ∨ c) = a ∧ 1 = a, but (a ∧ b) ∨ (a ∧ c) = 0 ∨ 0 = 0, and a ≠0.
Similarly, the other distributive law fails for these three elements.
b) The pentagon lattice is also not distributive
Sol. A lattice is distributive if all of its elements follow distributive property so let we verify the
distributive property between the elements n, l and m.
GLB(n, LUB(l, m)) = GLB(n, p) [∴ LUB(l, m) = p]
= n (LHS)
also LUB(GLB(n, l), GLB(n, m)) = LUB(o, n); [∴ GLB(n, l) = o and GLB(n, m) = n]
= n (RHS)
so LHS = RHS.
But GLB(m, LUB(l, n)) = GLB(m, p) [∴ LUB(l, n) = p]
= m (LHS)
also LUB(GLB(m, l), GLB(m, n)) = LUB(o, n); [∴ GLB(m, l) = o and GLB(m, n) = n]
= n (RHS)
Thus, LHS ≠ RHS hence distributive property doesn‘t hold by the lattice so lattice is not
distributive.
Example: Consider the poset (X, ≤ ) where X = {1, 2, 3, 5, 30} and the partial ordered relation ≤
is defined as i.e. if x and y ∈X then x ≤ y means ‗x divides y‘. Then show that poset (I+, ≤) is a
lattice.
Sol. Since GLB(x, y) = x ∧ y = lcm(x, y)
and LUB(x, y) = x ∨ y = gcd(x, y)
Now we can construct the operation table I and table II for GLB and LUB respectively and the
Hasse diagram is shown in Fig.
Complemented lattice:
A complemented lattice is a bounded lattice (with least element 0 and greatest element 1), in
which every element a has a complement, i.e. an element b satisfying a ∨ b = 1 and a ∧ b = 0.
Complements need not be unique.
Example: Lattices shown in Fig (a), (b) and (c) are complemented lattices.
Sol.
For the lattice (a) GLB(a, b) = 0 and LUB(x, y) = 1. So, the complement a is b and vise versa.
Hence, a complement lattice.
For the lattice (b) GLB(a, b) = 0 and GLB(c, b) = 0 and LUB(a, b) = 1 and LUB(c, b) = 1; so
both a and c are complement of b.
Hence, a complement lattice.
In the lattice (c) GLB(a, c) = 0 and LUB(a, c) = 1; GLB(a, b) = 0 and LUB(a, b) = 1. So,
complement of a are b and c.
Similarly complement of c are a and b also a and c are complement of b.
Hence lattice is a complement lattice.
Algebraic Structures
Algebraic Systems with One Binary Operation
Binary Operation
Let S be a non-empty set. If f : S × S → S is a mapping, then f is called a binary
operation or binary composition in S.
The symbols +, ·, ∗, ⊕ etc are used to denote binary operations on a set.
For a, b ∈ S ⇒ a + b ∈ S ⇒ + is a binary operation in S.
For a, b ∈ S ⇒ a · b ∈ S ⇒ · is a binary operation in S.
For a, b ∈ S ⇒ a ◦ b ∈ S ⇒ ◦ is a binary operation in S.
For a, b ∈ S ⇒ a ∗ b ∈ S ⇒ ∗ is a binary operation in S.
This is said to be the closure property of the binary operation and the set S is said to be
closed with respect to the binary operation.
Properties of Binary Operations
a + (b + c) = (a + b) + c and a · (b · c) = (a · b) · c.
a + (b + c) = (a + b) + c and a · (b · c) = (a · b) · c.
(b + c) = a · b + a · c and (b + c) · a = b · a + c · a.
⇒ a ◦ b ≠ b ◦ a.
∴ ◦ is not commutative in S.
Since (a ◦ b) ◦ c = a ◦ c = a
a ◦ (b ◦ c) = a ◦ b = a for a, b, c ∈ S.
∴ ◦ is associative in S.
Example: ◦ is operation defined on Z such that a ◦ b = a + b − ab for a, b ∈ Z. Is the operation ◦ a
binary operation in Z? If so, is it associative and commutative in Z?
Solution: If a, b ∈ Z, we have a + b ∈ Z, ab ∈ Z and a + b − ab ∈ Z.
⇒ a ◦ b = a + b − ab ∈ Z.
∴ ◦ is a binary operation in Z.
⇒ a ◦ b = b ◦ a.
∴ ◦ is commutative in Z.
Now
(a ◦ b) ◦ c = (a ◦ b) + c − (a ◦ b)c
= a + b − ab + c − (a + b − ab)c
and
=a + b − ab + c − ac − bc + abc
a ◦ (b ◦ c) = a + (b ◦ c) − a(b ◦ c)
=a + b + c − bc − a(b + c − bc)
=a + b + c − bc − ab − ac + abc
=a + b − ab + c − ac − bc + abc
⇒ (a ◦ b) ◦ c = a ◦ (b ◦ c). ∴
◦ is associative in Z.
′ ′
Example: Fill in blanks in the following composition table so that ◦ is associative in S = {a,b,c,d}.
◦ a b c d
a a b c d
b b a c d
c c d c d
d
Solution: d ◦ a = (c ◦ b) ◦ a[∵ c ◦ b = d]
=c ◦ (b ◦ a) [∵ ◦ is associative]
=c ◦ b
=d
d ◦ b = (c ◦ b) ◦ b = c ◦ (b ◦ b) = c ◦ a = c. d
◦ c = (c ◦ b) ◦ c = c ◦ (b ◦ c) = c ◦ c = c.
d ◦ d = (c ◦ b) ◦ (c ◦ b)
=c ◦ (b ◦ c) ◦ b
=c ◦ c ◦ b
=c ◦ (c ◦ b)
=c ◦ d
=d
◦ a b c d
a a b c d
b b a c d
c c d c d
d d c c d
Example: Let P (S) be the power set of a non-empty set S. Let ∩ be an operation in P (S). Prove
that associative law and commutative law are true for the operation in P (S).
Since A ⊆ S, B ⊆ S ⇒ A ∩ B ⊆ S ⇒ A ∩ B ∈ P(S).
∴ ∩ is commutative in P (S).
Again A ∩ B, B ∩ C, (A ∩ B) ∩ C and A ∩ (B ∩ C) are subsets of S.
∴ (A ∩ B) ∩ C, A ∩ (B ∩ C) ∈ P (S).
Since (A ∩ B) ∩ C = A ∩ (B ∩ C)
∴ ∩ is associative in P (S).
Algebraic Structures
Definition: A non-empty set G equipped with one or more binary operations is called an
algebraic structure or an algebraic system.
Example: The operation ◦ is defined by a ◦ b = a for all a, b ∈ S. Show that (S, ◦) is a semi group.
Solution: Let a, b ∈ S ⇒ a ◦ b = a ∈ S.
(a ◦ b) ◦ c = a ◦ c = a.
⇒ ◦ is associative in S.
Solution: Let a, b ∈ Z ⇒ a ◦ b = a + b − ab ∈ Z.
∴ ◦ is a binary operation in Z.
Let a, b, c ∈ Z.
(a ◦ b) ◦ c = (a + b − ab) ◦ c
=a + b − ab + c − (a + b − ab)c
=a + b + c − ab − bc − ac + abc
a ◦ (b ◦ c) = a ◦ (b + c − bc)
abc ⇒ (a ◦ b) ◦ c = a ◦ (b ◦ c).
=a + (b + c − bc) − a(b + c − bc)
=a + b + c − bc − ab − ac +
Example: (P (S), ∩) is a semi group, where P (S) is the power set of a non-empty set S.
Solution: P (S)= Set of all possible subsets of S.
Let A, B ∈ P (S).
Since A ⊆ S, B ⊆ S ⇒ A ∩ B ⊆ S ⇒ A ∩ B ∈ P (S).
∴ (A ∩ B) ∩ C, A ∩ (B ∩ C) ∈ P (S). Since (A ∩ B) ∩ C
= A ∩ (B ∩ C)
∴ ∩ is associative in P (S).
Hence (P (S), ∩) is a semi group.
Example: (P (S), ∪) is a semi group, where P (S) is the power set of a non-empty set S.
Solution: P (S)= Set of all possible subsets of S.
Let A, B ∈ P (S).
Since A ⊆ S, B ⊆ S ⇒ A ∪ B ⊆ S ⇒ A ∪ B ∈ P (S).
∴ ∪ is a binary operation in P (S). Let A, B, C ∈ P (S).
∴ (A ∪ B) ∪ C, A ∪ (B ∪ C) ∈ P (S). Since (A ∪ B) ∪ C = A ∪ (B ∪ C)
∴ ∪ is associative in P (S).
Hence (P (S), ∪) is a semi group.
Example: Q is the set of rational numbers, ◦ is a binary operation defined on Q such that a ◦ b = a
− b + ab for a, b ∈ Q. Then (Q, ◦) is not a semi group.
Solution: For a, b, c ∈ Q,
(a ◦ b) ◦ c = (a ◦ b) − c + (a ◦ b)c
=a − b + ab − c + (a − b + ab)c
=a − b + ab − c + ac − bc + abc a
◦ (b ◦ c) = a − (b ◦ c) + a(b ◦ c)
Therefore, (a ◦ b) ◦ c ≠ a ◦ (b ◦ c).
(a ∗ b) ∗ c = a ∗ (b ∗ c) [∵ A is seme group]
=a ∗ (c ∗ b) [∵ b ∗ c = c ∗ b]
=(c ∗ a) ∗ b [∵ a ∗ c = c ∗ a]
=c ∗ (a ∗ b) [∵ A is seme group].
Homomorphism of Semi-Groups
Definition: Let (S, ∗) and (T, ◦) be any two semi-groups. A mapping f : S → T such that for any
two elements a, b ∈ S, f(a ∗ b) = f(a) ◦ f(b) is called a semi-group homomorphism.
Solution: Given that (S1, ∗1), (S2, ∗2) and (S3, ∗3) are three semigroups and f : S1 →
S2 and g : S2 → S3 be homomorphisms.
Let a, b be two elements of S1.
∴ g ◦ f is a homomorphism.
Identity Element: Let S be a non-empty set and ◦ be a binary operation on S. If there exists an
element e ∈ S such that a ◦ e = e ◦ a = a, for a ∈ S, then e is called an identity element of S.
Example:
(i) In the algebraic system (Z, +), the number 0 is an identity element.
(ii) In the algebraic system (R, ·), the number 1 is an identity element.
Note: The identity element of an algebraic system is unique.
Monoid
Definition: A semi group (S, ◦) with an identity element with respect to the binary operation ◦
is known as a monoid. i.e., (S, ◦) is a monoid if S is a non-empty set and ◦ is a binary
operation in S such that ◦ is associative and there exists an identity element w.r.t ◦.
Example:
1. (Z, +) is a monoid and the identity is 0.
2. (Z, ·) is a monid and the identity is 1.
Monoid Homomorphism
Definition: Let (M, ∗) and (T, ◦) be any two monoids, em and et denote the identity
elements of (M, ∗) and (T, ◦) respectively. A mapping f : M → T such that for any two
elements a, b ∈ M,
f(em) = et
is called a monoid homomorphism.
Sub Monoid
Let (S,∗) be a monoid with e is the identity element and T be a non-empty subset of S.
Then (T, ∗) is the sub monoid of (S, ∗) if e ∈ T and a ∗ b ∈ T , whenever a, b ∈ T . Example:
1. Under the usual addition, the semi group formed by positive integers is a sub semi group of
all integers.
2. Under the usual addition, the set of all rational numbers forms a monoid. We denote it (Q,
+). The monoid (Z, +) is a submonid of (Q, +).
3. Under the usual multiplication, the set E of all even integers forms a semi group.
This semi group is sub semi group of (Z, ·). But it is not a submonoid of (Z, ·), because 1≠ E.
Since S1 and S2 are submonoids, these are monoids. Therefore e ∈ S1 and e ∈ S2.
87
Since S1 ∩S2 is a subset of S, the associative law holds in S1 ∩S2, because it holds in S.
Accordingly S1 ∩ S2 forms a monoid with e as the identity.
Invertible Element: Let (S,◦) be an algebraic structure with the identity element e in S w.r.t
1 1 ω ω2
2
ω ω ω 1
ω2 ω2 1 ω
From the table we conclude that
1. Closure Property: Since all entries in the table are elements of A. So, closure property is
satisfied.
st nd rd st nd rd
2. Commutative Law: Since 1 , 2 and 3 rows coincides with 1 , 2 and 3 columns
respectively. So multiplication is commutative on A.
3. Identity Element: Since row headed by 1 is same as the initial row, so 1 is the identity
element.
−1 −1 2 2 −1
4. Inverses: Clearly 1 = 1, ω = ω , (ω ) = ω.
Groups
Definition: If G is a non-empty set and ◦ is a binary operation defined on G such that the
following three laws are satisfied then (G, ◦) is a group.
Associative Law: For a, b, c ∈ G, (a ◦ b) ◦ c = a ◦ (b ◦ c)
Inverse Law: For each a ∈ G, there exists an element b ∈ G such that a◦b = b◦a = e, b is called
an inverse of a.
88
(ii). For a, b, c ∈ Z, (a + b) + c = a + (b + c)
(iii). 0 ∈ Z such that 0 + a = a + 0 = a for each a ∈ G
89
2
· 1 ω ω
2
1 1 ω ω
2 3
ω ω ω ω =1
2 2 3 4
ω ω ω =1 ω =ω
3
The algebraic system is (G, ·) where ω = 1 and multiplication · is the binary opera-tion on G.
From the composition table; it is clear that (G, ·) is closed with respect to the oper-ation
multiplication and the operation · is associative.
1 is the identity element in G such that 1 · a = a = a · 1, ∀ a ∈ G.
90
Example: Show that the set G = {1, −1, i, −i} where i = 1 is an abelian group with respect
· 1 −1 i −i
1 1 −1 i −i
-1 −1 1 −i i
i i −i −1 1
−i −i i 1 -1
From the above composition, it is clear that the algebraic structure (G, ·) is closed and
satisfies the following axioms:
Associativity: For any three elements a, b, c ∈ G, (a · b) · c = a · (b · c).
Since
1 · (−1 · i) = 1 · −i = −i
(1 · −1) · i = −1 · i = −i
⇒ 1 · (−1 · i) = (1 · −1) · i
Similarly with any other three elements of G the properties holds.
∴ Associative law holds in (G, ·).
Existence of identity: 1 is the identity element in (G, ·) such that 1 · a = a = a · 1, ∀ a ∈ G.
Existence of inverse: 1 · 1 = 1 = 1 · 1 ⇒ 1 is inverse of 1.
(−1) · (−1) = 1 = (−1) · (−1) ⇒ −1 is the inverse of (−1)
1 · 1 = 1 = 1 · 1; − 1 · 1 = −1 = 1 · −1
i · 1 = i = 1 · i; i · −i = −i · i = 1 etc.
∴ Z is closed under ∗.
Associativity: Let a, b, c ∈ Z.
Consider (a ∗ b) ∗ c = (a + b + 1) ∗ c
=a + b + 1 + c + 1
=a + b + c + 2
also
92
a ∗ (b ∗ c) = a ∗ (b + c + 1)
=a + b + c + 1 + 1
=a + b + c + 2
Hence (a ∗ b) ∗ c = a ∗ (b ∗ c) for a, b, c ∈ Z.
=a
⇒ e = −1
⇒ a + b + 1 = −1
b = −2 − a
∴ For every a ∈ Z, there exits −2−a ∈ Z such that a∗(−2−a) = (−2−a)∗a = −1.
Associativity: a, b, c ∈ Q+ ⇒ (a ◦ b) ◦ c = a ◦ (b ◦ c).
i.e., ea/3 = a
⇒ ea − 3a = 0 ⇒ (e − 3)a = 0
⇒e − 3 = 0 (∵ a ≠ 0)
⇒ e=3
⇒ab/3 = 3
b = 9/a (∵ a ≠ 0)
93
∴ For every a ∈ Q+, there exists 9/a ∈ Q+ such that a ◦ 9/a = 9/a ◦ a = 3.
Commutativity: Let a, b ∈ Q+ ⇒ a ◦ b = b ◦ a.
Since a ◦ b = ab/3=ba/3 = b ◦ a.
(Q+, ◦) is an abelian group.
Exercises: 1. Prove that the set G of rational numbers other than 1 with operation ⊕ such that
a ⊕ b = a + b − ab for a, b ∈ G is abelian group.
94
2. Consider the algebraic system (G, ∗), where G is the set of all non-zero real numbers and ∗
is a binary operation defined by: a ∗ b = 4 , ∀a, b ∈ G. Show that (G, ∗) is an
ab
Addition modulo m
We shall now define a composite known as ―addition modulo m‖ where m is fixed integer.
If a and b are any two integers, and r is the least non-negative reminder obtained by dividing
the ordinary sum of a and b by m, then the addition modulo m of a and b is r symbolically
a +m b = r, 0 ≤ r < m.
Example: Show that the set G = {0, 1, 2, 3, 4} is an abelian group with respect to addition
modulo 5.
Solution: We form the composition table as follows:
+5 0 1 2 3 4
0 0 1 2 3 4
1 1 2 3 4 0
2 2 3 4 0 1
3 3 4 0 1 2
4 4 0 1 2 3
Since all the entries in the composition table are elements of G, the set G is closed with
respect to addition modulo 5.
Associativity: For any three elements a, b, c ∈ G, (a +5 b) +5 c and a +5 (b +5 c) leave the
same remainder when divided by 5.
i.e., (a +5 b) +5 c = a +5 (b +5 c)
(1 +5 3) +5 4 = 3 = 1 +5 (3 +5 4) etc.
95
96
Example: Show that the set G= {1, 2, 3, 4} is an abelian with respect to multipli-cation
modulo 5.
Solution: The composition table for multiplication modulo 5 is
×
5 1 2 3 4
1 1 2 3 4
2 2 4 1 3
3 3 1 4 2
4 4 3 2 1
From the above table, it is clear that G is closed with respect to the operation ×5 and the
binary composition ×5 is associative; 1 is the identity element.
Each element in G has a inverse.
1 is its own inverse
2 is the inverse of 3
3 is the inverse of 2
4 is the inverse of 4, with respect to the binary operation ×5.
Commutative law holds good in (G, ×5).
Therefore (G, ×5) is an abelian group.
Example: Consider the group, G = {1, 5, 7, 11, 13, 17} under multiplication modulo 18.
−1 −1 −1
Construct the multiplication table of G and find the values of: 5 , 7 and 17 .
Example: If G is the set of even integers, i.e., G = {· · · , −4, −2, 0, 2, 4, · · · } then prove that
Since a + b = 2x + 2y = 2(x + y) ∈ G.
Associativity: a, b, c ∈ G ⇒ a + (b + c) = (a + b) + c
Since
a + (b + c) = 2x + (2y + 2z)
=2[x + (y + z)]
=2[(x + y) + z]
=(2x + 2y) + 2z
=(a + b) + c
∴ 0 is the identity in G.
97
∴ (G, +) is a group.
Commutativity: a, b ∈ G ⇒ a + b = b + a.
98
Closure: x, y ∈ G ⇒ x · y ∈ G.
∈ G. Associativity: x, y, z ∈ G ⇒ (x · y) · z = x · (y · z)
p q r s p+r q+s
Since x · y = (2 3 )(2 3 ) = 2 3
p q r s l m
Since (x · y) · z = (2 3 2 3 )(2 3 )
=2(p+r)+l3(q+s)+m
=2p+(r+l)3q+(s+m)
p q r s l m
=(2 3 )(2 3 2 3 )
=x · (y · z)
= 2 3 = x and e · x = 2 3 2 3 = 2 3 = x. ∴ e ∈ G such
p q 0 0 p+0 q+0 p q 0 0 p q p q
∴x·e=2 3 2 3 =2 3
that x · e = e · x = x
0 0
∴ e = 2 3 is the identity element in G.
Existence of Inverse: Let x ∈ G.
−p −q
Now y = 2 3 ∈ G exists, since −p, −q ∈ Z such that
p q −p −q 0 0 −p −q p q 0 0
x·y=2 3 2 3 = 2 3 = e and y · x = 2 3 2 3 = 2 3 = e.
−p −q
∴ For every x = 2 3 ∈ G there exists y = 2 3 ∈ G such that x ·y = y ·x = e. ∴ (G, ·) is a
p q
group.
Example: Show that the sets of all ordered pairs (a, b) of real numbers for which a ≠ 0 w.r.t
the operation ∗ defined by (a, b) ∗ (c, d) = (ac, bc + d) is a group. Is the commutative?
Solution: Let G = {(a, b)| a, b ∈ R and a ≠ 0}. Define a binary operation ∗ on G by (a, b) ∗ (c,
d) = (ac, bc + d), for all (a, b), (c, d) ∈ G. Now we show that (G, ∗) is a group.
Closure: (a, b), (c, d) ∈ G ⇒ (a, b) ∗ (c, d) = (ac, bc + d) ∈ G.
Since a ≠ 0, c ≠ 0 ⇒ ac ≠ 0.
99
Associativity: (a, b), (c, d), (e, f) ∈ G ⇒ {(a, b) ∗ (c, d)} ∗ (e, f) = (a, b) ∗ {(c, d) ∗(e, f)}. Since
{(a, b) ∗ (c, d)} ∗ (e, f) = (ac, bc + d) ∗ (e, f)
= (a(ce), b(ce) + de + f)
= (ace, bce + de + f)
Existence of Identity: Let (a, b)∈G. Let (x, y)∈ G such that (x, y)∗(a, b)=(a,b)∗(x, y)=(a, b)
⇒ (xa, ya + b) = (a, b)
100
⇒ xa = a, ya + b = b
⇒ x = 1, (∵ a ≠ 0) and ya = 0 ⇒ x = 1 and y = 0 (∵ a ≠ 0)
⇒ (xa, ya + b) = (1, 0)
− b
⇒ xa = 1, ya + b = 0 ⇒ x = a , y = a
1
Consider
−1 −1 −1 −1
(a ∗ b) ∗ (b ∗ a ) = a ∗ [b ∗ (b ∗ a )] (by associativity law)
−1 −1
=a ∗ [(b ∗ b ) ∗ a ]
−1 −1
= a ∗ (e ∗ a ) (b ∗ b = e)
−1
= a∗ a (e is the identity)
=e
and
−1 −1 −1 −1
(b ∗ a ) ∗ (a ∗ b) = b ∗ [a ∗ (a ∗ b)]
−1 −1
=b ∗ [(a ∗ a) ∗ b]
101
−1
=b ∗ [e ∗ b]
−1
=b ∗b
=e
−1 −1 −1 −1
⇒ (a ∗ b) ∗ (b ∗ a ) = (b ∗ a ) ∗ (a ∗ b) = e
−1 −1 −1
(a ∗ b) =b ∗a for all a, b ∈ G.
Note:
−1 −1 −1
1. (b a ) = ab
−1 −1 −1 −1
2. (abc) =c b a
102
Consider
a∗b=a∗c
−1 −1
⇒a ∗ (a ∗ b) = a (a ∗ c)
−1 −1
⇒ (a ∗ a) ∗ b = (a ∗ a) ∗ c (by associative law)
−1
⇒ e ∗ b = e ∗ c (a is the inverse of a in G)
⇒ b = c (e is the identity element in G)
and
b∗a=c∗a
−1 −1
⇒ (b ∗ a)a = (c ∗ a) ∗ a
−1 −1
⇒ b ∗ (a ∗ a ) = c ∗ (a ∗ a ) (by associative law)
−1
⇒ b ∗ e = c ∗ e (∵ a ∗ a = e)
Example: If every element of a group G is its own inverse, show that G is an abelian group.
−1 −1
Solution: Let a, b ∈ G. By hypothesis a = a, b = b.
−1
Then ab ∈ G and hence (ab) = ab.
Now
103
−1
(ab) = ab
−1 −1
⇒b a = ab
⇒ ba = ab
∴ G is an abelian group.
104
−1 −1 −1
⇒ (aa)a = aa ⇒ a(aa ) = e
−1
⇒ ae = e [∵ aa = e] ⇒ a = e [∵ ae = a]
2 2 2
∴ a(ab)b = (aa)(bb) = a b = ab = (ab) = (ab)(ab) = a(ba)b
∴ G is abelian.
Example: Show that in a group G, for a, b ∈ G, (ab) = a b ⇔ G is abelian. (May. 2012)
2 2 2
Then
2 2 2
(ab) = a b
⇒ (ab)(ab) = (aa)(bb)
−1 −1
⇒ (a a)b = a (ba)
−1
⇒ eb = (a b)a
105
−1
⇒ b = (a b)a
−1 −1 −1
⇒ ba = [(a b)a]a
−1 −1
=(a b)(aa )
−1
=(a b)e
−1
=a b
106
−1
⇒a and b commute.
−1 −1
1 ab = ba ⇒ (ab)b = (ba)b
−1
⇒ a(bb ) =
−1
(ba)b ⇒
−1
ae = b(ab )
−1
⇒ a = b(ab )
−1 −1 −1
⇒ b a = b [b(ab )]
−1 −1
=(b b)(ab )]
−1
=e(ab )
−1
=ab
−1
⇒b and a commute.
−1 −1 −1 −1 −1 −1
2 ab = ba ⇒ (ab) = (ba) b a =a b
−1 −1
⇒a and b are commute.
Order of an Element
Definition: Let (G, ∗) be a group and a ∈ G, then the least positive integer n if it exists such
n
that a = e is called the order of a ∈ G.
The order of an element a ∈ G is be denoted by O(a).
Example: G = {1, −1, i, −i} is a group with respect to multiplication. 1 is the identity in G.
1 = 1 = 1 = · · · = 1 ⇒ O(1) = 1.
1 2 3
= · · · = 1 ⇒ O(i) = 4. (−i)
4 8 12 4
i =i =i
= (−i) = · · · = 1 ⇒ O(−i) = 4.
8
5
Example: In a group G, a is an element of order 30. Find order of a .
Solution: Given O(a) = 30
⇒a
30 5
= e, e is the identity element of G. Let O(a ) = n
⇒ (a ) = e
5n
⇒a
5n
= e, where n is the least positive integer. Hence 30 is divisor of 5n.
107
∴ n = 6.
5
Hence O(a ) = 6
Sub Groups
Definition: Let (G, ∗) be a group and H be a non-empty subset of G. If (H, ∗) is itself is a
group, then (H, ∗) is called sub-group of (G, ∗).
Examples:
1. (Z, +) is a subgroup of (Q, +).
108
2. The additive group of even integers is a subgroup of the additive group of all
integers.
3. (N, +) is not a subgroup of the group (Z, +), since identity does not exist in N under
+.
Example: Let G = {1, −1, i, −i} and H = {1, −1}.
Here G and H are groups with respect to the binary operation multiplication and H is a subset
of G. Therefore (H, ·) is a subgroup of (G, ·).
Example: Let H = {0, 2, 4} ⊆ Z6. Check that (H, +6) is a subgroup of (Z6, +6).
Solution: Z6 = {0, 1, 2, 3, 4, 5}.
+6 0 1 2 3 4 5
0 0 1 2 3 4 5
1 1 2 3 4 5 0
2 2 3 4 5 0 1
3 3 4 5 0 1 2
4 4 5 0 1 2 3
5 5 0 1 2 3 4
H= {0, 2, 4}.
+6 0 2 4
0 0 2 4
2 2 4 0
4 4 0 2
(ii). Identity Element: The row headed by 0 is exactly same as the initial row.
∴ 0 is the identity element.
−1 −1 −1
(iii). Inverse: 0 = 0, 2 = 4, 4 = 2.
Theorem: If (G, ∗) is a group and H ⊆ G, then (H, ∗) is a subgroup of (G, ∗) if and only if
(i) a, b ∈ H ⇒ a ∗ b ∈ H;
−1
(ii) a ∈ H ⇒ a ∈ H.
109
110
Example: The set S of all ordered pairs (a, b) of real numbers for which a ≠ 0 w.r.t the
operation × defined by (a, b) × (c, d) = (ac, bc + d) is non-abelian. Let H= {(1, b)| b ∈ R} is a
subset of S. Show that H is a subgroup of (S, ×).
−1
Clearly (1, c) ∈ H ⇒ (1, c) = (1, −c) ∈ H.
Let (1, b) ∈ H.
−1
(1, b) × (1, c) = (1, b) × (1, −c)
−1
∴ (1, b), (1, c) ∈ H ⇒ (1, b) × (1, c) ∈ H ∴ H is a
subgroup of (S, ×).
=(1, b + c)
=(1, c + b)
=(1, c) × (1, b)
111
⇒ H1 ∩ H2 ≠ ϕ.
112
∴ H1 ∩ H2 is a subgroup of G.
Example: Let G be the group and Z={x ∈ G| xy=yx for all y∈G}. Prove that Z is a subgroup of
G.
(ab)y = a(by)
=a(yb), since b ∈ Z, by = yb
=(ay)b
=(ya)b
=y(ab)
−1 −1 −1 −1
⇒ (a a)(ya ) = (a y)(aa )
−1 −1 −1 −1
⇒ e(ya ) = (a y)e ⇒ a y = ay
−1
This shows that a ∈ Z.
−1
Thus, when a, b ∈ Z, we have ab ∈ Z and a ∈ Z.
Therefore Z is a subgroup of G.
′ ′
G . If for a, b ∈ G, f(a∗b) = f(a)·f(b), then f is called homomorphism G into G . Homomorphism
′ ′
onto: Let (G, ∗) and (G , ·) be two groups and f be a mapping from G onto G . If for a, b ∈ G,
′
f(a∗b) = f(a)·f(b), then f is called homomorphism G onto G .
114
′
Example: Let G be the additive group of integers and G be the multiplicative group. Then
′ x ′
mapping f : G → G given by f(x) = 2 is a group homomorphism of G into G .
′ ′
Solution: Since x, y ∈ G ⇒ x + y ∈ G and 2 , 2 ∈ G ⇒ 2 · 2 ∈ G .
x y x y
x+y x y
∴ f(x + y) = 2 = 2 · 2 = f(x) · f(y).
′
⇒ f is a homomorphism of G into G .
′
Example: Let G be a group of positive real numbers under multiplication and G be a group of
′
all real numbers under addition. The mapping f : G → G given by f(x) = log10 x. Show that f
is an isomorphism.
Solution: Given f(x) = log10 x.
′
Let a, b ∈ G ⇒ ab ∈ G. Also, f(a), f(b) ∈ G .
⇒ log x = log x
10 1 10 2
⇒ 10
log x log x
10 1
= 10 10 2
⇒ x1 = x2
⇒ f is one-one.
⇒ f(10 ) = log10(10 ) = y.
y y
′
∴ For ever y ∈ G , there exists 10 ∈ G such that f(10 ) = y
y y
⇒ f is onto.
′
∴ f an isomorphism from G to G .
+
Example: If R is the group of real numbers under the addition and R is the group of positive
+ x
real numbers under the multiplication. Let f : R → R be defined by f(x) = e , then show that f
is an isomorphism.
+ x
Solution: Let f : R → R be defined by f(x) = e . f
is one-one: Let a, b ∈ G and f(a) = f(b)
a b
⇒e =e
a b
⇒ log e = log e
⇒ a log e = b log e
115
⇒a=b
Thus f is one-one.
f is onto: If c ∈ R then log c ∈ R and f(log c) = e
+ log c
=c
+
Thus each element of R has a pre-image in R under f and hence f is onto.
a+b a b
f is Homomorphism: f(a + b) = e = e .e = f(a).f(b) Hence f is an isomorphism.
116
−1
Example: Let G be a multiplicative group and f : G → G such that for a ∈ G, f(a) = a .
Prove that f is one-one and onto. Also, prove that f is homomorphism if and only if G is
commutative.
−1
Solution: f : G → G is a mapping such that f(a) = a , for a ∈ G.
(i). To prove that f is one-one.
−1 −1
Let a, b ∈ G. ∴ a , b ∈ G and f(a), f(b) ∈ G.
Now f(a) = f(b)
−1 −1
⇒a =b
⇒ (a−1)−1 = (b−1)−1
⇒ a=b
∴ f is one-one.
∴ f is onto.
(iii). Suppose f is a homomorphism.
For a, ∈ G, ab ∈ G. Now f(ab) = f(a)f(b)
−1
⇒ (ab) = a b
−1 −1
⇒ b−1a−1 = a−1b−1
⇒ (b−1a−1)−1 = (a−1b−1)−1
⇒ (a−1)−1(b−1)−1 = (b−1)−1(a−1)−1
⇒ ab = ba
∴ G is abelian.
(iv). Suppose G is abelian ⇒ ab = ba, ∀ a, b ∈ G.
−1
For a, b ∈ G, f(ab) = (ab)
= b−1a−1
=a−1b−1
=f(a)f(b)
∴ f is a homomorphism.