r-16 MFCS PDF
r-16 MFCS PDF
r-16 MFCS PDF
ON
MATHEMATICAL FOUNDATIONS
OF COMPUTER SCIENCE
II B. Tech I semester (JNTUK-R16)
Mr. V.S.S.V.D.PRAKASH
Assistant Professor
DEPARTMENT OF MATHEMATICS
1
SYLLABUS
UNIT -I:
Mathematical Logic:
Propositional Calculus: Statements and Notations, Connectives, Well Formed Formulas,
Truth Tables, Tautologies, Equivalence of Formulas, Duality Law, Tautological
Implications, Normal Forms, Theory of Inference for Statement Calculus, Consistency of
Premises, Indirect Method of Proof. Predicate Calculus:Predicative Logic, Statement
Functions, Variables and Quantifiers, Free and Bound Variables, Inference Theory for
Predicate Calculus.
UNIT -II:
Set Theory:
Introduction, Operations on Binary Sets, Principle of Inclusion and Exclusion, Relations:
Properties of Binary Relations, Relation Matrix and Digraph, Operations on Relations,
Partition and Covering, Transitive Closure, Equivalence, Compatibility and Partial
Ordering Relations, Hasse Diagrams, Functions: Bijective Functions, Composition of
Functions, Inverse Functions, Permutation Functions, Recursive Functions, Lattice and
its Properties.
UNIT- III:
Algebraic Structures and Number Theory:
Algebraic Structures: Algebraic Systems, Examples, General Properties, Semi Groups
and Monoids, Homomorphism of Semi Groups and Monoids, Group, Subgroup, Abelian
Group, Homomorphism, Isomorphism, Number Theory: Properties of Integers, Division
Theorem, The Greatest Common Divisor, Euclidean Algorithm, Least Common Multiple,
Testing for Prime Numbers, The Fundamental Theorem of Arithmetic, Modular
Arithmetic (Fermat‘s Theorem and Euler‘s Theorem)
UNIT -IV:
Combinatorics:
Basic of Counting, Permutations, Permutations with Repetitions, Circular Permutations,
Restricted Permutations, Combinations, Restricted Combinations, Generating Functions
of Permutations and Combinations, Binomial and Multinomial Coefficients, Binomial
and Multinomial Theorems, The Principles of Inclusion–Exclusion, Pigeonhole Principle
and its Application.
UNIT -V:
Recurrence Relations:
Generating Functions, Function of Sequences, Partial Fractions, Calculating Coefficient
of Generating Functions, Recurrence Relations, Formulation as Recurrence Relations,
Solving Recurrence Relations by Substitution and Generating Functions, Method of
Characteristic Roots, Solving Inhomogeneous Recurrence Relations
UNIT -VI:
Graph Theory:
Basic Concepts of Graphs, Sub graphs, Matrix Representation of Graphs: Adjacency
Matrices, Incidence Matrices, Isomorphic Graphs, Paths and Circuits, Eulerian and
2
Hamiltonian Graphs, Multigraphs, Planar Graphs, Euler‘s Formula, Graph Colouring and
Covering, Chromatic Number, Spanning Trees, Algorithms for Spanning Trees
(Problems Only and Theorems without Proofs).
TEXT BOOKS:
1.Discrete Mathematical Structures with Applications to Computer Science,J. P.Tremblay
and P. Manohar,Tata McGraw Hill.
2. Elements of Discrete Mathematics-A Computer Oriented Approach, C. L. Liu and D.
P. Mohapatra, 3rdEdition, Tata McGraw Hill.
3. Discrete Mathematics and its Applications with Combinatorics and Graph Theory, K.
H. Rosen, 7th Edition, Tata McGraw Hill.
REFERENCE BOOKS:
1. Discrete Mathematics for Computer Scientists and Mathematicians, J. L. Mott, A.
Kandel, T.P. Baker, 2nd Edition, Prentice Hall of India.
2. Discrete Mathematical Structures, BernandKolman, Robert C. Busby, Sharon
Cutler Ross, PHI.
3. Discrete Mathematics, S. K. Chakraborthy and B.K. Sarkar, Oxford, 2011.
3
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:
1. Delhi is the capital of India.
2. Kolkata is a country.
3. 5 is a prime number.
4. 2 + 3 = 4.
These are propositions (or statements) because they are either true of false.
Next consider the following sentences:
5. How beautiful are you?
6. Wish you a happy new year
7. x + y = z
8. Take one book.
These are not propositions as they are not declarative in nature, that is, they do not
declare a definite truth value T or F.
Propositional Calculus is also known as statement calculus. It is the branch of
mathematics that is used to describe a logical system or structure. A logical system
consists of (1) a universe of propositions, (2) truth tables (as axioms) for the logical
operators and (3) definitions that explain equivalence and implication of propositions.
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
4
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
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
Then p ∨ q : I shall go to the game or watch the game on television.
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.
Solution: (i) p → q (ii) p → q (iii) p → q (iv) q → p.
6
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
(2). ¬P → ¬Q is called its inverse
(3). ¬Q → ¬P is called its contrapositive.
Truth table for Q → P (converse of P → Q)
P Q Q→P
T T T
T F T
F T F
F F T
Truth table for ¬P → ¬Q (inverse of P → Q)
P Q ¬P ¬Q ¬P → ¬Q
T T F F T
T F F T T
F T T F F
F F T T T
Truth table for ¬Q → ¬P (contrapositive of P → Q)
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
7
Example: Consider the statement
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
U: If it does not rain then the crop will not grow.
The contraposition of the implication P → Q, namely ¬Q → ¬P states that T : If
the crop do not grow then there has been no rain.
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.
The truth table of p↔q is given by the following table:
Table 6. Truth table for biconditional
p q p↔q
T T T
T F F
F T F
F F T
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.
Contingency: A statement formula which is neither a tautology nor a contradiction is known
as a contingency.
8
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 ).
Substitute R↔S for P in B, we get
(i) : (R ↔ S) → (J ∧ (R ↔ S))
Then A is a substitution instance of B.
Note that (R ↔ S) → (J ∧P) is not a substitution instance of B because the variables
P in J ∧ P was not replaced by 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
As P ∨ Q ¬(¬P ∧ ¬Q) is a tautology, then P ∨ Q ⇔ ¬(¬P ∧ ¬Q).
Example: Prove (P → Q) ⇔ (¬P ∨ Q).
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
9
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:
10
Example: Prove that P → (Q → P ) ⇔ ¬P → (P → Q).
Solution: P→ (Q → P ) ⇔ ¬P ∨ (Q → P )
⇔ ¬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).
***Example: Prove that (¬P ∧ (¬Q ∧ R)) ∨ (Q ∧ R) ∨ (P ∧ R) ⇔ R. (Nov. 2009)
Solution:
(¬P ∧ (¬Q ∧ R)) ∨ (Q ∧ R) ∨ (P ∧ R)
⇔ ((¬P ∧ ¬Q) ∧ R) ∨ ((Q ∨ P ) ∧ R) [Associative and Distributive laws]
⇔ (¬(P ∨ Q) ∧ R) ∨ ((Q ∨ P ) ∧ R) [De Morgan‘s laws]
⇔ (¬(P ∨ Q) ∨ (P ∨ Q)) ∧ R [Distributive laws]
⇔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
(¬P ∧ ¬Q) ∨ (¬P ∧ ¬R) ⇔ ¬(P ∨ Q) ∨ ¬(P ∧ R)
⇔ ¬((P ∨ Q) ∧ (P ∨ R))
Also
¬(¬P ∧ (¬Q ∨ ¬R)) ⇔ ¬(¬P ∧ ¬(Q ∧ R))
⇔ P ∨ (Q ∧ R)
⇔ (P ∨ Q) ∧ (P ∨ R)
Hence ((P ∨ Q) ∧ ¬(¬P ∧ (¬Q ∨ ¬R))) ⇔ (P ∨ Q) ∧ (P ∨ Q) ∧ (P ∨ R)
⇔ (P ∨ Q) ∧ (P ∨ R)
11
⇔ [(P ∨ Q) ∧ (P ∨ R)] ∨ ¬[(P ∨ Q) ∧ (P ∨ R)]
⇔T
Hence the given formula is a tautology.
Example: Show that (P ∧ Q) → (P ∨ Q) is a tautology. (Nov. 2009)
Solution: (P ∧ Q) → (P ∨ Q) ⇔ ¬(P ∧ Q) ∨ (P ∨ Q) [∵ P → Q ⇔ ¬P ∨ Q]
⇔ (¬P ∨ ¬Q) ∨ (P ∨ Q) [by De Morgan‘s laws]
⇔ (¬P ∨ P ) ∨ (¬Q ∨ Q) [by Associative laws and commutative
laws]
⇔ (T ∨ T )[by negation laws]
⇔T
Hence, the result.
12
(c). I have not fallen or I can get up.
(d). You can not study and you get a good grade.
Exercises: 1. Write the negation of the following statements.
(a). If it is raining, then the game is canceled.
(b). If he studies then he will pass the examination.
Are (p → q) → r and p → (q → r) logically equivalent? Justify your answer by using the
rules of logic to simply both expressions and also by using truth tables. Solution: (p → q) →
r and p → (q → r) are not logically equivalent because
Method I: Consider
(p → q) → r ⇔ (¬p ∨ q) → r
⇔ ¬(¬p ∨ q) ∨ r ⇔
(p ∧ ¬q) ∨ r
⇔ (p ∧ r) ∨ (¬q ∧ r)
and
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
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:
13
(i). (P ∨ Q) ∧ R (ii). (P ∧ Q) ∨ T (iii). (P ∧ Q) ∨ (P ∨ ¬(Q ∧ ¬S))
Solution: The duals of the formulas may be written as
(i). (P ∧ Q) ∨ R (ii). (P ∨ Q) ∧ F (iii). (P ∨ Q) ∧ (P ∧ ¬(Q ∨ ¬S))
Result 1: The negation of the formula is equivalent to its dual in which every variable
is replaced by its negation.
We can prove
¬A(P1, P2, ..., Pn) ⇔ A∗(¬P1, ¬P2, ..., ¬Pn)
Example: Prove that (a). ¬(P ∧ Q) → (¬P ∨ (¬P ∨ Q)) ⇔ (¬P ∨ Q)
(b). (P ∨ Q) ∧ (¬P ∧ (¬P ∧ Q)) ⇔ (¬P ∧ Q)
Solution: (a).¬(P ∧ Q) → (¬P ∨ (¬P ∨ Q)) ⇔ (P ∧ Q) ∨ (¬P ∨ (¬P ∨ Q)) [∵ 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
(b). From (a)
(P ∧ Q) ∨ (¬P ∨ (¬P ∨ Q)) ⇔ ¬P ∨ Q
Writing the dual
(P ∨ Q) ∧ (¬P ∧ (¬P ∧ Q)) ⇔ (¬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.
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 ).
14
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 ).
In order to show any of the given implications, it is sufficient to show that an
assignment of the truth value T to the antecedent of the corresponding condi-
tional leads to the truth value T for the consequent. This procedure guarantees that the
conditional becomes tautology, thereby proving the implication.
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 .
15
(P ↑ Q) ↑ (P ↑ Q) ⇔ ¬(P ↑ Q) ⇔ ¬(¬(P ∧ Q)) ⇔ P ∧ Q.
(P ↑ P ) ↑ (Q ↑ Q) ⇔ ¬P ↑ ¬Q ⇔ ¬(¬P ∧ ¬Q) ⇔ P ∨ Q.
NAND is Commutative: Let P and Q be any two statement formulas.
(P ↑ Q) ⇔ ¬(P ∧ Q)
⇔ ¬(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
Therefore the connective ↑ is not associative.
NOR: The word NOR is a combination of ‘NOT‘ and ‘OR‘ where ‘NOT‘ stands for negation and
‗OR‘ for the disjunction. 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 .
(P ↓ Q) ↓ (P ↓ Q) ⇔ ¬(P ↓ Q) ⇔ ¬(¬(P ∨ Q)) ⇔ P ∨ Q.
(P ↓ P ) ↓ (Q ↓ Q) ⇔ ¬P ↓ ¬Q ⇔ ¬(¬P ∨ ¬Q) ⇔ P ∧ Q.
NOR is Commutative: Let P and Q be any two statement formulas.
(P ↓ Q) ⇔ ¬(P ∨ Q)
⇔ ¬(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))
⇔ ¬(P ∨ (¬(Q ∨ R)))
⇔ ¬P ∧ (Q ∨ R)
(P ↓ Q) ↓ R ⇔ ¬(P ∨ Q) ↓ R
⇔ ¬(¬(P ∨ Q) ∨ R) ⇔
(P ∨ Q) ∧ ¬R
Therefore the connective ↓ is not associative.
16
¬(P ∧ Q) ⇔ ¬P ∨ ¬Q
¬(P ∨ Q) ⇔ ¬P ∧ ¬Q.
Example: Express P ↓ Q interms of ↑ only.
Solution:
↓ Q ⇔ ¬(P ∨ Q)
⇔ (P ∨ Q) ↑ (P ∨ Q)
⇔ [(P ↑ P ) ↑ (Q ↑ Q)] ↑ [(P ↑ P ) ↑ (Q ↑ Q)]
Example: Express P ↑ Q interms of ↓ only. (May-2012)
Solution: ↑ Q ⇔ ¬(P ∧ Q)
⇔ (P ∧ Q) ↓ (P ∧ Q)
⇔ [(P ↓ P ) ↓ (Q ↓ Q)] ↓ [(P ↓ P ) ↓ (Q ↓ 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
place of ‖disjunction‖ in our current discussion.
17
A product of the variables and their negations in a formula is called an elementary
product. Similarly, a sum of the variables and their negations in a formula is called an
elementary sum.
Let P and Q be any atomic variables. Then P , ¬P ∧Q, ¬Q∧P ¬P , P ¬P , and Q ∧ ¬P
are some examples of elementary products. On the other hand, P , ¬P ∨ Q, ¬Q ∨ P ∨ ¬P , P
∨ ¬P , and Q ∨ ¬P are some examples of elementary sums.
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.
The method for obtaining conjunctive normal form of a given formula is similar to the one
given for disjunctive normal form. Again, the conjunctive normal form is not unique.
18
Example: Obtain conjunctive normal forms of
(a) P ∧ (P → Q); (b) ¬(P ∨ Q)↔ (P ∧ Q).
Solution: (a). P ∧ (P → Q) ⇔ P ∧ (¬P ∨ Q)
(b).¬(P ∨ Q)↔ (P ∧ Q)
⇔ (¬(P ∨ Q) → (P ∧ Q)) ∧ ((P ∧ Q) → ¬(P ∨ Q))
⇔ ((P ∨ Q) ∨ (P ∧ Q)) ∧ (¬(P ∧ Q) ∨ ¬(P ∨ Q))
⇔ [(P ∨ Q ∨ P ) ∧ (P ∨ Q ∨ Q)] ∧ [(¬P ∨ ¬Q) ∨ (¬P ∧ ¬Q)]
⇔ (P ∨ Q ∨ P ) ∧ (P ∨ Q ∨ Q) ∧ (¬P ∨ ¬Q ∨ ¬P ) ∧ (¬P ∨ ¬Q ∨ ¬Q)
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.
2
Let P and Q be the two statement variables. Then there are 2 minterms given by P ∧ Q, P ∧ ¬Q,
¬P ∧ Q, and ¬P ∧ ¬Q.
Minterms for three variables P , Q and R are P ∧ Q ∧ R, P ∧ Q ∧ ¬R, P ∧ ¬Q ∧ R,P∧ ¬Q ∧ ¬R, ¬P
∧ Q ∧ R, ¬P ∧ Q ∧ ¬R, ¬P ∧ ¬Q ∧ R and ¬P ∧ ¬Q ∧ ¬R. From the truth tables of these minterms
of P and Q, it is clear that
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
19
Methods to obtain PDNF of a given formula
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:
20
(1). First replace →, by their equivalent formula containing only ∧, ∨ and ¬.
(2). Next, negations are applied to the variables by De Morgan‘s laws followed by the
application of distributive laws.
(3). Any elementarily product which is a contradiction is dropped. Minterms are ob-tained in
the disjunctions by introducing the missing factors. Identical minterms appearing in the
disjunctions are deleted.
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 ∧ Q) [by distributive laws]
⇔ (P ∧ Q) ∨ (P ∧ ¬Q) [∵ P ∨ P ⇔ P ]
which is the required PDNF.
Now, ⇔P∧T
⇔ P ∧ (Q ∨ ¬Q)
⇔ (P ∧ Q) ∨ (P ∧ ¬Q)
which is the required PDNF.
Hence, P ∨ (P ∧ Q) ⇔ P .
21
(b) P ∨ (¬P ∧ Q) ⇔ (P ∧ T ) ∨ (¬P ∧ Q)
⇔ (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.
Example: Obtain the principal disjunctive normal form of
→ ((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)
22
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] ∧ [(Q → P ) ∧ (P → Q)]
⇔ (P ∨ R) ∧ [(¬Q ∨ P ) ∧ (¬P ∨ Q)]
⇔ (P ∨ R ∨ F ) ∧ [(¬Q ∨ P ∨ F ) ∧ (¬P ∨ Q ∨ F )]
⇔ [(P ∨ R) ∨ (Q ∧ ¬Q)] ∧ [¬Q ∨ P ) ∨ (R ∧ ¬R)] ∧ [(¬P ∨ Q) ∨ (R ∧ ¬R)]
⇔ (P ∨ R ∨ Q) ∧ (P ∨ R ∨ ¬Q) ∧ (P ∨ ¬Q ∨ R) ∧ (P ∨ ¬Q ∨ ¬R)
∧ (¬P ∨ Q ∨ R) ∧ (¬P ∨ Q ∨ ¬R)
⇔ (P ∨ Q ∨ R) ∧ (P ∨ ¬Q ∨ R) ∧ (P ∨ ¬Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R) ∧ (¬P ∨ Q ∨ ¬R)
which is required principal conjunctive normal form.
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.
23
Theory of Inference for Statement Calculus
Definition: The main aim of logic is to provide rules of inference to infer a conclusion from
certain premises. The theory associated with rules of inference is known as inference theory .
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
‖B is a valid conclusion (consequence) of the premise A‖ iff A → B is a tautology, that is A ⇒ B.
We say that from a set of premises {H1, H2, · · · , Hm}, a conclusion C follows logically iff
H1 ∧ H2 ∧ ... ∧ Hm ⇒ C
(1)
24
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
25
(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 :
10 ¬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
: P ∨ Q, P → R, Q → R ⇒ R
14 (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,
{1, 2} (3) Q Rule T, (1), (2), and I13
{4} (4) Q → R Rule P
{1, 2, 4} (5) R Rule T, (3), (4), and I13
Hence the result.
26
Example: Show that R∨S follows logically from the premises C ∨D, (C ∨D) → ¬H, ¬H → (A ∧
¬B), and (A ∧ ¬B) → (R ∨ S).
Solution:
{1} (1) (C ∨ D) → ¬H Rule P
{2} (2) ¬H → (A ∧ ¬B) Rule P
{1, 2} (3) (C ∨ D) → (A ∧ ¬B) Rule T, (1), (2), and I13
{4} (4) (A ∧ ¬B) → (R ∨ S) Rule P
{1, 2, 4} (5) (C ∨ D) → (R ∨ S) Rule T, (3), (4), and I13
{6} (6) C ∨ D Rule P
{1, 2, 4, 6} (7) R ∨ S Rule T, (5), (6), and I11
Hence the result.
Solution:
Q → R, P → M, and ¬M.
Solution:
27
{1, 2, 4, 6} (7) R Rule T, (5), (6), and I11
{1, 2, 4, 6} (8) R ∧ (P ∨ Q) Rule T, (4), (7) and I9
Hence the result.
‖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.
28
(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)
29
Hence, the given premises are P → Q, R → ¬Q, and R. The conclusion is ¬P .
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.
30
{1, 2} (3) Q Rule T, (1), (2), and I11
Hence, the given statements constitute a valid argument.
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.
Alternatively, a set of formulas H1, H2, · · · , Hm is inconsistent if their conjunction implies a
contradiction, that is,
H1 ∧ H2 ∧ · · · ∧ Hm ⇒ R ∧ ¬R
where R is any formula.
Thus, the given set of premises leads to a contradiction and hence it is inconsistent.
31
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.
32
Example: Show that ¬(P ∧ Q) follows from ¬P ∧ ¬Q.
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.
33
{6} (6) S → ¬R Rule P
{1, 2, 4, 6} (7) ¬R Rule T, (5), (6) and Modus Ponens
{1, 2, 4, 6} (8) Q Rule T, (3), (7), and P ∧ Q, ¬Q ⇒ P
{9} (9) Q → ¬P Rule P
{1, 2, 4, 6} (10) ¬P Rule T, (8), (9), and P ∧ Q, ¬Q ⇒ P
{1, 2, 4, 6} (11) P ∧ ¬P Rule T, (2), (10), and P, Q ⇒ P ∧ Q
{1, 2, 4, 6} (12) F Rule T, (11), and P ∧ ¬P ⇔ F
Hence, it is proved that the given premises are inconsistent.
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)
where S denote the set of all human beings.
∀x represents each of the following phrases, since they have essentially the same for all x
For every x
For each x.
Existential Quantifier: The phrase ‘there exists‘ (denoted by ∃) is called the exis-tential
quantifier.
34
For example, consider the sentence
2
‖There exists x such that x = 5.
This sentence can be written as
(∃x ∈ R)P (x) or (∃x)P (x),
2
where P (x) : x = 5.
∃x represents each of the following phrases
There exists an x
There is an x
For some x
There is at least one x.
35
Free and Bound Variables
Given a formula containing a part of the form (x)P (x) or (∃x)P (x), such a part is called
an x-bound part of the formula. Any occurrence of x in an x-bound part of the formula is
called a bound occurrence of x, while any occurrence of x or of any variable that is not a
bound occurrence is called a free occurrence. The smallest formula immediately
following (∀x) or (∃x) is called the scope of the quantifier.
Consider the following formulas:
(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.
36
‖Some professional athletes paly soccer‖.
(iii). For all x, x is a professional athlete or x plays soccer.
‖Every person is either professional athlete or plays soccer‖.
Equivalence formulas:
E31 : (∃x)[A(x) ∨ B(x)] ⇔ (∃x)A(x) ∨ (∃x)B(x)
E32 : (x)[A(x) ∧ B(x)] ⇔ (x)A(x) ∧ (x)B(x)
E33 : ¬(∃x)A(x) ⇔ (x)¬A(x)
E34 : ¬(x)A(x) ⇔ (∃x)¬A(x)
E35 : (x)(A ∨ B(x)) ⇔ A ∨ (x)B(x)
E36 : (∃x)(A ∧ B(x)) ⇔ A ∧ (∃x)B(x)
E37 : (x)A(x) → B ⇔ (x)(A(x) → B)
E38 : (∃x)A(x) → B ⇔ (x)(A(x) → B)
E39 : A → (x)B(x) ⇔ (x)(A → B(x))
37
E40 : A → (∃x)B(x) ⇔ (∃x)(A → B(x))
E41 : (∃x)(A(x) → B(x)) ⇔ (x)A(x) → (∃x)B(x)
E42 : (∃x)A(x) → (x)B(X) ⇔ (x)(A(x) → B(X)).
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
38
Example: Show that (x)(P (x) → Q(x)) ∧ (x)(Q(x) → R(x)) ⇒ (x)(P (x) → R(x)).
Solution:
{1} (1) (x)(P (x) → Q(x)) Rule P
{1} (2) P (y) → Q(y) Rule US, (1)
{3} (3) (x)(Q(x) → R(x)) Rule P
{3} (4) Q(y) → R(y) Rule US, (3)
{1, 3} (5) P (y) → R(y) Rule T, (2), (4), and I13
{1, 3} (6) (x)(P (x) → R(x)) Rule UG, (5)
Example: Show that (∃x)M(x) follows logically from the premises
(x)(H(x) → M(x)) and (∃x)H(x).
Solution:
39
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.
40
which is a contradiction.Hence, the statement is valid.
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‖.
1. Test the Validity of the Following argument: ―All dogs are barking. Some animals are
dogs. Therefore, some animals are barking‖.
2. Test the Validity of the Following argument:
―Some cats are animals. Some dogs are animals. Therefore, some cats are dogs‖.
3. Symbolizes and prove the validity of the following arguments :
(i) Himalaya is large. Therefore every thing is large.
(ii) Not every thing is edible. Therefore nothing is edible.
4. a) Find the PCNF of (~p↔r) ^(q↔p) ?
b) Explain in brief about duality Law?
41
7. Obtain the principal conjunctive normal form of the formula (┐P→R)Λ(Q↔P)
8. Prove that (x)P(x)Q(x) → (x)P(x)(x)Q(x). Does the converse hold?
9. Show that from i) (x)(F(x) S(x)) (y)(M(y) W(y))
ii) (y) (M(y) ┐W(y)) the conclusion (x)(F(x) ┐S(x)) follows.
10. Obtain the principal disjunctive and conjunctive normal forms of (P (QR)) (┐P(┐Q┐R)). Is
this formula a tautology?
11. Prove that the following argument is valid: No Mathematicians are fools. No one who is not a fool
is an administrator. Sitha is a mathematician. Therefore Sitha is not an administrator.
12. Test the Validity of the Following argument: If you work hard, you will pass the exam. You did not
pass. Therefore you did not work hard.
13. Without constructing the Truth Table prove that (pq)q=pvq?
14. Using normal forms, show that the formula Q(P┐Q)( ┐P┐Q) is a tautology.
15. Show that (x) (P(x) Q(x)) (x)P(x) (x)Q(x)
16. Show that ┐(PQ) ( ┐P( ┐PQ)) ( ┐PQ)
(PQ)( ┐P( ┐PQ)) (┐PQ)
17. Prove that (x) (P(x) Q(x)) (x)P(x) (x)Q(x)
18. Example: Prove or disprove the validity of the following arguments using the rules of
inference. (i) All men are fallible (ii) All kings are men (iii) Therefore, all kings are
fallible.
19. Test the Validity of the Following argument:
―Lions are dangerous animals, there are lions, and therefore there are dangerous
animals.‖
42
Option: B
11. Consider two well-formed formulas in propositional logic
F1 : P →˥P F2 : (P →˥P) v ( ˥P →) Which of the following statement is correct?
A.F1 is satisfiable, F2 is unsatisfiable B.F1 is unsatisfiable, F2 is satisfiable
C.F1 is unsatisfiable, F2 is valid D.F1 & F2 are both satisfiable
Option: C
12: What can we correctly say about proposition P1 : (p v ˥q) ^ (q →r) v (r v p)
A.P1 is tautology B.P1 is satisfiable
C.If p is true and q is false and r is false, the P1 is true
D.If p as true and q is true and r is false, then P1 is true
Option: C
13: (P v Q) ^ (P → R )^ (Q →S) is equivalent to
A.S ^ R B.S → R C.S v R D.All of above
Option: C
14: The functionally complete set is
A.{ ˥, ^, v } B.{↓, ^ }C.{↑} D.None of these
Option: C
15: (P v Q) ^ (P→R) ^ (Q → R) is equivalent to
A.P B.Q C.R D.True = T
Option: C
16: ˥(P → Q) is equivalent to
A.P ^ ˥Q B.P ^ QC.˥P v Q D.None of these
Option: A
17: In propositional logic , which of the following is equivalent to p → q?
A.~p → q B.~p v q C.~p v~ q D.p →q
Option: B
18: Which of the following is FALSE? Read ^ as And, v as OR, ~as NOT, →as one way implication
and ↔ as two way implication?
A.((x → y)^ x) →y B.((~x →y)^ ( ~x ^ ~y))→y C.(x → ( x v y)) D.((x v y) ↔( ~x v ~y))
Option: D
19: Which of the following well-formed formula(s) are valid?
A.((P → Q)^(Q → R))→ (P → R) B.(P → Q) →(˥P → ˥Q)
C.(P v (˥P v ˥Q)) →P D.((P → R) v (Q → R)) → (P v Q}→R)
Option: A
20: Let p and q be propositions. Using only the truth table decide whether p ↔ q does not imply p
→ ˥q is
A.True B.False C.None D.Both A and B
Option: A
43
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.
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
not unique and it may change from one discussion to another.
Power set:
The set of all subsets of a set A is called the power set of A.
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:
Two sets are said to be disjoint if they have no element in common.
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
A which are not in A. It is denoted by A – B thus: A – B = {x | x ∈ A and x B}
44
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: x A}
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
|A ∪ B| = |A| + |B| − |A ∩ B|.
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.
In general, Let A1, · · · , Ap be finite subsets of a set U. Then,
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.
So, the required answer is 1000 − 667 = 333.
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}.
Therefore, the required answer is 10000 − |A2 ∪ A3 ∪ A5 ∪ A7| = 2285.
45
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}
Example: A = {2, 3, 4} and B = {3, 4, 5, 6, 7}. Define a relation from A to B by (a, b) ∈ R if a
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.
46
(iv). If R4 = {(1, 2), (2, 2), (2, 3)} on A = {1, 2, 3} is an antisymmetric.
Example: Given S = {1, 2, ..., 10} and a relation R on S, where R = {(x, y)| x + y = 10}.
What are the properties of the relation 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
MR = [rij ], which is defined as follows:
1, if (x i , y j ) R
r =
ij 0, if (x i , y j ) R
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.
Solution: A = {1, 2, 3, 4}, B = {b1, b2, b3}.
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 1 0
1 0 1
47
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
MR =
1 0 0 0
1 1 0 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)}.
The graph of R and the matrix of R are
1 2
3 4
Graph of R
0 0 0 0
1 0 0 0
MR =
1 1 0 0
1 1 1 0
48
Partition and Covering of a Set
Let S be a given set and A = {A1, A2, · · · , Am} where each Ai, i = 1, 2, · · · , m is a subset of S and
m
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,
c}}. Which of the above sets are covering?
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}}.
Which of the above sets are covering?
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:
({a}, {b}, {c, d}), ({b}, {a}, {c, d})
({a}, {c}, {b, d}), ({c}, {a}, {b, d})
({a}, {d}, {b, c}), ({d}, {a}, {b, c})
({b}, {c}, {a, d}), ({c}, {b}, {a, d})
({b}, {d}, {a, c}), ({d}, {b}, {a, c})
({c}, {d}, {a, b}), ({d}, {c}, {a, b}).
Equivalence Relations
A relation R in a set X is called an equivalence relation if it is reflexive, symmetric and transitive.
The following are some examples of equivalence relations:
1.Equality of numbers on a set of real numbers.
2. Equality of subsets of a universal set.
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)}.
Prove that R is an equivalence relation.
49
1 0 0 1
0 1 1 0
MR =
0 1 1 01
1 0 0 1
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.
50
Let x, y, z ∈ N. Then
(i). x − x = 0.m
⇒ x ≡ x (mod m) for all x ∈ N
(ii). Let x ≡ y (mod m). Then, x − y is divisible by m.
⇒ −(x − y) = y − x is divisible by m.
i.e., y ≡ x (mod m)
∴ The relation ≡ is symmetric.
⇒ x − y and y − z are divisible by m. Now (x − y) + (y − z) is divisible by m. i.e., x − z is
divisible by m.
⇒ x ≡ z (mod m)
∴ The relation ≡ is transitive.
Since the relation ≡ is reflexive, symmetric and transitive, the relation congruence modulo m is an
equivalence relation.
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)
∴ The relation R is symmetric.
(iii). Let x, y, u, v, m and n be positive integers
Let (x, y)R(u, v) and (u, v)R(m, n)
⇒ xv = yu and un = vm
⇒ xvun = yuvm
⇒ xn = ym, by canceling uv
⇒ (x, y)R(m, n)
∴ The relation R is transitive.
Since R is reflexive, symmetric and transitive, hence the relation R is an
equivalence relation.
51
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: 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}.
52
Composition of Binary Relations
Let R be a relation from X to Y and S be a relation from Y to Z. Then a relation written as R ◦ S
is called a composite relation of R and S where R◦S = {(x, z)| x ∈ X, z ∈ Z, and there exists y ∈
Y with (x, y) ∈ R and (y, z) ∈ S }.
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 = {(1, 5), (3, 2), (2, 5)}
S ◦ R = {(4, 2), (3, 2), (1, 4)} ≠ R ◦ S
(R ◦ S) ◦ R = {(3, 2)}
R ◦ (S ◦ R) = {(3, 2)} = (R ◦ S) ◦ R
R ◦ R = {(1, 2), (2, 2)}
R ◦ R ◦ S = {(4, 5), (3, 3), (1, 1)}
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 1 1 0 1 1
53
Transitive Closure
+ 2 3 n
Let X be any finite set and R be a relation in X. The relation R = R∪R ∪R ∪· · ·∪R
in X is called the transitive closure of R in X.
Example: Let the relation R = {(1, 2), (2, 3), (3, 3)} on the set {1, 2, 3}. What is the transitive closure of
R?
Solution: Given that R = {(1, 2), (2, 3), (3, 3)}.
+ 2 3
The transitive closure of R is R = R ∪ R ∪ R ∪ · · · =
R= {(1, 2), (2, 3), (3, 3)}
2
R = R ◦ R = {(1, 2), (2, 3), (3, 3)} ◦ {(1, 2), (2, 3), (3, 3)} = {(1, 3),
(2, 3), (3, 3)}
3 2
R = R ◦ R = {(1, 3), (2, 3), (3, 3)}
4 3
R = R ◦ R = {(1, 3), (2, 3), (3, 3)}
+ 2 3 4
R = R ∪ R ∪ R ∪ R ∪ ...
= {(1, 2), (2, 3), (3, 3)} ∪ {(1, 3), (2, 3), (3, 3)} ∪ {(1, 3), (2, 3), (3, 3)} ∪ ...
={(1, 2), (1, 3), (2, 3), (3, 3)}.
+
Therefore R = {(1, 2), (1, 3), (2, 3), (3, 3)}.
+
Example: Let X = {1, 2, 3, 4} and R = {(1, 2), (2, 3), (3, 4)} be a relation on X. Find R .
Solution: Given R = {(1, 2), (2, 3), (3, 4)}
2
R = {(1, 3), (2, 4)}
3
R = {(1, 4)}
4
R = {(1, 4)}
+
R = {(1, 2), (2, 3), (3, 4), (1, 3), (2, 4), (1, 4)}.
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.,
aRa for all a ∈ P
aRb and bRa ⇒ a = b
aRb and bRc ⇒ aRc
A set P together with a partial ordering R is called a partial ordered set or poset. The relation R is
often denoted by the symbol ≤ which is diff erent from the usual less than equal to symbol. Thus, if
≤ is a partial order in P , then the ordered pair (P, ≤) is called a poset.
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.
54
Let aRb and bRc ⇒ a ≥ b and b ≥ c
⇒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.
Thus, the relation ⊆ is a partial ordering on the power set of S.
′′
Example: Show that the divisibility relation / is a partial ordering on the set of positive integers.
+
Solution: Let Z be the set of positive integers.
+
Since (i). a/a for all a ∈ Z , / is reflexive.
(ii). a/b and b/a ⇒ a = b, / is antisymmetric.
(iii). a/b and b/c ⇒ a/c, / is transitive.
+ +
It follows that / is a partial ordering on Z and (Z , /) is a poset.
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,
(i). Each element is represented by a small circle or dot.
(ii). The circle for x ∈ P is drawn below the circle for y ∈ P if x < y, and a line is drawn
between x and y if y covers x.
(iii). If x < y but y does not cover x, then x and y are not connected directly by a single line.
55
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
56
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.
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}
Hasse diagram of (ρ(A), ⊆) is shown in Fig:
(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}.
57
P (S) = {ϕ, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.
Hasse diagram for the partial ordered set is shown in fig:
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
for R is shown in Fig.
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.
Similarly an element y ∈ P is called a maximal member of P relative to the partial ordering ≤ if
for no x ∈ P , is y < x.
Note:
(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.
The element a is maximal.
The elements d and e are minimal.
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
58
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}
59
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)
or equivalently f(x1) = f(x2) ⇒ x1 = x2 for x1, x2 ∈ X.
60
Example: f : R → R defined by f(x) = 3x, ∀x ∈ R is one-one, since
f(x1) = f(x2) ⇒ 3x1 = 3x2 ⇒ x1 = x2, ∀x1, x2 ∈ R.
2
Example: Determine whether f : Z → Z given by f(x) = x , x ∈ Z is a one-to-One function.
2
Solution: The function f : Z → Z given by f(x) = x , x ∈ Z is not a one-to-one function. This is
because both 3 and -3 have 9 as their image, which is against the definition of a one-to-one
function.
61
Proof of f being onto
Let y be any element in the codomain R
⇒ f(x) = y
⇒ 2x + 1 = y
⇒ x = (y-1)/2
Clearly, x = (y-1)/2∈ R
Thus, every element in the codomain has pre-image in the domain.
This implies that f is onto
Hence, f is a bijective map.
Identity function: Let X be any set and f be a function such that f : X → X is defined by f(x) = x
for all x ∈ X. Then, f is called the identity function or identity transformation on X. It can be
denoted by I or Ix.
Note: The identity function is both one-to-one and onto.
Let Ix(x) = Ix(y)
⇒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
(g ◦ f)(x) = g(f(x)), for all x ∈ X.
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).
Solution:
f ◦ g = {(1, 3), (2, 2), (3, 1)}
g ◦ f = {(1, 1), (2, 3), (3, 2)} ≠ f◦g
f ◦ h ◦ g = f ◦ (h ◦ g) = f ◦ {(1, 2), (2, 1), (3, 1)}
= {(1, 3), (2, 2), (3, 2)}
s ◦ g = {(1, 2), (2, 1), (3, 3)} = g
g ◦ s = {(1, 2), (2, 1), (3, 3)}
∴s◦g=g◦s=g
s ◦ s = {(1, 1), (2, 2), (3, 3)} = s
f ◦ s = {(1, 2), (2, 3), (3, 1)}
Thus, s ◦ s = s, f ◦ g ≠g ◦ f, s ◦ g = g ◦ s = g and h ◦ s = s ◦ h = h.
62
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.
Solution: f : R → R is defined by f(x) = x + 2
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
∴ (g ◦ f)(x) = {(x, x)| x ∈ R}
(f ◦ g)(x) = f(g(x)) = f(x − 2) = (x − 2) + 2 = x
∴ f ◦ g = {(x, x)| x ∈ R}
(f ◦ f)(x) = f(f(x)) = f(x + 2) = x + 2 + 2 = x + 4
∴ f ◦ f = {(x, x + 4)| x ∈ R}
(g ◦ g)(x) = g(g(x)) = g(x − 2) = x − 2 − 2 = x − 4
⇒ g ◦ g = {(x, x − 4)| x ∈ R}
(f ◦ h)(x) = f(h(x)) = f(3x) = 3x + 2
∴ f ◦ h = {(x, 3x + 2)| x ∈ R}
(h ◦ g)(x) = h(g(x)) = h(x − 2) = 3(x − 2) = 3x − 6
∴ h ◦ g = {(x, 3x − 6)| x ∈ R}
(h ◦ f)(x) = h(f(x)) = h(x + 2) = 3(x + 2) = 3x + 6 h ◦ f =
{(x, 3x + 6)| x ∈ R}
(f ◦ h ◦ g)(x) = [f ◦ (h ◦ g)](x)
f(h ◦ g(x)) = f(3x − 6) = 3x − 6 + 2 = 3x − 4
∴ f ◦ h ◦ g = {(x, 3x − 4)| x ∈ R}.
63
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),
−1
(c, 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.
Therefore, f−1 is not a function.
Example: Let R be the set of real numbers and f : R → R be given by f = {(x, x2)| x ∈ R}. Is f−1 a
function?
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
64
⇒ 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
Given y ∈ R(codomain), there exists an element x = (y-b)/a ∈ R such that f(x) = y.
∴ 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 .
(i) First we shall show that f is one-to-one
Let x1, x2 ∈ R such that f(x1) = f(x2)
3 3
⇒x 1−2=x 2 −
3 3
2 ⇒x 1=x 2
⇒ x1 = x2
∴ f is one-to-one.
To show that f is onto.
3
⇒y=x −2
3
⇒ x = y+2
⇒ x= 3 y2
Given y ∈ R(codomain), there exists an element x = 3 y 2 ∈ R such that f(x) = y.
∴ f is onto
−1
⇒ f is invertible and f (x) = 3
x2
65
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.
n
Partial function: If f : D → N where D ⊆ N , then f is called a partial function.
Example: g(x, y) = x − y, which is defined for only x, y ∈ N which satisfy x ≥ y.
Hence g(x, y) is partial.
Initial functions:
The initial functions over the set of natural numbers is given by
Zero function Z: Z(x) = 0, for all x.
Successor function S: S(x) = x + 1, for all x.
n n
Projection function Ui : Ui (x1, x2, ..., xn) = xi for all n tuples (x1, x2, ..., xn), 1 ≤
i ≤ n.
Projection function is also called generalized identity function.
For example, U 1 (x) = x for every x ∈ N is the identity function.1
1
2 3 3 3
U 1
(x, y) = x, U 1 (2, 6, 9) = 2, U 2 (2, 6, 9) = 6, U 3 (2, 6, 9) = 9.
Composition of functions of more than one variable:
The operation of composition will be used to generate the other function.
Let f1(x, y), f2(x, y) and g(x, y) be any three functions. Then the composition of g with f1 and f2 is
defined as a function h(x, y) given by
h(x, y) = g(f1(x, y), f2(x, y)).
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
h(x, y) = g(f1(x, y), f2(x, y))
2
= g(x + y, xy + y
2
= (x + y)(xy + y )
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, 0) = g(x1, x2, ..., xn)
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).
Solution: Given that f(x, y) = x + y.
66
Here, f(x, y) is a function of two variables. If we want f to be defined by recursion, we
need a function g of single variable and a function h of three variables. Now,
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
f(2, 4) = S(f(2, 3))
=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.
Here, f(x, y) is a function of two variables. If we want f to be defined by recursion, we
need a function g of single variable and a function h of three variables. Now, f(x, 0) = 0
and
f(x, y + 1) = x ∗ (y + 1) = x ∗ y
f(x, y) + x
We can write
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
3 3
h(x, y, z) = f1(U3 (x, y, z), U1 (x, y, z)) = f(x, y + 1), we see that f defined by recursion. Since g
y
and h 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.
y+1 y
Also, x =x ∗x
y
Here f(x, y) = x is defined as
f(x, 0) = 1 = S(0) = S(Z(x))
67
f(x, y + 1) = x ∗ f(x, y)
3 3
U1 (x, y, f(x, y)) ∗ U3 (x, y, f(x, y))
3 3
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
primitive recursive.
∴ f(x, y) is a primitive recursive function.
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 ; y x
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(a1 ) p(a 2 ) . . . p(a 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.
Example: Let S = {1, 2, 3}. The permutations of S are as follows:
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
P1= ; P2= ; P3= ; P4= ; P5= ; P6=
1 2 3 2 1 3 2 3 1 3 2 1 3 1 2 1 3 2
Example: Let S = {1, 2, 3, 4} and p : S → S be given by f(1) = 2, f(2) = 1, f(3) = 4, f(4) = 3. Write
this in permutation notation.
Solution: The function can be written in permutation notation as given below:
68
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.
a a 2 ... a n
Example: Let S = {a1, a2, , an}.then I= 1 is the identity permutation on S.
a1 a 2 ... a 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.
Example: Let S = {1, 2, 3, 4}
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
a a2 ... a n
If f is a permutation on S = {a1, a2, , an} such that f 1
b1 b2 .... bn
−1 −1 −1
then there exists a permutation called the inverse f, denoted f such that f ◦ f =f ◦f=
I (the identity permutation on S)
69
1 b b2 ... bn
where f 1
a1 a2 ... a n
1 2 3 4 −1 −1 −1
Example: If f = , then find f , and show that f ◦f = f ◦f = I
2 4 3 1
−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 = o =
2 4 3 1 4 1 3 2 1 2 3 4
−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
f(a1) = a2, f(a2) = a3, ...., f(an−1) = an and f(an) = a1.
Example: Let S = {1, 2, 3, 4}.
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.
Example: Let S = {1, 2, 3, 4, 5, 6}.
If f = (1 4 5) and g = (2 3 6) then f and g are disjoint cyclic permutations on S.
Note: The product of two disjoint cycles is commutative.
1 2 3 4 5 6 7
Example: Consider the permutation f =
2 3 4 5 1 7 6
The above permutation f can be written as f = (1 2 3 4 5)(6 7). Which is a product of two disjoint
cycles.
1 2 3 4 5
Example: f = =(1 2 4)(3 5) = (1 4)(1 2)(3 5).
2 4 5 1 3
Inverse of a Cyclic Permutation: To find the inverse of any cyclic permutation, we write its
elements in the reverse order.
70
−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.
A permutation f is said to be an odd permutation if f is expressed as the product of odd number of
transpositions.
Note:
(i) An identity permutation is considered as an even permutation.
(ii) A transposition is always odd.
(iii). The product of an even and an odd permutation is odd. Similarly the product of an
odd permutation and even permutations is odd.
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
71
1 2 3 4 5 6 7 8
(ii). For g =
2 5 7 8 6 1 4 3
= (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 2 3 4 5
(iii) h= = (1 4 2 3) = (1 3)(1 2)(1 4)
4 3 1 2 5
⇒ h is an odd permutation.
72
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}}
73
Some Properties of Lattice
Let (L, ≤) be a lattice and ∗ and ⊕ denote the two binary operation meet and join on (L, ≤). Then
for any a, b, c ∈ L, we have
(L1): a∗a = a, (L1)′ : a⊕a = a (Idempotent laws)
′
(L2): b∗a = b∗a, (L2) : a ⊕b = b + a (Commutative laws)
(L3) : (a∗b)∗c = a∗(b∗c), (L3)′ : (a⊕b)⊕c = a⊕(b + c) (Associative laws)
′
(L4) : a∗(a + b) = a,(L4) : a⊕(a∗b) = a (Absorption laws).
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.
Proof: We shall first prove that a ≤ b ⇔ a ∗ b = b.
In order to do this, let us assume that a ≤ b. Also, we know that a ≤ a.
Therefore a ≤ a ∗ b. From the definition of a ∗ b, we have a ∗ b ≤ a.
Hence a ≤ b ⇒ a ∗ b = a.
Next, assume that a ∗ b = a; but it is only possible if a ≤ b, that is, a ∗ b = a ⇒ a ≤ b.
Combining these two results, we get the required equivalence.
It is possible to show that a ≤ b ⇔ a ⊕ b = b in a similar manner.
Alternatively, from a ∗ b = a, we have
b ⊕ (a ∗ b) = b ⊕ a = a ⊕ b
but b ⊕ (a ∗ b) = b
Hence a ⊕ b = b follows from a ∗ b = a.
By repeating similar steps, we can show that a ∗ b = a follows from a ⊕ b = b.
Therefore a ≤ b ⇔ a ∗ b = a ⇔ a ⊕ b = b.
a *b a *c
Theorem: Let (L, ≤) be a lattice. Then b c
a b a c
Proof: By above theorem a ≤ b ⇔ a ∗ b = a ⇔ a ⊕ b = b.
To show that a ∗ b ≤ a ∗ c, we shall show that (a ∗ b) ∗ (a ∗ c) = a ∗ b
(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.Next, let b ≤ c ⇒ b ⊕ c = c.
To show that a ⊕ b ≤ a ⊕ c. It sufficient to show that (a ⊕ b) ⊕ (a ⊕ c) = a ⊕ c.
74
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.
Note: The above properties of a Lattice are called properties of Isotonicity.
Lattice as an algebraic system:
We now define lattice as an algebraic system, so that we can apply many concepts
associated with algebraic systems to lattices.
Definition: A lattice is an algebraic system (L, ∗,⊕) with two binary operation ‗∗‘and ‗⊕‘ on L
which are both commutative and associative and satisfy absorption laws.
Bounded Lattice:
A bounded lattice is an algebraic structure (L,,,0,1) sucha that (L,,) is a lattice, and the
constants 0,1∈ L satisfy the following:
1. for all x∈ L, x1=x and x1=1
2. for all x∈ L, x0=0 and x0=x.
The element 1 is called the upper bound, or top of L and the element 0 is called the lower bound
or bottom of L.
Distributive lattice:
A lattice (L,∨,∧) is distributive if the following additional identity holds for all x, y, and z in L:
x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z)
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
75
Example: Show that lattice is not a distributive lattice.
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.
76
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.
Previous Questions
1. a) Let R be the Relation R= {(x,y)/ x divides y )} . Draw the Hasse diagram?
b) Explain in brief about lattice?
c) Define Relation? List out the Operations on Relations
2. Define Relation? List out the Properties of Binary operations?
3. Let the Relation R be R={(1,2) ,(2,3),(3,3)} on the set A= {1,2,3}. What is the Transitive
Closure of R?
4. Explain in brief about Inversive and Recursive functions with examples?
5. Prove that (S, ≤) is a Lattice, where S= {1,2,5,10} and ≤ is for divisibility. Prove that it is also
a Distributive Lattice?
6. Prove that (S,≤) is a Lattice, where S= {1,2,3,6} and ≤ is for divisibility. Prove that it is also a
Distributive Lattice?
7. Let A be a given finite set and P(A) its power set. Let be the inclusion relation on the
elements of P(A). Draw Hasse diagrams of (P(A), ) for A={a}; A={a,b}; A={a,b,c} and
A={a,b.c.d}.
8. Let Fx be the set of all one-to-one onto mappings from X onto X, where X={1,2,3}. Find all
the elements of Fx and find the inverse of each element.
9. Show that the function f(x) = x+y is primitive recursive.
10. Let X={2,3,6,12,24,36) and a relation ≤‘ be such that x≤ _if x divides y. Draw the Hasse
diagram of (x,≤).
11.If A={1,2,3,4} and P={{1,2},{3},{4}} is a partition of A, find the equivalence relation
77
determined by P.
12. Let X={1,2,3} and f, g, h and s be functions from X to X given by f={<1,2>, <2,3>, <3,1>}
g={<1,2>, <2,1>, <3,3>} h={<1,1>, <2,2>, <3,1>} and s={<1,1>, <2,2>, <3,3>}. Find
fog, fohog, gos, fos.
13. Let X={1,2,3,4} and R={<1,1>, <1,4>, <4,1>, <4,4>, <2,2>, <2,3>, <3,2>, <3,3>}. Write the
matrix of R and sketch its graph.
14.Let X = {a,b,c,d,e} and let C = {{a,b},{c},{d,e}}. Show that the partition C defines an
equivalence relation on X.
x / 2; when x iseven
15.Show that the function f(x)= is primitive recursive.
( x 1) / 2 ; when x is odd
16. If A={1,2,3,4} and R,S are relations on A defined by R={(1,2),(1,3),(2,4),(4,4)}
S={(1,1),(1,2),(1,3),(1,4),(2,3),(2,4)} find R o S, S o R, R2, S2, write down there matrices.
17. Determine the number of positive integers n where 1≤n≤2000 and n is not divisible by2,3 or
5 but is divisible by 7.
18. Determine the number of positive integers n where 1≤n≤100 and n is not divisible by2,3 or 5.
19. Which elements of the poset /({2,4,5,10,12,20,25},/) are maximal and which are minimal?
20. Let X={(1,2,3} and f,g,h and s be functions from X to X given by f={(1,2),(2,3),(3,1)},
g={(1,2),(2,1),(3,3)}, h={(1,1),(2,2),(3,1) and s={(1,1),(2,2),(3,3)}.
78
9. What is the Cardinality of the Power set of the set {0, 1, 2}.
a) 8 b) 6 c) 7 d) 9
Answer: a
10. The members of the set S = {x | x is the square of an integer and x < 100} is-----
a) {0, 2, 4, 5, 9, 58, 49, 56, 99, 12} b) {0, 1, 4, 9, 16, 25, 36, 49, 64, 81}
c) {1, 4, 9, 16, 25, 36, 64, 81, 85, 99} d) {0, 1, 4, 9, 16, 25, 36, 49, 64, 121}
Answer: b
11. Let R be the relation on the set of people consisting of (a,b) where aa is the parent of b. Let S
be the relation on the set of people consisting of (a,b) where a and b are siblings. What are S∘R
and R∘S?
A) (a,b) where a is a parent of b and b has a sibling; (a,b) where a is the aunt or uncle of b.
B) (a,b) where a is the parent of b and a has a sibling; (a,b) where a is the aunt or uncle of b.
C) (a,b) where a is the sibling of b's parents; (a,b) where aa is b's niece or nephew.
D) (a,b) where a is the parent of b; (a,b) where a is the aunt or uncle of b.
12. On the set of all integers, let (x,y)∈R(x,y)∈R iff xy≥1xy≥1. Is relation R reflexive,
symmetric, antisymmetric, transitive?
A) Yes, No, No, Yes B) No, Yes, No, Yes
C) No, No, No, Yes D) No, Yes, Yes, Yes E) No, No, Yes, No
13. Let R be a non-empty relation on a collection of sets defined by ARB if and only if A∩ B
= ØThen (pick the TRUE statement)
A.R is relexive and transitive B.R is symmetric and not transitive
C.R is an equivalence relation D.R is not relexive and not symmetric
Option: B
14. Consider the divides relation, m | n, on the set A = {2, 3, 4, 5, 6, 7, 8, 9, 10}. The cardinality
of the covering relation for this partial order relation (i.e., the number of edges in the Hasse
diagram) is
(a) 4 (b) 6 (c) 5 (d) 8 (e) 7
Ans:e
15. Consider the divides relation, m | n, on the set A = {2, 3, 4, 5, 6, 7, 8, 9, 10}. Which of the
following permutations of A is not a topological sort of this partial order relation?
(a) 7,2,3,6,9,5,4,10,8 (b) 2,3,7,6,9,5,4,10,8
(c) 2,6,3,9,5,7,4,10,8 (d) 3,7,2,9,5,4,10,8,6
(e) 3,2,6,9,5,7,4,10,8
Ans:c
16. Let A = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} and consider the divides relation
on A. Let C denote the length of the maximal chain, M the number of maximal elements, and
m the number of minimal elements. Which is true?
(a) C = 3, M = 8, m = 6 (b) C = 4, M = 8, m = 6
(c) C = 3, M = 6, m = 6 (d) C = 4, M = 6, m = 4
(e) C = 3, M = 6, m = 4
Ans:a
17. What is the smallest N > 0 such that any set of N nonnegative integers must have two distinct
integers whose sum or difference is divisible by 1000?
(a) 502 (b) 520 (c) 5002 (d) 5020 (e) 52002
Ans:a
18. Let R and S be binary relations on a set A. Suppose that R is reflexive, symmetric, and transitive and
that S is symmetric, and transitive but is not reflexive. Which statement is always true for any such R
and S?
(a) R ∪ S is symmetric but not reflexive and not transitive.
(b) R ∪ S is symmetric but not reflexive.
(c) R ∪ S is transitive and symmetric but not reflexive
79
(d) R ∪ S is reflexive and symmetric. (e) R ∪ S is symmetric but not transitive.
Ans:d
19. Let R be a relation on a set A. Is the transitive closure of R always equal to the transitive
closure of R2? Prove or disprove.
Solution: Suppose A = {1, 2, 3} and R = {(1, 2),(2, 3)}. Then R2 = {(1, 3)}.
Transitive closure of R is R∗ = {(1, 2),(2, 3),(1, 3)}.
Transitive closure of R2 is {(1, 3)}.
They are not always equal.
20. Suppose R1 and R2 are transitive relations on a set A. Is the relation R1 ∪ R2 necessariy a
transitive relation? Justify your answer.
Solution: No. {(1, 2)} and {(2, 3)} are each transitive relations, but their union
{(1, 2),(2, 3)} is not transitive.
21. Let D30 = {1, 2, 3, 4, 5, 6, 10, 15, 30} and relation I be partial ordering on D30. The all lower
bounds of 10 and 15 respectively are
A.1,3 B.1,5 C.1,3,5 D.None of these Option: B
22. Hasse diagrams are drawn for
A.partially ordered sets B.lattices C.boolean Algebra D.none of these
Option: D
23. A self-complemented, distributive lattice is called
A.Boolean algebra B.Modular lattice C.Complete lattice D.Self dual lattice
Option: A
24. Let D30 = {1, 2, 3, 5, 6, 10, 15, 30} and relation I be a partial ordering on D30. The lub of
10 and 15 respectively is
A.30 B.15 C.10 D.6 Option: A
25: Let X = {2, 3, 6, 12, 24}, and ≤ be the partial order defined by X ≤ Y if X divides Y.
Number of edges in the Hasse diagram of (X, ≤ ) is
A.3 B.4 C.5 D.None of these
Option: B
26. Principle of duality is defined as
A.≤ is replaced by ≥ B.LUB becomes GLB
C.all properties are unaltered when ≤ is replaced by ≥
D.all properties are unaltered when ≤ is replaced by ≥ other than 0 and 1 element.
Option: D
27. Different partially ordered sets may be represented by the same Hasse diagram if they are
A.same B.lattices with same order C.isomorphic D.order-isomorphic
Option: D
28. The absorption law is defined as
A.a * ( a * b ) = b B.a * ( a ⊕ b ) = b C.a * ( a * b ) = a ⊕ b D.a * ( a ⊕ b ) = a
Option: D
29. A partial order is deined on the set S = {x, a1, a2, a3,...... an, y} as x ≤ a i for all i and ai
≤ y for all i, where n ≥ 1. Number of total orders on the set S which contain partial
order ≤ is
A.1 B.n C.n + 2 D.n ! Option: D
30. Let L be a set with a relation R which is transitive, antisymmetric and reflexive and for
any two elements a, b ∈ L. Let least upper bound lub (a, b) and the greatest lower
bound glb (a, b) exist. Which of the following is/are TRUE ?
A.L is a Poset B.L is a boolean algebra C.L is a lattice D.none of these
Option: C
80
UNIT-3
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
Commutative: ∗ is a binary operation in a set S. If for a, b ∈ S, a ∗ b = b ∗ a, then ∗ is said to be
commutative in S. This is called commutative law.
Associative: ∗ is a binary operation in a set S. If for a, b, c ∈ S, (a∗b)∗c = a∗(b∗c), then ∗ is said to
be associative in S. This is called associative law.
Distributive: ◦, ∗ are binary operations in S. If for a, b, c ∈ S, (i) a ◦ (b ∗ c) = (a ◦ b) ∗ (a ◦ c), (ii)
(b ∗ c) ◦ a = (b ◦ a) ∗ (c ◦ a), then ◦ is said to be distributive w.r.t the operation ∗.
Example: N is the set of natural numbers.
(i) +, · are binary operations in N, since for a, b ∈ N, a + b ∈ N and a · b ∈ N. In
other words N is said to be closed w.r.t the operations + and ·.
(ii) +, · are commutative in N, since for a, b ∈ N, a + b = b + a and a · b = b · a.
(iii) +, · are associative in N, since for a, b, c ∈ N,
a + (b + c) = (a + b) + c and a · (b · c) = (a · b) · c.
(iv) is distributive w.r.t the operation + in N, since for a, b, c ∈ N, a · (b + c) = a · b + a ·
c and (b + c) · a = b · a + c · a.
(v) The operations subtraction (−) and division (÷) are not binary operations in N, since
3
for 3, 5 ∈ N does not imply 3 − 5 ∈ N and 5 ∈ N.
Example: A is the set of even integers.
(i) +, · are binary operations in A, since for a, b ∈ A, a + b ∈ A and a · b ∈ A.
(i) +, · are commutative in A, since for a, b ∈ A, a + b = b + a and a · b = b · a.
(ii) +, · are associative in A, since for a, b, c ∈ A,
a + (b + c) = (a + b) + c and a · (b · c) = (a · b) · c.
(iv) · is distributive w.r.t the operation + in A, since for a, b, c ∈ A, a ·
(b + c) = a · b + a · c and (b + c) · a = b · a + c · a.
81
Example: Let S be a non-empty set and ◦ be an operation on S defined by a ◦ b = a for a, b ∈ S.
Determine whether ◦ is commutative and associative in S.
Solution: Since a ◦ b = a for a, b ∈ S and b ◦ a = b for a, b ∈ S.
⇒ 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
=a + b − ab + c − ac − bc + abc
and
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.
82
d ◦ d = (c ◦ b) ◦ (c ◦ b)
=c ◦ (b ◦ c) ◦ b
=c ◦ c ◦ b
=c ◦ (c ◦ b)
=c ◦ d
=d
Hence, the required composition table is
◦ 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).
∴ (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.
If ◦ is a binary operation on G, then the algebraic structure is written as (G, ◦).
Example: (N, +), (Q, −), (R, +) are algebraic structures.
Semi Group
Definition: An algebraic structure (S, ◦) is called a semi group if the binary oper-ation ◦ is
associative in S.
That is, (S, ◦) is said to be a semi group if
(i) a, b ∈ S ⇒ a ◦ b ∈ S for all a, b ∈ S
(ii) (a ◦ b) ◦ c = a ◦ (b ◦ c) for all a, b, c ∈ S.
Example:
1. (N, +) is a semi group. For a, b ∈ N ⇒ a + b ∈ N and a, b, c ∈ N ⇒ (a + b) + c =a+ (b + c).
2. (Q, −) is not a semi group. For 5,3/2 , 1 ∈ Q does not imply (5 – 3/2 ) −1 = 5 −(3/2 −1).
3. (R, +) is a semi group. For a, b ∈ R ⇒ a + b ∈ R and a, b, c ∈ R ⇒ (a + b) + c = a+ (b + c).
83
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.
∴ ◦ is a binary operation in S. Let a, b, c ∈ S, a ◦ (b ◦ c) = a ◦ b = a
(a ◦ b) ◦ c = a ◦ c = a.
⇒ ◦ is associative in S.
∴ (S, ◦) is a semi group.
Example: The operation ◦ is defined by a ◦ b = a + b − ab for all a, b ∈ Z. Show that (Z, ◦) is a
semi group.
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)
=a + (b + c − bc) − a(b + c − bc)
=a + b + c − bc − ab − ac +
abc ⇒ (a ◦ b) ◦ c = a ◦ (b ◦ c).
⇒ ◦ is associative in Z. ∴ (Z, ◦) is 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: (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.
84
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)
=a − (b − c + bc) + a(b − cbc)
=a − b + c − bc + ab − ac + abc.
Therefore, (a ◦ b) ◦ c ≠ a ◦ (b ◦ c).
Example: Let (A, ∗) be a semi group. Show that for a, b, c in A if a ∗ c = c ∗ a and b ∗ c = c ∗ b,
then (a ∗ b) ∗ c = c ∗ (a ∗ b).
Solution: Given (A, ∗) be a semi group, a ∗ c = c ∗ a and b ∗ c = c ∗ b.
Consider
(a ∗ b) ∗ c = a ∗ (b ∗ c) [∵ A is seme group]
=a ∗ (c ∗ b) [∵ b ∗ c = c ∗ b]
=(a ∗ c) ∗ b [∵ A is seme group]
=(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.
Definition: A homomorphism of a semi-group into itself is called a semi-group en-domorphism.
Example: Let (S1, ∗1), (S2, ∗2) and (S3, ∗3) be semigroups and f : S1 → S2 and g : S2 → S3 be
homomorphisms. Prove that the mapping of g ◦ f : S1 → S3 is a semigroup 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)(a ∗1 b) = g[f(a ∗1 b)]
= g[f(a) ∗2 f(b)] (∵ f is a homomorphism)
= g(f(a)) ∗3 g(f(b)) (∵ g is a homomorphism)
=(g ◦ f)(a) ∗3 (g ◦ f)(b)
∴ 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.
85
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(a ∗ b) = f(a) ◦ f(b) and
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.
86
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
◦. An element a ∈ S is said to be invertible if there exists an element x∈ S such that a ◦ x = x ◦
a = e.
Note: The inverse of an invertible element is unique.
From the composition table, one can conclude
1. Closure Property: If all entries in the table are elements of S, then S closed under ◦.
2. Commutative Law: If every row of the table coincides with the corresponding column,
then ◦ is commutative on S.
3. Identity Element: If the row headed by an element a of S coincides with the top row, then a
is called the identity element.
4. Invertible Element: If the identity element e is placed in the table at the intersection of the
′ ′ ′ ′ −1 −1
row headed by a and the column headed by b , then b = a and a = b.
2
Example: A = {1, ω, ω }.
2
· 1 ω ω
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)
Identity Law: There exists e ∈ G such that a ◦ e = a = e ◦ a for every a ∈ G, e is called an
identity element in G.
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.
Example: The set Z of integers is a group w.r.t. usual addition.
(i). For a, b ∈ Z ⇒ a + b ∈ Z
(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
87
∴ 0 is the identity element in Z.
(iv). For a ∈ Z, there exists −a ∈ Z such that a + (−a) = (−a) + a = 0.
∴ −a is the inverse of a. (Z, +) is a
group.
Example: Give an example of a monoid which is not a group.
Solution: The set N of natural numbers w.r.t usual multiplication is not a group.
(i). For a, b ∈ N ⇒ a · b.
(ii). For a, b, c ∈ N, (a · b) · c = a · (b · c).
(iii). 1 ∈ N such that 1 · a = a · 1 = a, for all a ∈ N.
∴ (N, ·) is a monoid.
(iv). There is no n ∈ N such that a · n = n · a = 1 for a ∈ N.
∴ Inverse law is not true.
∴ The algebraic structure (N, ·) is not a group.
Example: (R, +) is a group, where R denote the set of real numbers.
Abelian Group (or Commutative Group): Let (G, ∗) be a group. If ∗ is com-mutative that is
a ∗ b = b ∗ a for all a, b ∈ G then (G, ∗) is called an Abelian group.
Example: (Z, +) is an Abelian group.
2 2
Example: Prove that G = {1, ω, ω } is a group with respect to multiplication where 1, ω, ω
are cube roots of unity.
Solution: We construct the composition table as follows:
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.
Each element of G is invertible
1. 1· 1 = 1 ⇒ 1 is its own inverse.
2 3 2 2
2. ω · ω = ω = 1 ⇒ ω is the inverse of ω and ω is the inverse of ω in G.
∴ (G, ·) is a group and a · b = b · a, ∀a, b ∈ G, that is commutative law holds in
G with respect to multiplication.
∴ (G, ·) is an abelian group.
88
Example: Show that the set G = {1, −1, i, −i} where i = 1 is an abelian group with respect
to multiplication as a binary operation. Solution: Let us construct the composition table:
· 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)
i · (−i) = 1 = −i · i ⇒ −i is the inverse of i in G.
−i · i = 1 = i · (−i) ⇒ i is the inverse of −i in G.
Hence inverse of every element in G exists.
Thus all the axioms of a group are satisfied.
Commutativity: a · b = b · a, ∀a, b ∈ G hold in G.
1 · 1 = 1 = 1 · 1; − 1 · 1 = −1 = 1 · −1
i · 1 = i = 1 · i; i · −i = −i · i = 1 etc.
Commutative law is satisfied.
Hence (G, ·) is an abelian group.
Example: Prove that the set Z of all integers with binary operation ∗ defined by a ∗ b = a + b
+ 1, ∀ a, b ∈ Z is an abelian group. Solution:
Closure: Let a, b ∈ Z. Since a + b ∈ Z and a + b + 1 ∈ Z.
∴ 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
89
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.
Existence of Identity: Let a ∈ Z. Let e ∈ Z such that e ∗ a = a ∗ e = a, i.e., a + e + 1
=a
⇒ e = −1
e = −1 is the identity element in Z.
Existence of Inverse: Let a ∈ Z. Let b ∈ Z such that a ∗ b = e.
⇒ 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.
∴ (Z, ∗) is an abelian group.
Example: Show that the set Q+ of all positive rational numbers forms an abelian group under
the composition defined by ◦ such that a ◦ b = ab/3 for a, b ∈ Q+. Solution: Q+ of the set of all
positive rational numbers and for a, b ∈ Q+, we have the operation ◦ such that a ◦ b = ab/3.
Associativity: a, b, c ∈ Q+⇒ (a ◦ b) ◦ c = a ◦ (b ◦ c).
Since ab∈ Q+ and ab/3∈ Q+.
Associativity: a, b, c ∈ Q+ ⇒ (a ◦ b) ◦ c = a ◦ (b ◦ c).
Since (a ◦ b) ◦ c = ( ab/3 ) ◦ c =[ab/3 .c]/3 = a/3( bc/3 ) = a/3 (b ◦ c) = a ◦ (b ◦ c).
Existence of Identity: Let a ∈ Q+. Let e ∈ Q+ such that e ◦ a = a.
i.e., ea/3 = a
⇒ ea − 3a = 0 ⇒ (e − 3)a = 0
⇒e−3=0 (∵ a ≠ 0)
⇒e=3
∴ e = 3 is the identity element in Q+.
Existence of Inverse: Let a ∈ Q+. Let b ∈ Q+ such that a ◦ b = e.
⇒ab/3 = 3
b = 9/a (∵ a ≠ 0)
∴ 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.
90
2. Consider the algebraic system (G, ∗), where G is the set of all non-zero real numbers and ∗
ab
is a binary operation defined by: a ∗ b = 4 , ∀a, b ∈ G. Show that (G, ∗) is an
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: 20 +6 5 = 1, since 20 + 5 = 25 = 4(6) + 1, i.e., 1 is the remainder when 20+5 is
divisible by 6.
Example: −15 +5 3 = 3, since −15 + 3 = −12 = 3(−5) + 3.
Multiplication modulo p
If a and b are any two integers, and r is the least non-negative reminder obtained by dividing
the ordinary product of a and b by p, then the Multiplication modulo p of a and b is r
symbolically
a ×p b = r, 0 ≤ r < p.
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.
Existence of Identity: Clearly 0 ∈ G is the identity element, since we have
0 +5 9 = 4 = 9 +5 0,∀ a ∈ G.
Existence of Inverse: Each element in G is invertible with respect to addition modulo 5.
0 is its own inverse; 4 is the inverse of 1 and 1 is the inverse of 4.
2 is the inverse of 3 and 3 is the inverse of 2 with respect to addition modulo 5 in G.
Commutativity: From the composition table it is clear that a+5 b = b+5 a, ∀ a, b ∈ G.
Hence (G, +5) is an abelian group.
91
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
G is an abelian group with usual addition as the operation. Solution: Let a, b, c ∈ G.
∴ We can take a = 2x, b = 2y, c = 2z, where x, y, z ∈ Z.
Closure: a, b ∈ G ⇒ a + b ∈ G.
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
Existence of Identity: a ∈ G, there exists 0 ∈ G such that a + 0 = 0 + a = a. Since a + 0 =
2x + 0 = 2x = a and 0 + a = 0 + 2x = 2x = a
∴ 0 is the identity in G.
Existence of Inverse: a ∈ G, there exists −a ∈ G such that a+(−a) = (−a)+a = 0.
Since a + (−a) = 2x + (−2x) = 0 and (−a) + a = (−2x) + 2x = 0.
∴ (G, +) is a group.
Commutativity: a, b ∈ G ⇒ a + b = b + a.
Since a + b = 2x + 2y = 2(x + y) = 2(y + x) = 2y + 2x = b + a.
∴ (G, +) is an abelian group.
92
a b
Example: Show that set G = {x| x = 2 3 for a, b ∈ Z} is a group under multipli-cation.
p q r s l m
Solution: Let x, y, z ∈ G. We can take x = 2 3 , y = 2 3 , z = 2 3 , where p, q, r, s, l, m ∈ Z.
We know that (i). p + r, q + s ∈ Z
(ii). (p + r) + l = p + (r + l), (q + s) + m = q + (s + m).
Closure: x, y ∈ G ⇒ x · y ∈ G.
p q r s p+r q+s
Since x · y = (2 3 )(2 3 ) = 2 3 ∈ G. Associativity: x, y, z ∈ G ⇒ (x · y) · z = x · (y · z)
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)
0 0
Existence of Identity: Let x ∈ G. We know that e = 2 3 ∈ G, since 0 ∈ Z.
p q 0 0 p+0 q+0 p q 0 0 p q p q
∴x·e=2 3 2 3 =2 3 = 2 3 = x and e · x = 2 3 2 3 = 2 3 = x. ∴ e ∈ G such
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 −p −q
∴ For every x = 2 3 ∈ G there exists y = 2 3 ∈ G such that x ·y = y ·x = e. ∴ (G, ·) is a
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.
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)
= (ace, (bc + d)e + f)
= (ace, bce + de + f)
Also (a, b) ∗ {(c, d) ∗ (e, f)} = (a, b) ∗ (ce, de + 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)
93
⇒ xa = a, ya + b = b
⇒ x = 1, (∵ a ≠ 0) and ya = 0 ⇒ x = 1 and y = 0 (∵ a ≠ 0)
⇒ (1, 0) ∈ G such that (a, b) ∗ (1, 0) = (a, b).
∴ (1, 0) is the identity in G.
Existence of Inverse: Let (a, b) ∈ G. Let (x, y) ∈ G such that (x, y) ∗ (a, b) = (1, 0)
⇒ (xa, ya + b) = (1, 0)
1 − b
⇒ xa = 1, ya + b = 0 ⇒ x = a , y = a
∴ The inverse of (a, b) exits and it is (1/a,-b/a ).
Commutativity: Let (a, b), (c, d) ∈ G ⇒ (a, b) ∗ (c, d) ≠ (c, d) ∗ (a, b)
Since (a, b) ∗ (c, d) = (ac, bc + d) and (c, d) ∗ (a, b) = (ca, da + b).
∴ G is a group but not commutative group w.r.t ∗.
−1 −1 −1
Example: If (G, ∗) is a group then (a ∗ b) =b ∗a for all a, b ∈ G.
Solution: Let a, b ∈ G and e be the identity element in G.
−1 −1 −1 −1 −1 −1
Let a ∈ G ⇒ a ∈ G such that a∗a =a ∗a=e and b∈ G ⇒ b ∈ G such that b∗b =b ∗b=
e.
−1
Now a, b ∈ G ⇒ a ∗ b ∈ G and (a ∗ b) ∈ G.
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]
−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
3. If (G, +) is a group, then −(a + b) = (−b) + (−a)
4. −(a + b + c) = (−c) + (−b) + (−a).
94
Theorem: Cancelation laws hold good in G, i.e., for all a, b, c ∈ G a ∗ b = a ∗ c ⇒ b = c (left
cancelation law) b ∗ a = c ∗ a ⇒ b = c (right cancelation law).
Proof: G is a group. Let e be the identity element in G.
−1 −1 −1
a∈G⇒a ∈ G such that a ∗ a =a ∗ a = e.
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)
⇒ b = c (e is the identity element in G)
Note:
1. If G is an additive group, a + b = a + c ⇒ b = c and b + a = c + a ⇒ b = c.
2. In a semi group cancelation laws may not hold. Let S be the set of all 2 × 2 matrices over
integers and let matrix multiplication be the binary operation defined on S. Then S is a semi
group of the above operation.
1 0 0 0 0 0
If A= ; B= ;C= , then A, B, C ∈ S and AB = AC, we observe that left
0 0 0 1 1 0
cancellation law is not true in the semi group.
3. (N, +) is a semi group. For a, b, c ∈ N
a + b = a + c ⇒ b + c and b + a = c + a ⇒ b = c.
But (N, +) is not a group.
In a semigroup even if cancellation laws holds, then semigroup is not a group.
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
−1
(ab) = ab
−1 −1
⇒b a = ab
⇒ ba = ab
∴ G is an abelian group.
95
Note: The converse of the above not true.
For example, (R, +), where R is the set of real numbers, is abelian group, but no element
except 0 is its own inverse.
2
Example: Prove that if a = a, then a = e, a being an element of a group G.
2
Solution: Let a be an element of a group G such that a = a. To prove that a = e.
2
a = a ⇒ aa = a
−1 −1 −1
⇒ (aa)a = aa ⇒ a(aa ) = e
−1
⇒ ae = e [∵ aa = e] ⇒ a = e [∵ ae = a]
2
Example: In a group G having more than one element, if x = x, for every x ∈ G.
Prove that G is abelian.
2 2 2
Solution: Let a, b ∈ G. Under the given hypothesis, we have a = a, b = b, (ab) = ab.
2 2 2
∴ a(ab)b = (aa)(bb) = a b = ab = (ab) = (ab)(ab) = a(ba)b
⇒ ab = ba (Using cancelation laws)
∴ G is abelian.
2 2 2
Example: Show that in a group G, for a, b ∈ G, (ab) = a b ⇔ G is abelian. (May. 2012)
2 2 2
Solution: Let a, b ∈ G, and (ab) = a b . To prove that G is abelian.
Then
2 2 2
(ab) = a b
⇒ (ab)(ab) = (aa)(bb)
⇒ a(ba)b = a(ab)b (by Associative law) ⇒ ba = ab, (by cancellation
laws)
⇒ G is abelian.
2 2 2
Conversely, let G be abelian. To prove that (ab) = a b .
2 2 2
Then (ab) = (ab)(ab) = a(ba)b = a(ab)b = (aa)(bb) = a b .
***Example: If a, b are any two elements of a group (G, ·), which commute. Show that
−1
1. a and b commute
−1
2. b and a commute
−1 −1
3. a and b commute.
Solution: (G, ·) is a group and such that ab = ba.
−1 −1
1. ab = ba ⇒ a (ab) = a (ba)
−1 −1
⇒ (a a)b = a (ba)
−1
⇒ eb = (a b)a
−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
96
−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 2 3
1 = 1 = 1 = · · · = 1 ⇒ O(1) = 1.
2 4 6
(−1) = (−1) = (−1) = · · · = 1 ⇒ O(−1) = 2.
4 8 12
i =i =i = · · · = 1 ⇒ O(i) = 4.
4 8
(−i) = (−i) = · · · = 1 ⇒ O(−i) = 4.
5
Example: In a group G, a is an element of order 30. Find order of a .
Solution: Given O(a) = 30
30 5
⇒a = e, e is the identity element of G. Let O(a ) = n
5 n
⇒ (a ) = e
5n
⇒a = e, where n is the least positive integer. Hence 30 is divisor of 5n.
∴ 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, +).
97
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
∴ (Z6, +6) is a group.
H= {0, 2, 4}.
+6 0 2 4
0 0 2 4
2 2 4 0
4 4 0 2
98
Since (H, ∗) is a group, by closure property we have a, b ∈ H ⇒ ab ∈ H.
−1
Also, by inverse property a ∈ H ⇒ a ∈ H.
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, ×).
Solution: Identity element in S is (1, 0). Clearly (1, 0) ∈ H.
Inverse of (a, b) in S is (1/a,-b/a ) (∵ a ≠ 0)
Inverse of (1, c) in S is (1, -c/1 ), i.e., (1, −c)
−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) = (1, b − c) ∈ H (∵ b − c ∈ R)
−1
∴ (1, b), (1, c) ∈ H ⇒ (1, b) × (1, c) ∈ H ∴ H is a
subgroup of (S, ×).
Note: (1, b) × (1, c) = (1.1, b.1 + c)
=(1, b + c)
=(1, c + b)
=(1, c) × (1, b)
∴ H is an abelian subgroup of the non-abelian group (S, ×).
Theorem: If H1 and H2 are two subgroups of a group G, then H1 ∩ H2 is also a subgroup of
G.
Proof: Let H1 and H2 be two subgroups of a group G.
Let e be the identity element in G.
∴ e ∈ H1 and e ∈ H2. ∴ e ∈ H1 ∩
H2.
⇒ H1 ∩ H2 ≠ ϕ.
Let a ∈ H1 ∩ H2 and b ∈ H1 ∩ H2.
99
∴ a ∈ H1, a ∈ H2 and b ∈ H1, b ∈ H2.
−1
Since H1 is a subgroup, a ∈ H1 and b ∈ H1 ⇒ ab ∈ H1.
−1
Similarly ab ∈ H2.
−1
∴ ab ∈ H1 ∩ H2.
−1
Thus we have, a ∈ H1 ∩ H2, b ∈ H1 ∩ H2 ⇒ ab ∈ H1 ∩ H2.
∴ 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.
Solution: Since e ∈ G and ey = ye, for all y ∈ G. It follows that e ∈ Z.
Therefore Z is non-empty.
Take any a, b ∈ Z and any y ∈ G. Then
(ab)y = a(by)
=a(yb), since b ∈ Z, by = yb
=(ay)b
=(ya)b
=y(ab)
This show that ab ∈ Z.
Let a ∈ Z ⇒ ay = ya for all y ∈ G.
−1 −1 −1 −1
⇒ a (ay)a = a (ya)a
−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.
This subgroup is called the center of G.
Homomorphism
′
Homomorphism into: Let (G, ∗) and (G , ·) be two groups and f be a mapping from G into
′ ′
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 .
Also then G′ is said to be a homomorphic image of G. We write this as f(G) G′.
′ ′
Isomorphism: Let (G, ∗) and (G , ·) be two groups and f be a one-one mapping of G onto G .
′
If for a, b ∈ G, f(a ∗ b) = f(a) · f(b), then f is said to be an isomorphism from G onto G .
Endomorphism: A homomorphism of a group G into itself is called an endomor-phism.
Monomorphism: A homomorphism into is one-one, then it is called an monomor-phism.
Epimorphism: If the homomorphism is onto, then it is called epimorphism.
Automorphism: An isomorphism of a group G into itself is called an automorphism.
100
′
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 .
x y ′ x y ′
Solution: Since x, y ∈ G ⇒ x + y ∈ G and 2 , 2 ∈ G ⇒ 2 · 2 ∈ G .
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 .
∴ f(ab) = log10 ab = log10 a + log10 b = f(a) + f(b).
′
⇒ f is a homomorphism from G into G .
Let x1, x2 ∈ G and f(x1) = f(x2)
⇒ log10 x1 = log10 x2
⇒ 10
log x log x
10 1
= 10 10 2
⇒ x1 = x2
⇒ f is one-one.
y y
⇒ f(10 ) = log10(10 ) = y.
′ y y
∴ For ever y ∈ G , there exists 10 ∈ G such that f(10 ) = 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
⇒a=b
Thus f is one-one.
+ log c
f is onto: If c ∈ R then log c ∈ R and f(log c) = e =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.
101
−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.
⇒ b−1a−1 = a−1b−1
−1 −1 −1
⇒ (ab) =a b
⇒ (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.
102
Number Theory
Properties of Integers
Let us denote the set of natural numbers (also called positive integers)by N and the set of
integers by Z.
i.e., N = {1, 2, 3...} and Z = {...., −2, −1, 0, 1, 2...}.
The following simple rules associated with addition and multiplication of these inte-gers are
given below:
(a). Associative law for multiplication and addition
(a + b) + c = a + (b + c) and (ab)c = a(bc), for all a, b, c ∈ Z.
(b). Commutative law for multiplication and addition a + b = b + a and ab = ba, for all a, b ∈
Z.
(c). Distritbutive law a(b + c) = ab + ac and (b + c)a = ba + ca, for all a, b, c ∈ Z.
(d). Additive identity 0 and multiplicative identity 1
a + 0 = 0 + a = a and a.1 = 1.a = a, for all a ∈ Z.
(e). Additive inverse of −a for any integer a
a + (−a) = (−a) + a = 0.
Definition: Let a and b be any two integers. Then a is said to be greater than b if a − b is
positive integer and it is denoted by a > b. a > b can also be denoted by b < a.
103
∴ c = bq2 = (aq1)q2 = a(q1q2) = aq, where q = q1q2 ∈ Z. ⇒ a/c.
(iii). We have a/b ⇒ b = aq1, where q1 ∈ Z.
a/c ⇒ c = aq2, where q2 ∈ Z.
Now b + c = aq1 + aq2 = a(q1 + q2) = aq, where q = q1 + q2 ∈ Z.
⇒ a/b + c.
Also, b − c = aq1 − aq2 = a(q1 − q2) = aq, where q = q1 − q2 ∈ Z.
⇒ a/b − c.
(iv). We have a/b ⇒ b = aq, where q ∈ Z.
For any integer m, bm = (aq)m = a(qm) = aq, where a = qm ∈ Z.
⇒ a/bm.
(v). We have a/b ⇒ b = aq1, where q1 ∈ Z.
a/c ⇒ c = aq2, where q2 ∈ Z.
Now bm + cn = (aq1)m + (aq2)n = a(q1m + q2n) = aq, where q = q1m + q2n ∈ Z
⇒ a/mb + cn.
(vi). We have a/b ⇒ b = aq1, where q1 ∈ Z.
b/a ⇒ a = bq2, where q2 ∈ Z.
∴ b = aq1 = (bq2)q1 = b(q2q1)
⇒ b(1 − q2q1) = 0
q2q1 = 1 ⇒ q2 = q1 = 1 or q2 = q1 = −1
∴ a = b or a = −b i.e., a ± b. (vii). We have a/b ⇒ b
= aq1, where q1 ∈ Z.
a/b + c ⇒ b + c = aq2, where q2 ∈ Z
Now, c = b − aq2 = aq1 − aq2 = a(q1 − q2) = aq, where q = q1 − q2 ∈ Z.
⇒ a/c.
(viii). We have a/b ⇒ b = aq1, where q1 ∈ Z.
Since m ≠ 0, mb = m(aq1) = ma(q1)
⇒ ma/mb.
Greatest Common Divisor (GCD)
Common Divisor: A non-zero integer d is said to be a common divisor of integers a and b if
d/a and d/b.
Example:
(1). 3/ − 15 and 3/21 ⇒ 3 is a common divisor of 15, 21.
(2). ±1 is a common divisor of a, b, where a, b ∈ Z.
104
Greatest Common Divisor: A non-zero integer d is said to be a greatest common divisor
(gcd) of a and b if
(i). d is a common divisor of a and b; and
(ii). every divisor of a and b is a divisor of d.
We write d = (a, b)=gcd of a, b.
Example: 2, 3 and 6 are common divisors of 18, 24.
Also 2/6 and 3/6. Therefore 6 = (18, 24).
Relatively Prime: Two integers a and b are said to be relatively prime if their greatest
common divisor is 1, i.e., gcd(a, b)=1.
Example: Since (15, 8) = 1, 15 and 8 are relatively prime.
Note:
(i). If a, b are relatively prime then a, b have no common divisors.
(ii). a, b ∈ Z are relatively prime iff there exists x, y ∈ Z such that ax + by = 1.
Basic Properties of Greatest Common Divisors:
(1). If c/ab and gcd(a, c) = 1 then c/b.
Solution: We have c/ab ⇒ ab = cq1, q1 ∈ Z.
(a, c) = 1 ⇒ there exist x, y ∈ Z such that
ax + cy = 1.
ax + cy = 1 ⇒ b(ax + cy) = b
⇒ (ba)x + b(cy) = b ⇒ (cq1)x + b(cy) = b ⇒ c[q1x + by] = b
⇒ cq = b, where q = q1x + by ∈ Z ⇒ c/b.
105
∴ (ka, kb) = kd = k(a, b)
a b
(4). If (a, b) = d, then ( d , d ) = 1.
Solution: Since (a, b) = d ⇒ there exist x, y ∈ Z such that ax + by = d.
⇒( ax+by)/d = 1
⇒ (a/d)x + (b/d)y = 1
Since d is a divisor of both a and b, a/d and b/d are both integers.
Hence (a/d,b/d) = 1.
Proof:
Consider the set, S, of all numbers of the form a+nd, where n is an integer.
S = {a - nd : n is an integer}
S contains at least one nonnegative integer, because there is an integer, n, that ensures a-nd ≥
0, namely
Now, by the well-ordering principle, there is a least nonnegative element of S, which we will
call r, where r=a-nd for some n. Let q = (a-r)/d = (a-(a-nd))/d = n. To show that r < |d|,
suppose to the contrary that r ≥ |d|. In that case, either r-|d|=a-md, where m=n+1 (if d is
positive) or m=n-1 (if d is negative), and so r-|d| is an element of S that is nonnegative and
smaller than r, a contradiction. Thus r < |d|.
To show uniqueness, suppose there exist q,r,q',r' with 0 ≤ r,r' < |d|
Subtracting these equations gives d(q'-q) = r'-r, so d|r'-r. Since 0 ≤ r,r' < |d|, the difference r'-r
must also be smaller than d. Since d is a divisor of this difference, it follows that the
difference r'-r must be zero, i.e. r'=r, and so q'=q.
106
Euclidean Algorithm for finding the GCD
An efficient method for finding the greatest common divisor of two integers based on the
quotient and remainder technique is called the Euclidean algorithm. The following lemma
provides the key to this algorithm.
Lemma: If a = bq + r, where a, b, q and r are integers, then gcd(a, b)=gcd(b, r).
Statement: When a and b are any two integers (a > b), if r1 is the remainder when a is
divided by b, r2 is the remainder when b is divided by r1, r3 is the remainder when r1 is
divided by r2 and so on and if rk+1 = 0, then the last non-zero remainder rk is the gcd(a, b).
Proof:
Consider now, a sequence of divisions, beginning with a divided by b giving quotient q1 and
remainder b1, then b divided by b1 giving quotient q2 and remainder b2, etc.
a=bq1+b1,
b=b1q2+b2,
b1=b2q3+b3,
...
bn-2=bn-1qn+bn,
bn-1=bnqn+1
In this sequence of divisions, 0 ≤ b1 < |b|, 0 ≤ b2 < |b1|, etc., so we have the sequence
|b| > |b1| > |b2| > ... ≥ 0. Since each b is strictly smaller than the one before it, eventually one
of them will be 0. We will let bn be the last non-zero element of this sequence.
From the last equation, we see bn | bn-1, and then from this fact and the equation before it, we
see that bn | bn-2, and from the one before that, we see that bn | bn-3, etc. Following the chain
backwards, it follows that bn | b, and bn | a. So we see that bn is a common divisor of a and b.
To see that bn is the greatest common divisor of a and b, consider, d, an arbitrary common
divisor of a and b. From the first equation, a-bq1=b1, we see d|b1, and from the second,
equation, b-b1q2=b2, we see d|b2, etc. Following the chain to the bottom, we see that d|bn.
Since an arbitrary common divisor of a and b divides bn, we see that bn is the greatest
common divisor of a and b.
107
Example: Find the gcd of 826, 1890.
Solution: By Euclid Algorithm for 826 and 1890, we have
1890= 2.826+ 238,r1= 238
826= 3.238+ 112,r2= 112
238= 2.112+ 14,r3 = 14
112= 8.14 + 0, r4 = 0
∴ r3 = 14 is the last non-zero remainder. ∴ d = (826, 1890) = 14.
****Example: Find the gcd of 615 and 1080, and find the integers x and y such that gcd(615,
1080) = 615x + 1080y.
Solution: By Euclid Algorithm for 615 and 1080, we have
1080 = 1.615 + 465, r1 = 465 − − − − − (1)
615 = 1.465 + 150, r2 = 150 − − − − − (2)
465 = 3.150 + 15, r3 = 15 − − − − − −(3)
150 = 10.15 + 0, r4 = 0 − − − − − − − (4)
∴ r3 = 15 is the last non-zero remainder.
∴ d = (615, 1080) = 15. Now, we find x and y such that
615x + 1080y = 15.
To find x and y, we begin with last non-zero remainder as follows.
d = 15 = 465 + (−3).150; using (3)
In other words, if a and b are positive integers, then the smallest positive integer that is
divisible by both a and b is called the least common multiple of a and b and is denoted by
lcm(a, b).
Note: If either or both of a and b are negative then lcm(a, b) is always positive.
Example: lcm(5, -10)=10, lcm(16, 20)=80.
109
Prime Numbers
Definition: An integer n is called prime if n > 1 and if the only positive divisors of n are 1
and n. If n > 1 and if n is not prime, then n is called composite.
Examples: The prime numbers less than 100 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97.
Theorem: Every integer n > 1 is either a prime number or a product of prime numbers.
Proof: We use induction on n. The theorem is clearly true for n = 2. Assume it is true for
every integer < n. Then if n is not prime it has a positive divisor d ≠ 1, d ≠ n. Hence n = cd,
where c ≠ n. But both c and d are < n and > 1 so each of c, d is a product of prime numbers,
hence so is n.
Proof:
There are two things to be proved. Both parts of the proof will use he Well-ordering
Principle for the set of natural numbers.
(1) We first prove that every a > 1 can be written as a product of prime factors. (This
includes the possibility of there being only one factor in case a is prime.)
Suppose bwoc that there exists a integer a > 1 such that a cannot be written as a product of
primes.
By the Well-ordering Principle, there is a smallest such a.
Then by assumption a is not prime so a = bc where 1 < b, c < a.
So b and c can be written as products of prime factors (since a is the smallest positive
integer than cannot be.)
But since a = bc, this makes a a product of prime factors, a contradiction.
(2) Now suppose bwoc that there exists an integer a > 1 that has two different prime
factorizations, say a = p1 ··· ps = q1 ··· qt , where the pi and qj are all primes. (We allow
repetitions among the pi and qj . That way, we don‘t have to use exponents.)
Then p1| a = q1 ··· qt . Since p1 is prime, by the Lemma above, p1| qj for some j .
Since qj is prime and p1 > 1, this means that p1 = qj .
For convenience, we may renumber the qj so that p1 = q1 .
We can now cancel p1 from both sides of the equation above to get p2 ··· ps = q2 ··· qt . But
p2 ··· ps < a and by assumption a is the smallest positive integer with a non–unique prime
factorization.
It follows that s = t and that p2,...,ps are the same as q2,...,qt , except possibly in a different
order.
But since p1 = q1 as well, this is a contradition to the assumption that these were two
different factorizations.
Thus there cannot exist such an integer a with two different factorizations
4
Example: Find the prime factorisation of 81, 100 and 289. Solution: 81 = 3 × 3 × 3 × 3 = 3
110
2 2
100 = 2 × 2 × 5 × 5 = 2 × 5
2
289 = 17 × 17 = 17 .
a a a b b b
Theorem: Let m = p1 1 p2 2 ...pk k and n = p1 1 p2 2 ...pk k . Then
min(a ,b )
gcd(m, n) = p1 1 1 × p2min(a2,b2) × ... × pkmin(ak,bk)
=∏ min(ai,bi)
pi , where min(a, b) represents the minimum of the two numbers a and b.
max(a ,b ) max(a ,b )
lcm(m, n) = p1 1 1 × p2 2 2 × ... × pkmax(ak,bk)
=∏ max(ai,bi)
pi , where max(a,b) represents the maximum of the two numbers a and b.
Theorem: If a and b are two positive integers, then gcd(a, b).lcm(a, b) = ab.
(a +b ) (a +b ) (a +b )
=p1 1 1
.p2 2 2
...pk k k
a1 a2 ak b1 b2 b
=( p1 p2 ...pk )( p1 p2 ...pk k)
=ab.
Example: Use prime factorisation to find the greatest common divisor of 18 and 30.
Solution: Prime factorisation of 18 and 30 are
1 2 0 1 1 1
18 = 2 × 3 × 5 and 30 = 2 × 3 × 5 .
gcd(18, 30) = 2min(1,1) × 3min(2,1) × 5min(0,1)
1 1 0
=2 × 3 × 5
=2 × 3 × 1
=6.
Example: Use prime factorisation to find the least common multiple of 119 and 544.
Solution: Prime factorisation of 119 and 544 are
0 1 1 5 0 1
119 = 2 × 7 × 17 and 544 = 2 × 7 × 17 .
111
(i). (231, 1575) (ii). (337500, 21600). Verify also gcd(m, n). lcm(m, n) = mn.
112
Example: Determine whether the integer 113 is prime or not.
2
Solution: Note that 2 does not divide 113. We now find all odd primes p such that p ≤ 113.
2 2
These primes are 3, 5 and 7, since 7 < 113 < 11 .
None of these primes divide 113.
Hence, 113 is a prime.
a≡ b(mod m)
m is called the modulus of the congruence, b is called the residue of a(mod m). If a is not
congruent to b modulo m, then it is denoted by a ̸≡b(mod m).
Example:
(i). 89 ≡ 25(mod 4), since 89-25=64 is divisible by 4. Consequently 25 is the residue of
89(mod 4) and 4 is the modulus of the congruent.
(ii). 153 ≡ −7(mod 8), since 153-(-7)=160 is divisible by 8. Thus -7 is the residue of
153(mod 8) and 8 is the modulus of the congruent.
(iii). 24 ̸≡3(mod 5), since 24-3=21 is not divisible by 5. Thus 24 and 3 are incon-gruent
modulo 5
Note: If a ≡ b(mod m) ⇔ a − b = mk, for some integer k
⇔ a = b + mk, for some integer k.
Properties of Congruence
Property 1: The relation ‖Congruence modulo m‖ is an equivalence relation. i.e., for all
integers a, b and c, the relation is
Proof: (i). Let a be any integer. Then a − a = 0 is divisible by any fixed positive integer m.
Thus a ≡ a(mod m).
113
∴ The congruence relation is reflexive.
(ii). Given a ≡ b(mod m)
⇒ a − b is divisible by m ⇒ −(a − b) is
divisible by m ⇒ b − a is divisible by
m
i.e., b ≡ a(mod m).
Hence the congruence relation is symmetric.
(iii). Given a ≡ b(mod m) and b ≡ c(mod m)
⇒ a − b is divisible of m and b − c is divisible by m. Hence (a −
b) + (b − c) = a − c is divisible by m
i.e., a ≡ c(mod m)
⇒ The congruence relation is transitive.
Hence, the congruence relation is an equivalence relation.
Property 2: If a ≡ b(mod m) and c is any integer, then
(i). a ± c ≡ b ± c(mod m)
(ii). ac ≡ bc(mod m).
Proof:
(i). Since a ≡ b(mod m) ⇒ a − b is divisible by m.
Now (a ± c) − (b ± c) = a − b is divisible by m.
∴ a ± c ≡ b ± c(mod m).
(ii). Since a ≡ b(mod m) ⇒ a − b is divisible by m.
Now, (a − b)c = ac − bc is also divisible by m.
∴ ac ≡ bc(mod m).
Note: The converse of property (2) (ii) is not true always.
Property 3: If ac ≡ bc(mod m), then a ≡ b(mod m) only if gcd(c,m) = 1. In fact, if c is an
m
integer which divides m, and if ac ≡ bc(mod m), then a ≡ b mod[ ]
gcd(c, m)
Proof: Since ac ≡ bc(mod m) ⇒ ac − bc is divisible by m.
i.e., ac − bc = pm, where p is an integer.
m
⇒ a − b= p( )
c
m m
∴ a ≡ b[ mod ( )] , provided that is an integer.
c c
Since c divides m, gcd(c, m) = c.
m
Hence, a ≡ b mod [ ]
gcd(c, m)
But, if gcd(c, m) = 1, then a ≡ b(mod m).
Property 4: If a, b, c, d are integers and m is a positive integer such that a ≡ b(mod m) and c
≡ d(mod m), then
(i). a ± c ≡ b ± d(mod m)
(ii). ac ≡ bd(mod m)
n n
(iii). a ≡ b (mod m), where n is a positive integer.
114
Proof: (i). Since a ≡ b(mod m) ⇒ a − b is divisible by m.
Also c ≡ d(mod m) ⇒ c − d is divisible by m.
∴ (a − b) ± (c − d) is divisible by m. i.e., (a ± c) −
(b ± d) is divisible by m. i.e., a ± c ≡ b ± d(mod
m).
(ii). Since a ≡ b(mod m) ⇒ a − b is divisible by m.
∴ (a − b)c is also divisible by m.
∴ (c − d)b is also divisible by m.
∴ (a − b)c + (c − d)b = ac − bd is divisible by m. i.e., ac − bd is divisible by m.
i.e., ac ≡ bd(mod m)...........................(1)
(iii). In (1), put c = a and d = b. Then, we get
a2 ≡ b2(mod m)................(2)
Also a ≡ b(mod m)................(3)
3 3
Using the property (ii) in equations (2) and (3), we have a ≡ b (mod
m)
Proceeding the above process we get
n n
a ≡ b (mod m), where n is a positive integer.
Fermat’s Theorem
p−1 p−1
If p is a prime and (a, p) = 1 then a − 1 is divisible by p i.e., a ≡ 1 (mod p).
Proof
We offer several proofs using different techniques to prove the statement .
If , then we can cancel a factor of from both sides and retrieve the first version
of the theorem.
Proof by Induction
The most straightforward way to prove this theorem is by by applying the induction principle. We
fix as a prime number. The base case, , is obviously true. Suppose the
statement is true. Then, by the binomial theorem,
Note that divides into any binomial coefficient of the form for . This
115
Taken , all of the middle terms disappear, and we end up
with . Since we also know that ,
then , as desired.
Solution: By Fermat‘ s theorem, 5 is a prime number and 5 does not divide 3, we have
35−1≡ 1 (mod 5)
4
3 ≡ 1 (mod 5)
75
(34)75≡ 1 (mod 5)
3300≡ 1 (mod 5)
2
3302≡ 3 = 9 (mod 5)
201
Example: Using Fermat‘s theorem, find 3 (mod 11).
13332
Example: Using Fermat‘s theorem, prove that 4 ≡ 16 (mod 13331). Also, give an
example to show that the Fermat theorem is true for a composite integer. Solution:
(i). Since 13331 is a prime number and 13331 does not divide 4.
By Fermat‘s theorem, we have
13331−1
4 ≡ 1 (mod 13, 331)
13330
4 ≡ 1 (mod 13, 331)
13331
4 ≡ 4 (mod 13, 331)
13332
4 ≡ 16 (mod 13, 331)
(ii). Since 11 is prime and 11 does not divide 2.
116
By Fermat‘s theorem, we have
11−1
2 ≡ 1 (mod 11)
10
i.e., 2 ≡ 1 (mod 11)
10 34 34
(2 ) ≡ 1 (mod 11)
340
2 ≡ 1 (mod 11).............(1)
Also,
5
2 ≡ 1 (mod 31)
5 68 68
(2 ) ≡ 1 (mod 31)
340
2 ≡ 1 (mod 31).............(2)
ϕ(35) = ϕ(5 × 7)
1 1
= 35 (1 )(1 )
5 7
= 24
117
ϕ(n)
Euler’s Theorem: If a and n > 0 are integers such that (a, n) = 1 then a ≡ 1(mod n).
Proof:
Consider the elements r1 , r2 , …, r ( n ) of (Z/n) the congruence classes of integers that
are relatively prime to n.
For a (Z/n) the claim is that multiplication by a is a permutation of this set; that is,
the set { ar1 , ar2 , …, ar ( n ) } equals (Z/n). The claim is true because multiplication by a is a
function from the finite set (Z/n) to itself that has an inverse, namely multiplication by 1/a (mod n)
Now, given the claim, consider the product of all the elements of (Z/n), on one hand, it
is r1 r2 , …r ( n ) . On the other hand, it is ar1 ar2 …ar ( n ) . So these products are congruent
mod n
r1 r2 …r ( n ) ar1 ar2 …ar ( n )
r1 r2 …r ( n ) a (n) r1 r2 …r ( n )
1 a (n )
where, cancellation of the ri is allowed because they all have multiplicative inverses(mod n)
Example: Find the remainder 29202 when divided by 13.
Solution: We first note that (29,13)=1.
Hence we can apply Euler's Theorem to get that 29ϕ(13) ≡1(mod13).
Since 13 is prime, it follows that ϕ(13)=12, hence 2912≡1(mod13).
We can now apply the division algorithm between 202 and 12 as follows:
202=12(16)+10
Hence it follows that 29 =(29 ) ⋅2910≡(1)26⋅2910≡2910(mod13).
202 12 26
118
Example: Now, let us solve the question given at the beginning of the article using the
concept of Euler Number: What is the remainder of 192200002/23?
Solution: The Euler Number of the divisor i.e. 23 is 22, where 19 and 23 are co-prime.
Hence, the remainder will be 1 for any power which is of the form of 220000.
The given power is 2200002.
Dividing that power by 22, the remaining power will be 2.
Your job remains to find the remainder of 192/23.
As you know the square of 19, just divide 361 by 23 and get the remainder as 16.
119
Previous questions
1. a) Prove that a group consisting of three elements is an abelian group?
b) Prove that G={-1,1,i,-i} is an abelian group under multiplication?
2. a) Let G= {-1,0,1} . Verify that G forms an abelian group under addition?
b) Prove that the Cancellation laws holds good in a group G.?
3. Prove that the order of a-1 is same as the order of a.?
4. a) Explain in brief about fermats theorem?
b) Explain in brief about Division theorem?
c) Explain in brief about GCD with example?
5. Explain in brief about Euler’s theorem with examples?
6. Explain in brief about Principle of Mathematical Induction with examples?
7. Define Prime number? Explain in brief about the procedure for testing of prime numbers?
8. Prove that the sum of two odd integers is an even integer?
9. State Division algorithm and apply it for a dividend of 170 and divisor of 11.
201
10. Using Fermat’s theorem, find 3 mod 11.
1000
11. Use Euler’s theorem to find a number between 0 and 9 such that a is congruent to 7 (mod 10)
12. Find the integers x such that i) 5x≡4 (mod 3) ii) 7x≡6 (mod 5) iii) 9x≡8 (mod 7)
13. Determine GCD (1970, 1066) using Euclidean algorithm.
14. If a=1820 and b=231, find GCD (a, b). Express GCD as a linear combination of a and b.
7
15. Find 11 mod 13 using modular arithmetic.
120
10. 117 mod 13 =
a) 3 b) 7 c) 5 d) 15
Answer: d
11. The multiplicative Inverse of 1234 mod 4321 is
a) 3239 b) 3213 c) 3242 d) Does not exist
Answer: a
12. The multiplicative Inverse of 550 mod 1769 is
a) 434 b) 224 c) 550 d) Does not exist
Answer: a
13. The multiplicative Inverse of 24140 mod 40902 is
a) 2355 b) 5343 c) 3534 d) Does not exist
Answer: d
14. GCD(a,b) = GCD(b,a mod b)
a) True b) False
Answer: a
15. Define an equivalence relation R on the positive integers A = {2, 3, 4, . . . , 20} by m R n
if the largest prime divisor of m is the same as the largest prime divisor of n. The number
of equivalence classes of R is
(a) 8 (b) 10 (c) 9 (d) 11 (e) 7
Ans:a
16. The set of all nth roots of unity under multiplication of complex numbers form a/an
A.semi group with identity B.commutative semigroups with identity
C.group D.abelian group
Option: D
17. Which of the following statements is FALSE ?
A.The set of rational numbers is an abelian group under addition
B.The set of rational integers is an abelian group under addition
C.The set of rational numbers form an abelian group under multiplication
D.None of these
Option: D
18.In the group G = {2, 4, 6, 8) under multiplication modulo 10, the identity element is
A.6 B.8 C.4 D.2
Option: A
19. Match the following
A. Groups I. Associativity
B. Semi groups II. Identity
C. Monoids III. Commutative
D. Abelian Groups IV Left inverse
A. A B C D B. A B C D C. A B C D D. A B C D
IV I II III III I IV II II III I IV I II III IV
Option: A
20. Let (Z,*) be an algebraic structure, where Z is the set of integers and the operation * is
defined by n*m = maximum(n,m). Which of the following statements is TRUE for (Z,*)?
A.(Z, *) is a monoid B.(Z, *) is an abelian group C.(Z, *) is a group D.None
Option: D
21. Some group (G,0) is known to be abelian. Then which of the following is TRUE for G ?
A.g = g-1 for every g ∈ G B.g = g2 for every g ∈ G
2 2 2
C.(g o h) = g o h for every g,h ∈ G D.G is of finite order
Option: C
22. If the binary operation * is deined on a set of ordered pairs of real numbers as (a, b)*(c, d)
121
= (ad + bc, bd) and is associative, then (1, 2) * (3, 5) * (3, 4) equals
A.(74,40) B.(32,40) C.(23,11) D.(7,11)
Option: A
23. The linear combination of gcd(252, 198) = 18 is
a) 252*4 – 198*5 b) 252*5 – 198*4 c) 252*5 – 198*2 d) 252*4 – 198*4
Answer:a
24. The inverse of 3 modulo 7 is
a) -1 b) -2 c) -3 d) -4
Answer:b
25. The integer 561 is a Carmichael number.
a) True b) False
Answer:a
26. The linear combination of gcd(117, 213) = 3 can be written as
a) 11*213 + (-20)*117 b) 10*213 + (-20)*117
c) 11*117 + (-20)*213 d) 20*213 + (-25)*117
Answer:a
27. The inverse of 7 modulo 26 is
a) 12 b) 14 c) 15 d) 20
Answer:c
28. The inverse of 19 modulo 141 is
a) 50 b) 51 c) 54 d) 52
Answer:d
29. The value of 52003 mod 7 is
a) 3 b) 4 c) 8 d) 9
Answer:a
30. The solution of the linear congruence 4x = 5(mod 9) is
a) 6(mod 9) b) 8(mod 9) c) 9(mod 9) d) 10(mod 9)
Answer:b
31. The linear combination of gcd(10 ,11) = 1 can be written as
a) (-1)*10 + 1*11 b) (-2)*10 + 2*11
c) 1*10 + (-1)*11 d) (-1)*10 + 2*11
Answer:a
122