0% found this document useful (0 votes)
19 views54 pages

Unit 2

This document covers the fundamentals of basic set theory, including definitions, operations, and laws related to sets, relations, and functions. It explains set notation, cardinality, subsets, power sets, and various set operations such as union, intersection, and Cartesian products. Additionally, it introduces techniques for proving set identities and discusses computer representation of sets using bit strings.

Uploaded by

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

Unit 2

This document covers the fundamentals of basic set theory, including definitions, operations, and laws related to sets, relations, and functions. It explains set notation, cardinality, subsets, power sets, and various set operations such as union, intersection, and Cartesian products. Additionally, it introduces techniques for proving set identities and discusses computer representation of sets using bit strings.

Uploaded by

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

UNIT - 2

BASIC SET THEORY

Basic Definitions – Venn Diagrams and set operations – Laws of set theory – Principle of
inclusion and exclusion – Partitions – Permutation and Combination – Relations –
Properties of Relations – Matrices of Relations – Closure Operations on Relations –
Functions – injective, surjective and bijective functions.

2.1 INTRODUCTION:
Sets are one of the building blocks in Mathematics and is an important language and tool
for reasoning. Set theory deals with operations between relations among sets and
statements about sets. The knowledge of set theory increases your ability to think
abstractly. It is useful for formalizing and reasoning about computation and the objects of
computation.

2.2 LEARNING OBJECTIVES:


• To be able to understand and use the language of set theory and prove assertions
using set theory techniques.
• To understand the concepts of relations and functions.

2.3 SETS AND OPERATIONS ON SETS:


SET:
A set is a well defined collection of objects chosen from some universe. The universe is
understood from the context. The objects in a set are also called as elements of the set.
How to indicate sets?
ROSTER NOTATION: Complete listing of all the elements in a set.
Example:
S = ( 2, 4, 6, 8, 10 ) The elements in the set S are 2 , 4 , 6 , 8 , 10.
SET BUILDER NOTATION: For any proposition P(x) over any universe, {x / P(x)} is
the set of all x such that P(x) holds.
S = {x | 1 < x < 11 and x is even} This is to be read as the set of x such that x is between
1 and 11 and x is even
R = {x | x is a real number}. Here you can observe that the roster notation is impossible
since all real numbers cannot be listed.
Examples of sets that are used often:
N = the set of all natural numbers = {1, 2, 3 ....}
Z = the set of all integers = {....-2 ,-1, 0 , 1, 2, 3 ... }
Q = the set of all rational numbers
R = the set of all real numbers
C = the set of all complex numbers

61
Symbols used :
Symbol meaning example Read as
∈ Element of x∈ A x belongs to A
∉ Not an element of x ∉A x does not belongs to A
⊂ Subset or contained in A⊂ B A is a subset of B or
A is contained in B
U union AU B A union B
I intersection AI B A intersection B
- complement A A complement
∃ There exists ∃x ∈ A There exists an element
belonging to A
∀ For every ∀x For every x

CARDINALITY OF A SET :
Number of elements in a set A is called the cardinality of the set A and is denoted by |A|.
If |A| is finite then the set is said to be finite otherwise it is called as an infinite set.
If |A| = 1 , then A is called a singleton set.
If A has no elements then A is called an empty set or null set and is denoted by φ .
Example:
If A = {x / 1< x < 12 and x divisible by 13} then A = φ .
The set of real numbers is an infinite set.
B = {x / x a vowel in English alphabets} , |B| = 5.
SET NOTATION WITH QUANTIFIERS:
At times we specify the universe of discourse of a statement explicitly in the notation.
Example: The statement ∀x ∈ R ( x 2 ≥ 0 ) states that for every real number x, x 2 ≥ 0 .
UNIVERSAL SET :
The universal set,denoted by U is the set of elements under discussion for possible
membership in a set.

SUBSET:
Let A and B be two sets.
A is called a subset of B if every element in A is an element in B and is denoted by
A ⊆ B.
A is called a proper subset of B if A is a subset of B and there exists an element in B
which is not an element in A and is denoted by A ⊂ B.
Set A is said to be equal to set B denoted by A = B, if and only if A ⊆ B. and B ⊆ A.
Clearly φ is subset of every set A and A is a subset of universal set U.
Example:
Set of all integers is a proper subset of the set of all real numbers.
Let A = {x ∈ N / x2 – 5x + 6 = 0} and B = { 2 , 3}. Clearly A = B.

POWER SET
The set of all subsets of a set A is called the power set of A and is denoted by P( A) .

62
Note: If A = n then P( A) = 2n .

Example: If A = { a, b, c } find the elements of P( A) .


Solution:
S1 = φ , S2 = {a}, S3 = {b}, S 4 = {c}, S5 = {a, b}
S6 = {b, c}, S7 = {a, c}, S8 = {a, b, c}
P ( A) = {S1 , S2 , S3 , S 4 , S5 , S6 , S7 , S8 }
Here A = 3 and P( A) = 23 = 8 .

UNION OF SETS:
Let A and B be given sets, then union of A and B is denoteby A ∪ B = { x / x ∈ A or x ∈ B} .
Clearly A ∪ B ⊇ A, A ∪ B ⊇ B.

INTERSECTION OF SETS
Intersection of A and B is denoted by A ∩ B = { x / x ∈ A and x ∈ B} .
Clearly A ∩ B ⊆ A, A ∩ B ⊆ B.
SET DIFFERENCE:
Difference of A and B is denoted by A − B = { x ∈ A and x ∉ B} .
DISJOINT SETS:
Two sets A and B are disjoint if A ∩ B = φ .
NOTE: If A and B are disjoint, then A ∪ B = A + B .
Example:
A = { x ∈ N / x even integer}
B = { x ∈ N / x odd integer}
C = { x ∈ R / − 4 < x < 3}
D = { x / − 1 < x < 7 and x real}
A ∩ B = φ , C ∪ D = −4 < x < 7
C − D = { x / − 4 < x ≤ −1, x real}
COMPLEMENT OF A SET:
If U is universal set containing the set A, then U − A = { x ∈ U / x ∉ A} is called the
complement of A and is denoted by A .
If A and B are two subsets of the universal set U, then the difference of B in A is denoted
by A − B = { x / x ∈ A and x ∉ B} . This is also called as complement of B in A.
SYMMETRIC DIFFERENCE:
If A and B are two sets then the symmetric difference is denoted by
A ⊕ B = { x / x ∈ A ∪ B and x ∉ A ∩ B}
= ( A ∪ B ) − ( A ∩ B ) = complement of A ∩ B in A ∪ B .

63
CARTESIAN PRODUCT:
The ordered n tuple (a1 ,...an ) is the ordered collection that has ai as ith element.
Two ordered n-tuple (a1 ,...an ) and (b1 ,...bn ) are equal if and only if ai = bi for i = 1, …, n.
If A and B are two sets, then the cartesian product of A and B, denoted by
A x B = {(a,b)/ a ∈ A and b ∈ B }.
Example :
A = {a , b} and B = {1 , 2}.
A x B = { (a,1), (a,2), (b,1), (b,2) }.
Clearly | A x B | = |A| |B|.

Note:
The cartesian product is not commutative. A x B need not be equal to B x A.
The cartesian product can be extended to sets A1 , . A2, … An

2.3.1 SET IDENTITIES:

IDENTITY LAW

A ∪φ = A
Identity Law
A ∩U = A

A ∪U = U
Domination Law
A ∩φ = φ

A∪ A = A
Idempotent Law
A∩ A = A

( A) = A Complement Law

A∪ B = B ∪ A
Commutative Law
A∩ B = B ∩ A

A ∪ ( B ∪ C ) = ( A ∪ B) ∪ C
Associative Law
A ∩ ( B ∩ C ) = ( A ∩ B) ∩ C

A ∩ ( B ∪ C ) = ( A ∩ B) ∪ ( A ∩ C )
Distributive Law
A ∪ ( B ∩ C ) = ( A ∪ B) ∩ ( A ∪ C )

A∪ B = A∩ B
De Morgan’s Law
A∩ B = A∪ B

64
A ∪ ( A ∩ B) = A
Absorption Law
A ∩ ( A ∪ B) = A

A∪ A =U
Complement Law
A∩ A =φ

The identities can be proved easily from the definitions.


TO PROVE SET IDENTITIES :
Techniques to prove statements about sets:
(i) Prove A ⊆ B and B ⊆ A separately.
(ii) Use set builder notation and logical equivalences.
(iii) Use a membership table.
USING MEMBERSHIP TABLES:
Use columns for different set expressions. Rows for all combinations of membership in
constituent sets.
Use 1 to indicate membership in the set and 0 for non-membership.
Prove equivalence with identical columns.
Example:
Prove ( A ∪ B ) − B = A − B using membership table technique.
Solution:

A B A∪ B ( A ∪ B) − B A− B
0 0 0 0 0
0 1 1 0 0
1 0 1 1 1
1 1 1 0 0

Example:
1. Prove De Morgan’s laws namely A ∪ B = A ∩ B and A ∩ B = A ∪ B
Solution:
x ∈ ( A ∩ B) ⇒ x ∉ A ∩ B
⇒ x ∉ A or x ∉ B
⇒ x ∈ A or x ∈ B
⇒ x∈ A∪ B
∴ ( A ∩ B) ⊆ ( A ∪ B ).........( I )
On the other hand
x ∈ A ∪ B ⇒ x ∈ A or x ∈ B
⇒ x ∉ A or x ∉ B
⇒ x ∈ ( A ∩ B)
∴ A ∪ B ⊆ ( A ∩ B)...........( II )

65
From ( I ) and ( II ) we get ( A ∩ B) = A ∪ B .
Similarly we can show that ( A ∪ B) = A ∩ B .

2. Prove the distributive law namely A ∩ ( B ∪ C ) = ( A ∩ B) ∪ ( A ∩ C) for all sets A, B, C.

Solution:
x ∈ A ∩ ( B ∪ C ) ⇒ x ∈ A and x ∈ ( B ∪ C )
⇒ x ∈ A and x ∈ B or x ∈ C
⇒ ( x ∈ A and x ∈ B ) or ( x ∈ A and x ∈ C )
⇒ x ∈ ( A ∩ B) ∪ ( A ∩ C )
∴ A ∩ ( B ∪ C ) ⊆ ( A ∩ B) ∪ ( A ∩ C )
On the other hand,
x ∈ ( A ∩ B) ∪ ( A ∩ C ) ⇒ x ∈ ( A ∩ B) or x ∈ A ∩ C
⇒ ( x ∈ A and x ∈ B ) or ( x ∈ A and x ∈ C ) ⇒ x ∈ A ∩ (B ∪ C)
∴ ( A ∩ B) ∪ ( A ∩ C ) ⊆ A ∩ ( B ∪ C )
Thus we get, A ∩ ( B ∪ C ) = ( A ∩ B) ∪ ( A ∩ C )

3. Let A, B, C be any set, show that A ∪ ( B ∩ C ) = (C ∪ B ) ∩ A


Solution:
A ∪ (B ∩ C) = A ∩ (B ∩ C) by De Morgan’s law
= A ∩ ( B ∪ C ) by De Morgan’s law
= ( B ∪ C ) ∩ A by Commutative law
= (C ∪ B ) ∩ A by Commutative law

4. Given A = {a, d, e, g} and B = {c, d, f, g}


U = {a, b, c, d, e, f, g, h, i}
Verify ( A ∪ B) = A ∩ B
Solution:
A ∪ B = {a, c, d, e, f, g}
( A ∪ B) = {b, h, i}
A = {b, c, f, h, i}
B = {a, b, e, h, i}
A ∩ B = {b, h, i}
∴ ( A ∪ B) = A ∩ B is verified.

GENERALISED UNIONS AND INTERSECTIONS:


Union of collection of sets is the set that contains those elements that are members of at
least one set in the collection.
n
A1 ∪ ... ∪ An = U Ai
i =1

66
n
A1 ∩ ... ∩ An = I Ai denotes the intersection of the sets A1 ,..., An
i =1

Ai = {i, i + 1, i + 2,...}
n

U A = {1, 2,3,...}
i =1
i

I A = {n, n + 1, n + 2,...}
i =1
i

2.3.2 COMPUTER REPRESENTATION OF SETS:


There are several ways to represent sets using a computer. We shall present a method of
storing elements using an arbitrary ordering of the elements of the universal set, which
makes computing combinations of sets easy.
Let the universal set U be finite and specify an arbitrary ordering of the elements
of U.
Let U = {a1,a2,…,an}.
represent a subset A of U with bit string of length n, where ith bit in this string is 1 if ai
belongs to A and 0 if ai ∉ A .
Example:
Let U = {1,2,3,4,5,6,7,8,9,10}. What bit strings represent the subset A of all odd integer
in U, the subset B of all even integer in U, and the subset C of integers not exceeding 5 in
U.
Solution:
U = {1,2,…,10}
A = {1,3,5,7,9} = 1010101010
B = {2,4,6,8,10} = 0101010101
C = {1,2,3,4,5} = 1111100000
Note: Using bit strings to represent sets, the complement of a set is obtained by changing
each 1 to 0 and each 0 to 1 in that set.
Union of two bit strings is nothing but the bit string where in the ith position is 1 if either
of the bits in the ith position in the two strings is 1 or both are 1 and 0 when ith bits are 0.
A ∪ B = 1111111111
Intersection of the two bit strings is the string wherein the bit in the ith position is 1 when
bits in the ith position in the 2 strings are both 1; and 0 either of the 2 bits or both are 0.
A ∩ B = 0000000000 .

2.3.3 VENN DIAGRAM:


Venn diagram is a pictorial representations of sets in which sets are represented by
enclosed area in the plane. Using Venn diagram set operation and relationships can be
visualized.
The universal set U is represented by the interior of a rectangle:

A ⊆ B can be represented as

67
A ⊄ B can be represented as

A ∪ B can be represented as

Example:
1. Using Venn diagram prove the distributive law A ∩ ( B ∪ C ) = ( A ∩ B) ∪ ( A ∩ C ) for 3
sets.
Solution:

68
2. Draw Venn diagram for the symmetric difference of the sets A and B and show that

Note: A Venn diagram with n sets divide the universal set into 2n regions.
A Venn diagram with 3 sets divide the universal set into 23 = 8 regions.

Example:
Represent the regiong given below in terms of the sets A, B, C and select the
numbered regions that make up the set A ∪ ( B ∩ C )
Solution:

Region Triple intersection


1 A∩ B ∩C
2 A∩ B ∩C
3 A∩ B ∩C
4 A∩ B ∩C
5 A∩ B ∩C

69
6 A∩ B ∩C
7 A∩ B ∩C
8 A∩ B ∩C

Select the numbered regions that make up the set A ∪ ( B ∩ C )

A = 1, 4, 7, 8 B = 1, 2, 6, 8
B = 2, 4, 5, 7 C = 5, 6, 7, 8
C = 1, 2, 3, 4 B ∩ C = 6, 8
B ∩ C = 2, 4 A ∪ ( B ∩ C ) = 1, 4, 6, 7, 8
A ∪ ( B ∩ C ) = (1, 4, 7, 8, 2) = (1, 2, 4, 7, 8)

HAVE YOU UNDERSTOOD THE CONCEPTS ?


Answer the following

1. If A ∪ B = A then
(a) B ⊆ A (b) A ⊂ B (c) A = B (d) B = φ
Ans: (a)

2. Let A, B be subsets of a universal set U. Which of the following is true?


(a) A ⊆ B ⇔ B ⊆ A
(b) A ⊆ B ⇔ A ⊆ B Ans: (a)
(c) A ⊆ B ⇔ A = B
(d) A ⊆ B ⇔ A ∪ B = φ

3. If S = { x ∈ Z / x 2 + 5 = 0} then S is
(a) φ (b) S = {−5,5} (c) S is an infinite set (d) S = {0} Ans: (a)

3. If A = { x / x 2 − 3x + 2 = 0} and B = {1, 2} then


(a) A = B (b) A ∩ B = A (c) A ∪ B = A (d) A − B = 2 Ans: (a)

4. If the set A has p elements, b has q elements, then the number of elements in
A x B is
(a) p + q + 1 (b) pq (c) p2 (d) p + q Ans: (b)

5. If P, Q and R are subsets of a set A, then R × ( P c ∪ Q c ) equals


c

(a) ( R × P ) ∩ ( R × Q ) (b) ( R × Q ) ∩ ( R × P )
(c) ( R × P ) ∪ ( R × Q ) (d) None of these Ans: (a)

70
6. Two finite sets have m and n elements, the total number of subsets of the first set
is 56 more than the total number of subsets of the second. The values of m and n
are,
(a) 7,6 (b) 6,3 (c) 5,1 (d) 8,7 Ans: (b)

2.4 PERMUTATIONS AND COMBINATIONS:

SUM RULE:
Let m be the number of ways to do one task and n be the number of ways to do the
second task and if both the tasks cannot be performed simultaneously, then the task “do
either task 1 or task 2 , but not both” can be done in m + n ways.

Example:
A student can choose a computer project from one of three lists. The 3 lists contain 24,
15, 10 possible projects,. How many possible are there to choose from?
Solution:
The students can choose a project from the first list in 24 ways, form the second list in 15
ways and from the third in 10 ways. Hence there are 24 + 15 + 10 = 49 projects to choose
from.

PRODUCT RULE:
The task “do both task 1 and task 2” can be done in mn ways.
In set theoretic version:
If A is the set of ways to do task 1 and B is the set of ways to do task 2, and if A and B are
disjoint, then the ways to do either task 1 or task 2 are A ∪ B and A ∪ B = A + B .
The ways to do both task 1 and 2 can be represented as A × B and A × B = A . B .
Example:
How many different bit strings are there of length 7 ?
Solution:
Each of the seven bits can be chosen in 7 ways, since each bit is either 0 or 1. Hence by
product rule there are a total of 27 = 128 different bit strings of length 7.

2.4.1 PERMUTATIONS:
A permutation of a set S of objects is an ordered arrangement of these objects
Note:
An ordered arrangement of r distinct elements of S is called an r-permutation of S.
The number of r-permutations of a set with n = S elements is
P ( n, r ) = n ( n − 1) ... ( n − r + 1) = n !/ ( n − r ) !

Example:
How many permutations of the letter JKLMNOPQ contain the string JKL.

71
Solution:
Since the letter JKL must occur in a block, we must consider six objects namely JKL as
one block and M,N,O,P,Q. the six objects can occur in any order and there are 6! = 720
permutations of the letters JKLMNOPQ in which JKL occurs as a block.

Example:
A committee of 16 persons is to be formed out of 29 persons. In how many ways the
committee can be formed?
Solution:
It is clear that we need to fill up 16 positions as P1 ,..., P16 .
Note that the positions P1 can be filled in 29 ways, P2 can be filled in 28 ways, …, P16
in 14 ways.

Hence the total number of ways the committee can be formed is


29! 29!
29 x 28 x … x 14 = =
(29 − 16)! 13!
Note:
More generally we have the number of r-permutations of a set with n distinct element is
n!
n ( n − 1)( n − 2 ) ...(n − r + 1) =
( n − r )!
PERMUTATIONS WITH REPETITION:
We may allow repetition in the n objects. . The number of permutations on a set of n
elements with repetition allowed is nr.
Note:
Let P1 of the objects are alike and of one kind, P2 of them are alike and of the second
kind, …,Pr of them are alike and of the rth kind, where P1 + P2+…+Pr = n. Then the total
n!
number of different permutations of n objects is .
P1 ! P2 !...Pr !

CIRCULAR PERMUTATIONS:
Suppose n persons are seated about a round table. How many distinct circular
arrangements possible. Note that two arrangements are circularly equivalent, if one can
be got from the other by means of rotation.
The number of ways of arranging n distinct objects around a cycle is ( n − 1) ! .
Example:
How many three-letter “words” can be formed from letters in the set {a, b, y, z}.
(i) if repetition of letters are allowed? (ii) if repetition not allowed?
Solution:
(i) Here n = 4 and r = 3.
Therefore the total number of words of length three from the 4 letters with repetition
= 43 = 64 words.
(ii) The total number of words of length 3 from 4 distinct letters

72
= P(4,3)
=4x3x2
= 24.
2.4.2 COMBINATIONS:
An r-combination of elements of a set S is simply a subset T ⊆ S with r members. In
other words T = r.

Note:
1. The number of r-combinations of a set with n = S elements is
⎛ n ⎞ P ( n, r ) n !( n − r ) ! n!
C ( n, r ) = ⎜ ⎟ = = =
⎝ r ⎠ P ( r, r ) r! r !( n − r ) !
2. C ( n, r ) = C ( n, n − r ) since choosing the r members of T is the same as choosing the
n – r non-members of T.
Example:
1. How many bit strings of length n contain exactly r 1’s.
Solution
The position of r 1’s in a bit string of length n form an r-combination of the set
{1,2,3,…,n}. Hence there are C(n,r) bit strings of length n that contain exactly r 1’s.
2. How many ways are there to select a committee to develop a discrete mathematics
course if the committee is to consists of three faculty members from the mathematics
department and 4 from the computer science department, if there are 9 faculty members
of the mathematics department and 11 of the computer science department.
Solution
By the product rule the required answer is the product of the number of 3-combinations
of a set with 9 elements and number of 4-combinations of a set with 11 elements. Hence
9! 11!
the number of ways to select the committee is C ( 9,3) .C (11, 4 ) = . = 27, 720.
3!6! 4!7!
COMBINATIONS WITH REPETITIONS:
There are C ( n + r − 1, r ) r -combinations from a set with n elements when repetition of
elements is allowed.
Examples:
1. How many solutions does the equation x1 + x2 + x3 = 11 have, where x1 , x2 and x3 are
non-negative integers.
Solution:
To count the number of solutions, we note that a solution corresponds to a way of
selecting 11 items form a set with three elements, so that x1 items of type one, x2 items
of type two, and x3 items of type three are chosen. Hence, the number of solution is
equal to the number of 11-combinations with repetition allowed form a set with three
elements. Hence it follows that there are
13.12
C ( 3 + 11 − 1,11) = C (13,11) = C (13, 2 ) = = 78 solutions.
1.2

73
2. How many solutions does the equation x1 + x2 + x3 = 11 have, where x1 , x2 and x3 are
nonnegative integers with x1 ≥ 1, x2 ≥ 2 and x3 ≥ 3 .
Solution:
A solution to the equation subject to these constraints corresponds to a selection
of 11 items with x1 items of type one, x2 items of type two and x3 items of type three
where, in addition, there is at least one item of type one, two items of type two and three
items of type three. So choose one item of type one, two items of type two and three
items of type three. Then select five additional items. This can be done in
7.6
C ( 3 + 5 − 1,5 ) = C ( 7,5 ) = C ( 7, 2 ) = = 21 ways.
1.2
Thus, there are 21 solutions of the equation subject to the given constraints.
3. How many different strings can be made by reordering the letter of the word
SUCCESS?
Solution
Because some of the letters of SUCCESS are the same, the answer is not given by the
number of permutations of seven letters. This word contains three Ss, two Cs, one U and
one E. To determine the number of different strings that can be made by reordering the
letters, first note that the three Ss can be placed among the seven position in C(7,3)
different ways, leaving four positions free. Then the two Cs can be placed in C(4,2) ways,
leaving two free positions. The U can be placed in C(2,1) ways, leaving just one position
free. Hence E can be placed in C(1,1) ways. Consequently, from the product rule, the
number of different strings that can be made is
7! 4! 2! 1! 7!
C ( 7,3) C ( 4, 2 ) C ( 2,1) C (1,1) = . . . = = 420 .
3!4! 2!2! 1!1! 1!0! 3!2!1!1!

2.4.3 PARTITION:
Let S be a non-empty set. The collection B = { A1 , A2 ,..., Ar } of non empty subsets of S is
a partition of S if and only if
(i) S = A1 ∪ A2 ∪ ... ∪ Ar
(ii) For any Ai , Aj ∈ B either Ai = Aj or Ai ∩ Aj = ∅
Each Ai is called a block of the partition.
Example:
Let S = {a, b, c, d , e, f , g , h} and A1 = {a, d , e} , A2 = {b, c} , A3 = { f } , A4 = { g , h} then
{ A1 , A2 , A3 , A4 } forms a partition of S since
(i) A1 ∪ A2 ∪ A3 ∪ A4 = S and
(ii) Ai ∩ Aj = ∅ for . i ≠ j

2.4.4 INCLUSION AND EXCLUSION PRINCIPLE:


If A and B are two sets which are not disjoint, then A ∪ B = A + B − A ∩ B . If A and B
are disjoint, then A ∪ B = A + B .
This is known as principle of inclusion and exclusion.

74
Exercise:
Show that for any two finite sets S and T, S ∪ T = S + T − S ∩ T using Venn diagram.

Clearly S ∪ T = ( S − T ) ∪ ( S ∩ T ) ∪ (T − S )
Let S − T = m, S ∩ T = n, T − S = k
S = ( S − T ) ∪ ( S ∩ T ) and ( S − T ) ∪ ( S ∩ T ) = φ
∴ S = S + T + S ∩T = m + n
S ∪T = S − T + S ∩T + T − S = m + n + k
Similarly, T = k + n
S + T = m+k +n+n
S ∪T = S + T − n = S + T − S ∩T
INCLUSION AND EXCLUSION PRINCIPLE FOR THREE SETS:
Let A1 , A2 , A3 be three non empty sets.
3 3
| A1 ∪ A2 ∪ A3 | = ∑| A | − ∑ | A ∩ A
i =1
i
i ≠ j =1
i j | + | A1 ∩ A2 ∩ A3 |

Examples:
1. Passwords must be 2 characters long. Each character must be a letter a – z , a digit
0 – 9, or one of the 10 punctuation characters ! @ # $ % ^ & * ( ) . Each
password must contain at least 1 digit or punctuation character. Find the number
of legal passwords.
Solution:
Password has a digit or punctuation character in position 1 or in position 2.The
inclusion and exclusion principle applies as these cases overlap.
Let A be the set of all Passwords that has a digit or punctuation character in position 1.
Let B be the set of all Passwords that has a digit or punctuation character in position 2.
Then A ∩ B is the set of all passwords, which has a digit or punctuation character in
position 1 and 2.

75
|A| = (10+10) (10+10+26) = 920
|B| = (10+10+26) (10+10) = 920
| A ∩ B |= 20x 20 = 400
By the principle of inclusion and exclusion,
A ∪ B = A + B − A ∩ B =920+920-400 = 1440
2. In a language survey of students it is found that 80 students know English, 60 know
French, 50 know German, 30 know English and French, 20 know French and German, 15
know English and German and 10 students know all the three languages. Using Venn
diagram find out how many students know (i) at least one language (ii) English only (iii)
at least two languages?
Solution:
Let E, F, G denote respectively, the sets of students knowing English, French and
German.

Set Region Triple intersection


S1 1 E ∩ F ∩G
S2 2 E ∩ F ∩G
S3 3 E ∩ F ∩G
S4 4 E ∩ F ∩G
S5 5 E ∩ F ∩G
S6 6 E ∩ F ∩G
S7 7 E ∩ F ∩G
S8 8 E ∩ F ∩G
Given E = 80 F = 60 G = 50
Given E ∩ F ∩ G = 10. ⇒ S5 = 10
E ∩ F = 30 ⇒ S3 + S5 = 30 ⇒ S3 = 30 − S5 = 30 – 10 = 20
E ∩ G = 15 ⇒ S5 + S6 = 15 ⇒ S6 = 15 − S5 = 15 – 10 = 5
F ∩ G = 20 ⇒ S5 + S7 = 20 ⇒ S7 = 20 − S5 = 20 – 10 = 10
S2 = E − S3 − S5 − S6 = 80 – 20 – 10 – 5 = 45
S4 = F − S3 − S5 − S7 = 60 – 20 – 10 – 10 = 20

76
S8 = G − S6 − S5 − S7 = 50 – 5 – 10 – 10 = 25
Therefore
(i) the number of students who know at least one language is
S 2 + S 3 + S 4 + S 5 + S 6 + S 7 + S8
= 45 + 20 + 20 + 10 + 5 + 10 + 25 = 135
(ii) the number of students who know English only is
S2 = 45
(iii) the number of students who know at least two language is
S3 + S5 + S6 + S7 = 20 + 10 + 5 + 10 = 45
3. In a language survey of students it is found that 80 students know English, 60 know
French, 50 know German, 30 know English and French, 20 know French and German, 15
know English and German and 10 students know all the three languages. Find the number
of students who knows (i) at least one language (ii) English only (iii) at least two
languages using the principle of inclusion and exclusion.

(i) Using principle of inclusion and exclusion number of students who know at
least one language is given by
E ∪ F ∪G = E + F + G − E ∩ F − F ∩G − E ∩G + E ∩ F ∩G

= 80 + 60 + 50 -30 – 20 – 15 + 10 = 135
(ii) Let A = E ∩ F and B = E ∩ G
∴ A ∪ B = A + B − A ∩ B = 30 + 15 – 10 = 35
Therefore the number of students who know English alone is given by
E − A ∪ B = 80 – 35 = 45
(iii) Let A = E ∩ F , B = E ∩ G , C = F ∩ G
Clearly A ∩ C = A ∩ B = B ∩ C = A ∩ B ∩ C = E ∩ F ∩ G
By principle of inclusion and exclusion we get
A∪ B ∪C = A + B + C − A∩ B − A∩C − B ∩C + A∩ B ∩C

A∪ B ∪C = A + B + C − A∩ B − A∩C
A ∪ B ∪ C = A + B + C − E ∩ F ∩ G = 30 + 20 + 15 – 20 = 45

INCLUSION AND EXCLUSION PRINCIPLES FOR n SETS


Extending the principle of inclusion and exclusion principle to n sets, we have the
following:
Let A1 , A2 ,... An be any n non-empty sets. Then,
A1 ∪ A2 ∪ ... ∪ An

( Ai ∩ Aj ) + ∑ (A ∩ A ∩ Ak ) − ... + ( −1)
n n n
= ∑ ( Ak ) − ∑ ( A1 ∩ ... ∩ An )
n −1
i j
i =1 i ≠ j =1 i , j , k =1

77
ANOTHER VERSION OF THE PRINCIPLE OF INCLUSION AND
EXCLUSION:
Let S be any non-empty set with | S |= N . Let Ci ,1 ≤ i ≤ t be conditions satisfied by
some elements of S .
N ( Ci ) = { x ∈ S / x satisfy Ci } and
N ( Ci1 , Ci 2 ,...Cik ) = { x ∈ S / x satisfy the conditions Ci1 , Ci 2 ,..., Cik }
N ( Ci ) = { x ∈ S / x do not satisfy Ci } .
N = N ( C1 , C2 ,...Ct ) ,

∑ N ( C C )... + ( −1) N ( C C ...C ) .


t t
= N = N − ∑ N ( Ci ) +
t
i j 1 2 t
i =1 i ≠ j =1

Examples:
1. Determine the number of positive integers n, 1 ≤ n ≤ 1729 that are not divisible by
the Prime factors of 1720.
Solution:
The prime factors of 1729 are 7, 13 and 19.
Let C1 denote “an integer divisible by 7”
Let C2 denote “an integer divisible by 13”
Let C3 denote “an integer divisible by 19”
⎡1729 ⎤
N ( C1 ) = ⎢ = 247
⎣ 7 ⎥⎦
⎡1729 ⎤
N ( C2 ) = ⎢ = 133
⎣ 13 ⎥⎦
⎡1729 ⎤
N ( C3 ) = ⎢ = 91
⎣ 19 ⎥⎦
⎡ 1729 ⎤
N ( C1C2 ) = ⎢ = 19
⎣ 7 *13 ⎦⎥
⎡ 1729 ⎤
N ( C2C3 ) = ⎢ =7
⎣13*19 ⎥⎦
⎡ 1729 ⎤
N ( C3C1 ) = ⎢ = 13
⎣19*7 ⎥⎦
⎡ 1729 ⎤
N ( C1C2C3 ) = ⎢ = 1.
⎣ 7 *13*19 ⎥⎦
Hence the required “number of numbers” is
N = N − ∑ N ( Ci ) + ∑ N ( Ci C j ) − N ( C1C2C3 )
=1729 – [247 + 133 + 91] + (19 + 7 + 13) – 1.
= 1729 – 471 + 39 – 1 = 1258 + 38 =1296.

78
2. Determine the number of positive integers x where x ≤ 1729 and the sum of the
digits in x is equals to 29.
Solution:
Let x = x1 x2 x3 x4
Be such that x1 + x2 + x3 + x4 = 29
with 0 ≤ xi ≤ 9 . The problem can be restated as finding the number of integer
solutions of the equation
x1 + x2 + x3 + x4 = 29
subject to the conditions 0 ≤ xi ≤ 9 (1 ≤ i ≤ 4 ) .

Let Cj be the condition that ( x1 , x2 , x3 , x4 ) is the integer solution of the equation


x1 + x2 + x3 + x4 = 29............................. ( I )
with xi ≥ 0 and x j ≥ 10
Replacing x1 by y1 + 10 we get the number of integer solution of the equation ( I ) is
the same as the number of integer solution of the equation.
y1 + x2 + x3 + x4 = 29 − 19 = 10
with
y1 ≥ 0 and xi ≥ 0 2 ≤ i ≤ 4
Let the number of solutions be N ( C1 ) then N ( C1 ) = C (19 + 4 − 1,19 ) = C ( 22,19 )
Hence,
4
S1 = ∑ N ( Ci ) = C (4,1)C ( 22,19 )
i =1

Replacing x1 + x2 by y1 + 10 and y2 + 10 , the number of solutions of ( I ) is the


same as the number of solutions of the equation.
y1 + y2 + x3 + x4 = 29 − 10 − 10 = 9
Let this be N ( C1C2 ) = C ( 9 + 4 − 1,9 ) = C (12,9 )

Hence,
4
S2 = ∑ N ( C C ) = C ( 4, 2 ) C (12,9 )
i ≠ j =1
i j

Replacing x1 + x2 + x3 by y1 + 10 , y2 + 10 and y3 + 10 the number of solutions of


( I ) is the same as the number of solutions of the equation.
y1 + y2 + y3 + x4 = 29 − 10 − 10 − 10 = −1 . Let this be N ( C1C2C3 ) = 0 as the sum of
non – negative integers cannot be a negative number.
Hence S3 = ∑ N ( Ci C j Ck ) = C ( 4,3) .0
Similarly, S 4 = ∑ N ( C1C2C3C4 ) = 0
Also, S the number of integer solutions of ( I ) with
xi ≥ 0 is C ( 29 + 4 − 1, 29 ) = C (32, 29)

79
Hence the required number of solutions by the principle of inclusion and exclusion is
S − S1 + S 2 − S3 + S 4
C ( 32, 29 ) − C ( 4,1) C ( 22,9 ) + C (4, 2)C (12,9 )

HAVE YOU UNDERSTOOD THE CONCEPTS?


Answer the following
1. X and Y are two sets such that X = 17, Y = 23, X ∪ Y = 38 , then X ∩ Y is
(a) 4 (b) 2 (c) 6 (d) None of these Ans: (b)

2. If U = 700, A = 200, B = 300, A ∩ B = 100, then A′ ∩ B ′ is equal to


(a) 400 (b) 240 (c) 300 (d) None of these Ans:(c)

3. In a group of 70 people, 37 like coffee, 52 like tea and each person like at least
one of the two drinks. The number of persons liking both coffee and tea is
(a) 16 (b) 13 (c) 19 (d) None of these Ans: (c)

4. If A = {1,3,5,7,9,11,13,15,17}, B = {2,4,…,18} and N is the universal set, then


A′ ∪ ( A ∪ B ) ∩ B ′ is
(a) A (b) N (c) B (d) None of these Ans: (b)

5. Suppose A1,A2,…A30 are thirty sets, each with five elements and B1,B2,…Bn are n
30 n
sets each with three elements. Let U Ai = U B j = S
i =1 j =1

If each elements of S belongs to exactly ten of the Ai’s and exactly nine of the
Bj’s then n =
(a) 45 (b) 35 (c) 40 (d) None of these Ans: (a)

6. Consider the set of all determinants of order 3 with entries 0 or 1 only. Let B be
subset of A consisting of all determinants with value 1. Let C be the subset of the
set of all determinants with value – 1. Then
(a) C is empty (b) B has as many elements as C
(c) A = B ∪ C (d) B has twice as many elements as C. Ans: (b)

7. Out of 800 boys in a school, 224 played cricket, 240 played hockey and 336
played basket ball. Of the total, 64 played both basketball and hockey; 80 played
cricket and basketball and 40 played cricket and hockey; 24 played all the three
games. The number of boys who did not play any game is:
(a) 160 (b) 240 (c) 216 (d) 128 Ans: (a)

2.5 RELATIONS AND FUNCTIONS:


After introducing and discussing about set theory we shall define the concept of relations
and functions and study about them.

80
2.5.1 RELATIONS:
Let A and B be non-empty set, then any subset R of A x B is called a binary relation
from A to B.
Example: Let A = {1,2,3}, B = {a,b}, then A x B = {(1,a), (1,b), (2,a),(2,b), (3,a), (3,b)}
R1 = {(1,a), (2,b),(2,a),(2,b)}
R2 = {(1,1),(3,b)}
R1 and R2 are binary relations from A to B.
If ( a, b ) ∈ R then we write aRb and we may say “a is related to b by the relation R”.

COMPLEMENTARY RELATIONS:
Let R be any relation from A to B.
Then, the binary relation R , the complement of R is the binary relation defined by
R ≡ {( a, b ) | ( a, b ) ∉ R} = ( A × B ) − R .
Let R be any binary relation, then the domain D(R) of R is defined as
D(R) = {a / a ∈ A and (a, b) ∈ R for some b ∈ B}
The range E(R) of R is defined as E(R) = {b / b ∈ B and (a, b) ∈ R for some a ∈ A} .
Note: If R ⊆ A × B , then clearly D ( R ) ⊆ A and of E ( R ) ⊆ B .
Example:
Given A = {1,2,3}, B = {a,b} and R = {(1,a), (2,b),(2,a),(2,b)} we get D(R) = (1,2) and
E( R ) = (a,b).

2.5.2 PROPERTIES OF RELATIONS:


REFLEXIVE:
Let R be a binary relation defined in a set A
Then R is reflexive if, for every x ∈ A, ( x, x ) ∈ R .
Example:
Let A = {1, 2,3}
R = {(1,1) , (1, 2 ) , ( 2, 2 ) , ( 3,3) , ( 2,3)} and S = {(1,1) , (1, 2 ) , ( 2,1) , ( 3,3)} are defined on X.
Then R is reflexive, but S is not reflexive. Since ( 2, 2 ) ∉ S and 2 ∈ A .
SYMMETRIC:
A relation R on a set A is symmetric if whenever ( x, y ) ∈ R then ( y, x ) ∈ R .
That is, if xRy ⇒ yRx,
Example: Let X = {1, 2,3} R = {(1,1) , (1, 2 ) , ( 2,1) , ( 2,3) , ( 3, 2 )}
S = {(1, 2 ) , ( 2, 2 ) , (1,3) , ( 3,1)} are defined on X.
Then R is symmetric, but S is not symmetric. Since (1, 2 ) ∈ S but ( 2,1) ∉ S .

TRANSITIVE:
A relation R defined on a set X is transitive if, whenever ( x, y ) ∈ R and ( y, z ) ∈ R , then
( x, z ) ∈ R

81
In other words if xRy and yRz ⇒ xRz , then R is said to be transitive.
Example:
Let X = {1, 2, 3}
R = {(1,1) , (1, 2 ) , ( 2, 2 ) , (1,3) , ( 2,3) , ( 2,1)}
S = {(1, 2 ) , ( 2,3) , (1,3) , ( 3,3) , ( 2,1)}
Then R is transitive, but S is not transitive. Since 2 S1 and 1S 2 but ( 2, 2 ) ∉ S .

IRREFLEXIVE:
A relation R in a set X is irreflexive if, for every x ∈ X , ( x, x ) ∉ R .
Example:
Let X = {1, 2,3}
R = {( 2,1) , (1, 2 ) , ( 3, 2 ) , ( 2,3) , (1,3)}
S = {(1,1) , ( 2,3) , ( 2, 2 ) , (1,3)}
Clearly R is irreflexive.
S is not reflexive as ( 3,3) ∉ S and not irreflexive as (1,1) ∈ S .
ANTISYMMETRIC:
A relation R on a set X is anti-symmetric if, whenever ( x, y ) ∈ R and ( y, x ) ∈ R ,
then x = y .
In other words xRy and yRx ⇒ x = y , then R is said to be antisymmetric.
Example:
Let A be a set and P (A) the power set of A.
R be the inclusion relation ( ⊆ ) defined on P (A).
A ⊆ B and B ⊆ A ⇒ A = B
Hence the relation R defined on P(A) is antisymmetric.

THE INVERSE OF A RELATION:


Let R be a relation from A to B. Then the relation R −1 = {( b, a ) / ( a, b ) ∈ R} from B to A is
called the inverse of R.
Example:
Let A = {1, 2, 3}, B = {4, 5} and R = {(1,4), (2,5), (3,5)} be a relation form A to B. Then
R −1 = {(4,1), (5, 2), (5,3)}

EQUIVALENCE RELATION:
A relation R on a set A is called an equivalence relation on A if it is reflexive, symmetric
and transitive.

82
2.5.3 EQUIVALENCE CLASSES:
Let R be any equivalence relation on a set A. Let a ∈ A
The equivalence class of a, denoted by [ a ]R ≡ {b | aRb} which is equal to the set of all
elements of A that are equivalent to a according to the equivalent relation R. Each b in
[ a ]R is called a representative of [ a ]R .
Example:
1. Consider the real numbers R. Define a relation S on R as a R b if and only if a − b ∈ Z
where Z is the set of all integers. Clearly S is an equivalence relation on R.
Let a ∈ R then [ a ]R = the set {..., a − 2, a − 1, a, a + 1, a + 2,...}
2. Consider the set of all integers Z. Let m be a positive integer >1. Define a relation S on
Z as a R b if and only if a – b is an integral multiple of m. Then S is an equivalence
relation on Z.
Let a ∈ Z then [ a ]R = the set {..., a − 2m, a − m, a, a + m, a + 2m,...}

PROPERTIES OF EQUIVALENCE CLASSES:


Let R be an equivalence relation on a non empty set X.
1. Since R is reflexive, a ∈ [ a ]R , ∃ for each element a in X.
2. b ∈ [ a ]R ⇒ [ a ]R = [b ]R
Let a, b ∈ X such that b ∈ [ a ]R . Then ( a, b ) ∈ R and hence ( b, a ) ∈ R . Let c ∈ [b ]R . Then
( b, c ) ∈ R . As ( a, b ) ∈ R and ( b, c ) ∈ R , and as R is transitive, we have ( a, c ) ∈ R . So
c ∈ [ a ]R . Thus b ∈ [ a ]R , and c ∈ [b ]R ⇒ c ∈ [ a ]R . In other words, if b ∈ [ a ]R , then
[ b ]R ⊆ [ a ]R .
Given b ∈ [ a ]R Then ( a, b ) ∈ R and hence ( b, a ) ∈ R as R is symmetric. Let
c ∈ [ a ]R .Then ( a, c ) ∈ R .
Now ( b, a ) ∈ R and ( a, c ) ∈ R . Hence ( b, c ) ∈ R .So c ∈ [b ]R .
Hence we have [ a ]R ⊆ [b ]R . Thus we have [ a ]R = [b ]R .

3. If a, b ∈ X , then either [ a ]R ∩ [b]R = φ or [ a ]R = [b]R .


To show that if [ a ]R ∩ [b ]R ≠ φ then [ a ]R = [b ]R . Assume that [ a ]R ∩ [b ]R ≠ φ . Let
c ∈ [ a ]R ∩ [b ]R As c ∈ [ a ]R , by 2), we have [ c ]R = [ a ]R . Again as c ∈ [b ]R , we have
[c ]R = [b]R . Thus [ a ]R = [b]R = [ c ]R . Thus if a, b ∈ X and [ a ]R ∩ [b]R ≠ φ , then
[ a ]R = [ b ]R .
We observe a connection between equivalence relations and partitions.
Note:

83
Every equivalence relation R on a non-empty set X determines a unique partition on X,
whose members are equivalence classes of R.

Solution:
Let R be an equivalence relation on a non-empty set X. P = {[ a ]R | a ∈ X } be the
collection of all equivalence classes of R.
Each element of P is a non-empty subset of X as a ∈ [ a ]R for all a ∈ X .
If [ a ]R ≠ [b ]R , then by the properties of equivalence classes, we have [ a ]R ∩ [b ]R = φ .
If x ∈ X , then x ∈ [ x ]R . So X = ∪ [ a ]R .
Hence P is a partition of X and each member of P is an equivalence class of R.
This partition P, whose elements are equivalence classes of R, is unique as R –
equivalence class of any element is unique and is denoted by X | R = {[ x ]R / x ∈ X } .
Now we observe that a partition P on a set X determines an equivalence relation R on
X.
Note:
Let P be a partition on a non-empty set X. Then there is an equivalent relation R on X
such that P = X | R.
Solution:
Let P be a partition on a non-empty set X. Define a relation R on X as a R b ⇔ a, b ∈ A
for some block A ∈ P .
To show that R is an equivalence relation.
As X = U A, given any a ∈ X , we can find a block A ∈ P such that a ∈ A . Thus aRa,
A∈P

for all a ∈ X . Hence R is reflexive.


If aRb, then a, b ∈ A for some A ∈ P . So b R a is also true. ∴ a R b ⇒ b R a . Thus R is
symmetric.
To show R is transitive. Let aRb and bRc, then a, b are in some block A of P and b, c are
in some block B of P. So b ∈ A ∩ B . Hence A ≠ B . But blocks of P are mutually
disjoint, we have A = B. So a, b, c are all in the same block A of P. Hence aRc. This
shows that R is transitive. Hence R is an equivalence relation on X. Let a ∈ X . Then a is
an element of exactly one block A of P. If b ∈ A , then as a and b are in the same
member of P, we have aRb. If b ∉ A , then there is no block of P containing both a and
b, as blocks of P are mutually disjoint. So ( a, b) ∈ R . Thus aRb if and only if b ∈ A .
So [ a ]R = {b ∈ X | ( a, b ) ∈ R} = A . Hence the equivalence class of R are the blocks of
P and P = X | R.
Examples:
1. Let A = {1, 2, 3, 4}and P = {{1}, {2, 4}, {3}}. Find the equivalence relation on R
determined by the partition P.

Solution:

84
The blocks of P are {1}, {2,4} and {3}. If R is the equivalence relation determined by P,
then to each element a ∈ A , only the elements of the block in which a is an element, are
related to a under R. So as 1 ∈ {1}, we have (1,1) ∈ R .
As {2, 4} is a block, 2 and 4 are related only to the elements of {2, 4}. So (2, 2), (2, 4),
(4, 2), (4, 4) ∈ R .
Similarly (3, 3) ∈ R .
So the equivalence relation R determined by P is R = (1, 1), (2, 2), (2, 4), (4, 2), (4, 4),
(3, 3)}
2. Find the unique partition P on A = {1, 2, 3, 4, 5} determined by the equivalence
relation R, where R = {(1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (3, 1), (3, 3), (3, 5), (4, 2), (4, 4),
(5, 1), (5, 3),(5, 5)}
Solution:
Now R(1) = {1, 3, 5} and R(2) = {2, 4}
Note that R(1) = R(3) = R(5) and R(2) = R(4).
The partition P is {{1, 3, 5}, {2, 4}}.

2.5.4 RELATION MATRIX:


Let X = { x1 , x2 ,...xm } , Y = { y1 , y2 ,... ym } be ordered sets, R be a relation defined from X
to Y, then the relation matrix R, is defined as M R = ( mij )mxn
⎧⎪ 1 if ( x, y ) ∈ R
where, mij = ⎨
⎪⎩0 if ( x, y ) ∉ R
Example
1: Let X = {1, 2,3} , Y = {a, b} , R = {(1, a ) , (1, b ) , ( 2, a ) , ( 3, b )} be a relation from X and Y.
Then
a b
1 ⎡1 1 ⎤
M R = 2 ⎢⎢1 0 ⎥⎥
3 ⎢⎣ 0 1 ⎥⎦
2: Let R = {(1,1) , (1, 2 ) , ( 2,1) , (1,3) , ( 2, 2 ) , ( 3,1) , ( 3, 2 )} be a relation on X = {1, 2,3} . Then
⎡1 1 1 ⎤
M R = ⎢⎢1 1 0 ⎥⎥
⎢⎣1 1 0 ⎥⎦
It is interesting to observe that reflexive, irreflexive, symmetric and anti-symmetric: these
relation characteristics are very easy to recognize by inspection of the zero-one relation
matrix.

⎛1 ⎞ ⎛0 ⎞ ⎛ 1 ⎞ ⎛ 0 ⎞
⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟
⎜ 1 ⎟ ⎜ 0 ⎟ ⎜1 0⎟ ⎜1 1⎟
⎜ 1 ⎟ ⎜ 0 ⎟ ⎜ ⎟ ⎜ ⎟
⎜⎜ ⎟ ⎜⎜ ⎟ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟
⎝ 1 ⎟⎠ ⎝ 0 ⎟⎠ ⎝ 0 ⎠ ⎝ 0 ⎠

85
Reflexive: Irreflexive Symmetric Antisymmetric
All 1’s on diagonal all 0’s on diagonal all identical across all 1’s are across
Diagonal from 0’s.

2.5.5 DIGRAPH OF A RELATION:


The relation R, on a finite set A, can be represented pictorially as follows: a small circle is
drawn for each element of A and marked with the corresponding element. These circles
are called vertices. An arc is drawn from the vertex ai to the vertex aj, if and only if
ai R aj. This is called an edge.
Thus, if R is a relation on A, the vertices in the diagraph of R correspond exactly to
the elements of the set A and the edges correspond exactly to the ordered pairs in R.
In a digraph of R, the indegree of a vertex is the number of edges terminating at the
vertex. The outdegree of a vertex is the number of edges leaving the vertex.
Example:
1. Let A = {a,b,c,d} and R the relation on A that has the matrix
⎛1 1 0 1⎞
⎜ ⎟
⎜ 0 0 1 0⎟
MR =
⎜0 0 1 1⎟
⎜⎜ ⎟⎟
⎝1 0 0 0⎠
Construct the digraph of R and list the indegrees and outdegrees of all vertices.
Solution:
Clearly R = {(a, a), (a, b), (a, d), (b, c), (c, c), (c, d), (d, a)}.

The digraph of R is shown below

a c

The in degrees and out degrees of all vertices are given in the following table.

a b c d
In degrees 2 1 2 2
Out degrees 3 1 2 1

2. What are the ordered pairs in the relation R represented by the directed graph.

86
1 2

4 3

Solution: R = {(1,3), (1,4), (2,1), (2,2), (2,3), (3,1), (3,3), (4,1), (4,3)}

2.5.6 OPERATIONS ON RELATIONS:


As relations from A to B are subsets of A x B, the usual operations on sets such as union,
intersection, complementation can be applied to relations also.
Let R and S be two binary relations.
R ∪ S = {( x, y ) | xRy or xSy}
R ∩ S = {( x, y ) | xRy or xSy}
R − S = {( x, y ) | xRy or xSy
/ }
R ⊕ S = {( x, y ) | ( x, y ) is either in R or in S but not in both}
Example:
Let R1 be the “less than” relation on the set of real numbers and let R2 be the “greater
than” relation on the set of real numbers, that is R1 = {( x, y ) | x < y} and
R2 = {( x, y ) | x > y}. What are R1 ∪ R2 , R1 ∩ R2 , R1 − R2 , R2 − R1 , and R1 ⊕ R2 ?
Solution:
We note that ( x, y ) ∈ R1 ∪ R2 if and only if ( x, y ) ∈ R1 or ( x, y ) ∈ R2 . Hence
( x, y ) ∈ R1 ∪ R2 if and only if x < y or x > y .Thus ( x, y ) ∈ R1 ∪ R2 if and only if x ≠ y , it
follows that R1 ∪ R2 = {( x, y ) | x ≠ y} .
If ( x, y ) to belong to R1 and R2 then x < y and x > y which is not possible. Hence
R1 ∩ R2 = 0 .
It can be observed R1 − R2 = R1 , R2 − R1 = R2 and
R1 ⊕ R2 = R1 ∪ R2 − R1 ∩ R2 = {( x, y ) | x ≠ y} .
COMPOSITION OF RELATIONS:
Let R be a relation from X to Y and S be a relation from Y to Z. The composite relation
R o S of R and S is a relation from X to Z defined by
( x, y ) ∈ R and ( y, z ) ∈ S ⇒ ( x, z ) ∈ R o S .
The operation ‘ o ’ in R o S is called “composition of relations”.

x R y S z x RoS z

87
For example, Let R = {(1, 2 ) , ( 2,3) , ( 3, 4 ) , ( 2, 2 )} and S = {( 2,3) , ( 4,1) , ( 4,3) , ( 2,1)}
Then R o S = {(1,3) , (1,1) , ( 3,1) , ( 3,3) , ( 2,3) , ( 2,1)} , S o R = {( 2, 4 ) , (4, 2), ( 4, 4 ) , ( 2, 2 )}

Note:
Let R be a relation on a set A. The Rn, n = 1, 2, 3…. are defined recursively by R1 = R,
Rn+1 = Rn o R.
Example:
1. Let R = {(1, 1), (2, 1), (3, 2), (4, 3)}. Show that R4 = R3.
Solution:
R2 = R o R and hence R2 = {(1, 1), (2, 1), (3, 1), (4, 2)}, R3 = R2 o R. Hence R3 = {(1, 1),
(2, 1), (3,1), (4,1)}, R4 = R3 o R. Hence R4 = {(1, 1), (2, 1), (3, 1), (4, 1)}. Therefore
R4 = R3.
2. Show that the relation R on a set A is transitive if and only if R n ⊆ R for n = 1, 2, 3…
Solution:
Assume R n ⊆ R for all n . In particular R 2 ⊆ R . To prove R is transitive. Let ( a, b ) ∈ R
and ( b, c ) ∈ R , then by the definition of composition, ( a, c ) ∈ R 2 . Since R 2 ⊆ R , this
means that ( a, c ) ∈ R . Hence R is transitive.
On the other hand assume that R is transitive. To show that R n ⊆ R for all n. We shall
prove this by induction on n. The result is true for n = 1.
Assume that R n ⊆ R where n is a positive integer. To show that R n +1 ⊆ R . Assume
that ( a, b ) ∈ R n +1 . Then, since R n +1 = R n o R , there is an element x with x ∈ A such that
( a, x ) ∈ R and ( x, b ) ∈ R n . The inductive hypothesis, namely that R n ⊆ R , implies that
( x, b ) ∈ R . Since R is transitive, and ( a, x ) ∈ R and ( x, b ) ∈ R , it follows that ( a, b ) ∈ R .
This shows that R n +1 ⊆ R . Hence if R is transitive, then R n ⊆ R for all n.
Example:
1. Suppose R is a relation on A. If R is symmetric and transitive, then R is reflexive. Is the
statement true? Justify your answer.
Solution:
No. Consider relation R = {( a, a ) , ( a, b ) , ( b, a ) , ( b, b )} on the set A = {a, b, c).This is not
reflexive since (c, c) is not in R. However R is symmetric and transitive.

2. Say whether or not R is an equivalence on A in each case given below. If it is an


equivalence relation, what are the equivalence classes and how many equivalence classes
are there?
(a) R = {( x, y ) ∈ W × W | the words x and y start with the same letter} where W is
the set of all words in the Oxford English dictionary.
Solution:
Clearly R is an equivalence relation since it is reflexive, symmetric and transitive. The
equivalence class of x with respect to R is the set [ x ]R = the set of words y has the same

88
first letter as x . There are 26 equivalence classes, one for each letter of the English
alphabet.
(b) R = {( x, y ) ∈ W × W | the words x and y have at least one letter in common}.

Solution:
Clearly S is reflexive and symmetric. Let w1 be the word “eat”, w2 be the word “and”,
and w3 be the word “throw”. In this case w3 Sw1 and w1 Sw2 , but it does not imply
w3 Sw2 . Therefore S is not transitive. Hence S is not an equivalence relation.
(c) R = {( x, y ) ∈ × and x ≤ y .
Solution:
R is reflexive and transitive. It is not symmetric as 2R3 ⇒ 3R2. It is not antisymmetric
either since -3R3 and 3R-3 but 3 ≠ -3.
(d) R = {( x, y ) ∈ B × B} , where B is the set of all bit strings of same length and x and
y have the same number of 1s}.
Solution:
R is reflexive, symmetric and transitive and therefore an equivalence relation. There is a
n equivalence class for each natural number corresponding to bit strings with that number
of 1s.
3. Let A and B be two subsets of the set of all integers and consider the cartesian product
C = A × B . Define a relation R on C as ( a, b ) R ( c, d ) if and only if a + d = b + c.
a) Show that R is an equivalence relation..
b) Partition the set {0, 1, 2} x {0, 1, 2} into the distinct equivalence classes under R.
c) How many equivalence classes under R are there on the set {0,1,…,n} x {0,1,…,n}.
Explain.
Solution:
a) To prove that R is an equivalence relation.
( a, b ) R ( c, d ) since a + b = b + a. Hence R is reflexive.
( a , b ) R ( c, d ) ⇒ a + d = b + c ⇒ c + b = d + a ⇒ ( c, d ) R ( a , b )
Let ( a, b ) R ( c, d ) and ( c, d ) R ( e, f ) . This implies a + d = b + c and c + f = d + e.
Adding we get a + d + c + f = b + c + d + e ⇒ a + f = b + e ⇒ ( a, b ) R ( e, f ) .
Hence ( a, b ) R ( c, d ) and ( c, d ) R ( e, f ) ⇒ ( a, b ) R ( e, f ) ⇒ R is transitive.
Since R is reflexive, symmetric and transitive it is an equivalence relation
b) ( a, b ) R ( c, d ) ⇒ a + d = b + c ⇒ a-b = c – d. This shows that with any equivalence
class C we can associate a difference h, such that ( a, b ) ∈ C ⇔ a − b = h. This gives us an
easy way to list the equivalence classes of {0,1,2} x {0,1,2}.
h = -2 : {(0,2)}
h = -1 : {(0,1), {1,2)}
h = 0 : {(0,0), (1,1), (2,2)}
h = 1 : {(1,0), (2,1)}
h = 2 : {(2,0)}

89
c) Using the observation from part b), it is enough to count the number of possible
differences. This is 2n + 1 since the difference can be any value in { - n, …,n}.

4. For any function f: A→B, define a binary relation, Rf, on A by the condition:
a1 R f a2 ⇔ f(a1) = f(a2).
(a) Show that R f is an equivalence relation.
Solution:
R f is reflexive since for any a ∈ A, f ( a ) = f ( a ) ⇒ aR f a
aR f b ⇒ f (a) = f (b) ⇒ f (b) = f (a) ⇒ bR f a . Hence R f is symmetric.
Let aR f b and bR f c . Then f (a) = f (b) and f (b) = f (c) ⇒ aR f c . Hence R f is
transitive.
Hence R f is an equivalence relation.

(b) Show that for every equivalence relation E on A, there exists a set B and a function f:
A→B such that E = R f .
Solution: Let B be the blocks of the partition of A defined by E, that is ,
B: = {[a ]E | a ∈ A} .
Define f: A→B by the rule
f(a): = [a ]E .
So
a1 R f a2 ⇔ f(a1) = f(a2)
⇔ [ a1 ]E = [ a2 ]E
⇔ a1 Ea2
which means that R f = E as required.

5. How many binary relations are there on a set S of n elements?

Solution:
2
2n . We look at the matrix that corresponds to the relations such that the element of the
n x n matrix is 1 if the corresponding pair is in the relation and it is 0 otherwise. There are
2
2n many different possible Boolean (0 – 1) n x n matrices. Another way of reasoning
about this is to say that there are n2 possible ordered pairs, and any subset of those pairs is
a possible relation. If A is the set of all pairs, then all possible relations are just all
possible subsets of A, and we know that P ( A ) = 2 = 2n .
A 2

6. How many symmetric binary relations are there on set S of n elements?


Solution:
In a symmetric binary relation, if (a, b) ∈ R, then ( b, a ) ∈ R . The matrix associated with
a symmetric relation is symmetric. Hence the entries in the triangle above the main
diagonal are the same as the entries in the triangle below the diagonal. The total

90
number of entries in n2. The number of entries on the diagonal is n and the number
of entries on the upper side of the diagonal is ( n 2 − n ) / 2 . Therefore, there are
n( n+1) / 2
n(n – 1)/2 + n = n(n + 1)/2 entries that can be set. Hence, there are 2 different
symmetric matrices / relations.

7. How many reflexive binary relations are there on set S of n elements?


Solution:
In a reflexive binary relations, ( a, a ) ∈ R for all a ∈ S , and this the matrix associated
with a reflexive relation must have 1’s along the main diagonal. These n entries are fixed,
and hence the number of entries that can be set is n 2 − n . The number of matrices
2
corresponding to reflexive relations is 2n − n , and hence so is the number of reflexive
binary relations.
Using this idea you can count the number of relations that are not reflexive by just
subtracting the number of reflexive relations from the total number of relations.

8. How many symmetric and reflexive binary relation are there on set S of n elements?
Solution:
The matrix associated with a symmetric and reflexive relation is symmetric and has 1’s
along the main diagonal. The total number of entries is n2 and there are (n 2 − n) / 2 that
are on the upper side of the diagonal. Hence the number of such relations is 2(
n( n−1) ) / 2
.

9. How many symmetric or reflexive binary relations are there on set S of n elements?
Solution:
By inclusion-exclusion, the number of symmetric or reflexive relations equals the number
of reflexive relations plus the number of symmetric relations minus the number of
reflexive and symmetric relations, which equals 2(
n( n −1) ) / 2
+ 2 n − n − 2(
2 n ( n −1) ) / 2
.

2.5.7 RELATION MATRIX FOR COMPOSITION:


The relation matrix for R o S is given by M RoS = M R M s ' where is defined as
follows.
M R M s = ( mij )
where mij is 1 if and only if row i of M R and column j of M S have a 1 in the same
relative position k, for some k.
Example:
Let X = (1,2,3,4,5)
Let R = {(1, 2 ) , (1,5 ) , ( 2, 2 ) , ( 3, 4 ) , ( 5,1) , ( 5,5 )}
S = {(1,3) , ( 2,5 ) , ( 3,1) , ( 4, 2 ) , ( 4, 4 ) , ( 5, 2 ) , ( 5,3)} be relations on X. Find
M R , M S , M RoS , M R2 .

91
Solution:
⎡0 0 1 0 1⎤ ⎡0 0 1 0 0⎤
⎢0 0 1 0 0 ⎥⎥ ⎢0 0 0 0 1 ⎥⎥
⎢ ⎢
Then M R = ⎢ 0 0 0 1 0⎥ , M s = ⎢1 0 0 0 0⎥
⎢ ⎥ ⎢ ⎥
⎢0 0 0 0 0⎥ ⎢0 1 0 1 0⎥
⎢⎣1 0 0 0 1 ⎥⎦ ⎢⎣0 1 1 0 0 ⎥⎦
⎡0 1 0 0 1⎤ ⎡0 0 1 0 0⎤ ⎡0 1 1 0 1⎤
⎢0 1 0 0 0 ⎥⎥ ⎢0 0 0 0 1 ⎥⎥ ⎢0 0 0 0 1 ⎥⎥
⎢ ⎢ ⎢
M RoS = M R M S = ⎢0 0 0 1 0⎥ ⎢1 0 0 0 0 ⎥ ∴ M RoS = ⎢0 1 0 1 0⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢0 0 0 0 0⎥ ⎢0 1 0 1 0⎥ ⎢0 0 0 0 0⎥
⎢⎣1 0 0 0 1 ⎥⎦ ⎢⎣0 1 1 0 0 ⎥⎦ ⎢⎣ 0 1 1 0 0 ⎥⎦
and M R 2 = M R M R
⎡0 1 0 01 ⎤ ⎡ 0 1 0 0 1 ⎤ ⎡1 1 0 0 1⎤
⎢0 1 0 00 ⎥⎥ ⎢⎢0 1 0 0 0 ⎥⎥ ⎢⎢0 1 0 0 0 ⎥⎥

= ⎢0 0 0 10 ⎥ ⎢0 0 0 1 0 ⎥ = ⎢0 0 0 0 0⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢0 0 0 00 ⎥ ⎢0 0 0 0 0⎥ ⎢0 0 0 0 0⎥
⎢⎣1 0 0 01 ⎥⎦ ⎢⎣1 0 0 0 1 ⎥⎦ ⎢⎣1 1 0 0 1 ⎥⎦
∴ R 2 = {(1,1) , (1, 2 ) , (1,5 ) , ( 2, 2 ) , ( 5,1) , ( 5, 2 ) , ( 5,5 )}

2.5.8 CLOSURE OPERATIONS ON RELATIONS:


For any property X, the X closure of a set A is defined as the smallest superset of A
that has the given property.

REFLEXIVE CLOSURE:
Let R be a relation on A. The reflexive closure of R is obtained by adding ( a , a ) to R
for each a ∈ A . If IA = ((a,a) / a ∈ A )
R1 = R ∪ I A
Examples:
1. Let X = {2, 4, 6}
R = {( 2, 2 ) , ( 2, 4 ) , ( 4, 2 ) , ( 6, 4 )} be a relation on X. Find the reflexive closure of R.
Solution:
Clearly R is not reflexive.
Add (4,4), (6,6) to R.
Reflexive closure of R is
R ∪ I A = {( 2, 2 ) , ( 2, 4 ) , ( 4, 2 ) , ( 6, 4 ) , ( 4, 4 ) , ( 6, 6 )}

2. X = The set of integers.


R = {( x, y ) | x < y} be a relation on R. Find the reflexive closure of R.

92
Solution:
The reflexive closure of R = {( x, y ) | x ≤ y} .

SYMMETRIC CLOSURE:
Symmetric closure R1 of a relation R is obtained by adding (b,a) to R for each (a,b) in R
R1 = ( R ∪ R −1 ) .
Example:
1. Let X = {1, 2,3, 4}
R = {(1, 2 ) , ( 2,3) , (1,3) , ( 3, 4 )} . What is the symmetric closure of R.
Solution:
R −1 = {( 2,1) , ( 3, 2 ) , ( 3,1) , ( 4,3)}
Symmetric closure of R1 = ( R ∪ R −1 ) = {(1, 2 ) , ( 2,3) , (1,3) , ( 3, 4 ) , ( 2,1) , ( 3, 2 ) , ( 3,1) , ( 4,3)}
2. What is the symmetric closure of the relation R = {(a, b) | a > b} on the set of positive
integers.
Solution:
The symmetric closure of R is given by :
( R ∪ R −1 ) = {( a, b ) | a > b} ∪ {( b, a ) | a > b} = {( a, b ) | a ≠ b} .
TRANSITIVE CLOSURE:
Transitive closure R + of a relation R on a set X is obtained by repeatedly adding (a,c) to
R for each (a,b) and (b,c) in R.
Note: R+is the transitive closure of R, if
(i) R ⊆ R +
(ii) R+ is transitive on X.
(iii) There is no transitive relation R1 on X, such that R ⊂ R1 ⊂ R + .

Remarks: If X is a finite set with n elements, then R + = R ∪ R 2 ∪ ... ∪ R n and the matrix
of R + = R ∪ R 2 ∪ ... ∪ R n is M R+ = M R ∨ M R2 ... ∨ M Rn .

Exercise:
Let A = {1,2,3,4} and R = {(1,2), (2,3), (3,3), (3,4),(4,2)} be a relation defined on A.
find the transitive closure of R?
Solution: The matrix of the relation R is given by
⎛0 1 0 0⎞
⎜ ⎟
0 0 1 0⎟
MR = ⎜
⎜0 0 1 1⎟
⎜⎜ ⎟⎟
⎝0 1 0 0⎠

93
⎛0 1 0 0⎞ ⎛0 1 0 0⎞
⎜ ⎟ ⎜ ⎟
0 0 1 0⎟ ⎜0 0 1 0⎟
M R2 = M R MR = ⎜
⎜0 0 1 1⎟ ⎜0 0 1 1⎟
⎜⎜ ⎟ ⎜⎜ ⎟
⎝0 1 0 0 ⎟⎠ ⎝0 1 0 0 ⎟⎠
⎛0 0 1 0⎞
⎜ ⎟
0 0 1 1⎟
=⎜
⎜0 1 1 1⎟
⎜⎜ ⎟
⎝0 0 1 0 ⎟⎠
⎛0 0 1 0⎞ ⎛0 1 0 0⎞ ⎛0 0 1 0⎞
⎜ ⎟ ⎜ ⎟ ⎜ ⎟
0 0 1 1⎟ ⎜0 0 1 0⎟ ⎜0 0 1 1⎟
M R3 = M R 2 MR = ⎜ =
⎜0 1 1 1⎟ ⎜0 0 1 1⎟ ⎜0 1 1 1⎟
⎜⎜ ⎟ ⎜⎜ ⎟ ⎜ ⎟
⎝0 0 1 0 ⎟⎠ ⎝0 1 0 0 ⎟⎠ ⎜⎝ 0 0 1 0 ⎟⎠
⎛0 0 1 0⎞ ⎛0 1 0 0⎞ ⎛0 0 1 1⎞
⎜ ⎟ ⎜ ⎟ ⎜ ⎟
0 0 1 1⎟ ⎜0 0 1 0⎟ ⎜0 0 1 1⎟
M R 4 = M R3 MR = ⎜ =
⎜0 1 1 1⎟ ⎜0 0 1 1⎟ ⎜0 1 1 1⎟
⎜⎜ ⎟ ⎜⎜ ⎟ ⎜ ⎟
⎝0 0 1 0 ⎟⎠ ⎝0 1 0 0 ⎟⎠ ⎜⎝ 0 1 1 1⎟⎠
∴ As A = 4, we get M R+ = M R ∨ M R2 ∨ M R3 ∨ M R4
⎛ 0 1 0 0 ⎞ ⎛ 0 0 1 0 ⎞ ⎛ 0 0 1 0 ⎞ ⎛ 0 0 1 1⎞
⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟
0 0 1 0 ⎟ ⎜ 0 0 1 1 ⎟ ⎜ 0 1 1 0 ⎟ ⎜ 0 0 1 1⎟
i.e., M R+ = ⎜ ∨ ∨ ∨
⎜ 0 0 1 1 ⎟ ⎜ 0 1 1 1 ⎟ ⎜ 0 1 1 1 ⎟ ⎜ 0 1 1 1⎟
⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟
⎝ 0 1 0 0 ⎠ ⎝ 0 0 1 0 ⎠ ⎝ 0 0 1 1 ⎠ ⎝ 0 1 1 1⎠
⎛ 0 1 1 1⎞
⎜ ⎟
0 1 1 1⎟
=⎜
⎜ 0 1 1 1⎟
⎜⎜ ⎟⎟
⎝ 0 1 1 1⎠
∴ Hence R+ = {1,2), (1,3), (1,4), (2,2), (2,3), (2,4), (3,2), (3,3), (3,4), (4,2), (4,3), (4,4)}
2.5.9 WARSHALL’S ALGORITHM:
We now describe a more efficient algorithm to compute the transitive closure of a
relation, called Warshall algorithm.
Let X = { x1 , x2 ,...xn } and R be a relation on X.
For each k ,1 ≤ k ≤ n . We define a matrix Wk = ( wij ) as follows
where wij is 1 if and only if there is a chain from xi to x j in R whose interior vertices, if
any, come from the set { x1 , x2 ,..., xk } , otherwise wij = 0 .
Note that Wn = M R+
We define W0 to be M R .
We compute Wk from Wk −1 as follows:

94
Let Wk = ( tij ) and
Wk −1 = ( sij )
If tij = 1 , then there must be a chain from xi to x j in R whose interior vertices come from
the set { x1 , x2 ,..., xk } . So, we can obtain a path, (whose interior vertices are all distinct),
from xi to x j in R whose interior vertices are from { x1 , x2 ,..., xk } .
If xk is not an interior vertex of the path, then all the interior vertices of the path must
actually come from the set { x1 , x2 ,..., xk −1} . So sij = 1 .
If xk is an interior vertex of this path, then xk appears only once in this path as an
interior vertex and all other interior vertices come from { x1 , x2 ,..., xk −1} .
If the path is x1a1a2 ...al −1al al +1...am x j and al = xk , then the sub paths x1a1a2 ...al −1 ( = xk )
and ( xk = ) a p al +1...am x j are paths from xi to xk and xk to x j respectively.
Also the interior vertices of these sub paths are from { x1 , x2 ,..., xk −1}

xk

x2

xi xj

∴ So, sik = 1 and skj = 1 .


Now, tij = 1 if and only if either
sij = 1 or sik = 1 and skj = 1 .
Thus, we can produce Wk fromWk −1 .
Step 1: First transfer all 1’s in Wk −1 to Wk .
Step 2: List the locations p1 , p2 ... in column k of Wk −1 where the entry is 1 and the
locations q1 , q2 ... in row k of Wk −1 where the entry is 1.
Step 3: Put 1 in all positions ( pi , p j ) of Wk .
This procedure is known as Warshall’s algorithm.

95
Example:
Let X = {1, 2,3, 4} and
R = {(1,1) , (1,3) , (1, 4 ) , ( 2, 2 ) , ( 3, 4 ) , ( 4,1)}
We find the transitive closure of R by using Warshall’s algorithms.
⎛1 0 1 1⎞
⎜ ⎟
⎜ 0 1 0 0⎟
Let W0 = M R =
⎜0 0 0 1⎟
⎜⎜ ⎟⎟
⎝1 0 0 0⎠

In Wk −1
New position
k Position of 1’s on Position of 1’s Wk
of 1’s in Wk
column k in row k
1 1,4 (in the 1st column) 1,3,4 (in the 1st (1,1), (1,3), ⎛1 0 1 1⎞
row) (1,4), (4,1), ⎜ ⎟
(4,3), (4,4) ⎜0 1 0 0⎟
⎜0 0 0 1⎟
⎜⎜ ⎟
⎝1 0 1 1 ⎟⎠
2 2 2 (2,2) ⎛1 0 1 1⎞
⎜ ⎟
⎜0 1 0 0⎟
⎜0 0 0 1⎟
⎜⎜ ⎟
⎝1 0 1 1 ⎟⎠
3 1,4 4 (1,4), (4,4) ⎛1 0 1 1⎞
⎜ ⎟
⎜0 1 0 0⎟
⎜0 0 0 1⎟
⎜⎜ 1 0 1

1 ⎟⎠

4 1,3,4 1,3,4 (1,1), (1,3), ⎛1 0 1 1⎞
(1,4), (3,1), ⎜ ⎟
(3,3), (3,4), ⎜0 1 0 0⎟
(4,1), (4,3), ⎜1 0 1 1⎟
(4,4) ⎜⎜ 1 0 1

1 ⎟⎠

∴W4 = M R+
∴ the transitive closure of R is given by
R + = {(1,1) , (1,3) , (1, 4 ) , ( 2, 2 ) , ( 3,1) , ( 3,3) , ( 3, 4 ) , ( 4,1) , ( 4,3) , ( 4, 4 )}

Example:
1. X = {2, 4, 6} , R = {( 2, 4 ) , ( 4, 6 ) , ( 6, 6 )} . Find the transitive closure of R.
As |X| = 3, we have
R 2 = ( R.R ) = {( 2, 4 ) , ( 4, 6 ) , ( 6, 6 )}
R 3 = R 2 .R = {( 2, 4 ) , ( 4, 6 ) , ( 6, 6 )}

96
∴ R = R ∪ R 2 ∪ R 3 = {( 2, 4 ) , ( 4, 6 ) , ( 6, 6 )}
2. X = {( a, b, c, d )}
R = {( b, a ) , ( b, c ) , ( c, a ) , ( c, d ) , ( d , a ) , ( d , c )} Find the transitive closure of R.

⎛0 0 0 0⎞
⎜ ⎟
1 0 1 0⎟
MR = M0 = ⎜
⎜1 0 0 1⎟
⎜⎜ 1 0 1

0 ⎟⎠

In Wk −1
New position
k Position of 1’s on Position of 1’s of 1’s in W Wk
k
column k in row k
1 2, 3, 4 Nil ⎛0 0 0 0⎞
(in the 1st column) st
(in the 1 row) ⎜ ⎟
⎜1 0 1 0⎟
⎜1 0 0 1⎟
⎜⎜ ⎟
⎝1 0 1 0 ⎟⎠
2 - 1,3 - ⎛0 0 0 0⎞
⎜ ⎟
⎜1 0 1 0⎟
⎜1 0 0 1⎟
⎜⎜ ⎟
⎝0 0 1 0 ⎟⎠
3 2,4 1,4 (2,1), ⎛0 0 0 0⎞
(2,4),(4,1) ⎜ ⎟
(4,4) ⎜1 0 1 1⎟
⎜1 0 0 1⎟
⎜⎜ ⎟
⎝1 0 1 1 ⎟⎠
4 3,4 1,3,4 (3,1), (3,3), ⎛ 0 0 0 0⎞
(3,4), (4,1), ⎜ 1 0 1 1⎟

(4,3), (4,4) ⎜
⎜1 0 1 1⎟
⎜⎜ ⎟
⎝1 0 1 1 ⎟⎠
∴W4 = M R+
Hence the transitive closure of R is given by {(b,a), (b,c), (b,d), (c,a),(c,c),(c,d),
(d,a),(d,c),(d,d)}

2.5.10 PARTIAL ORDERING:


A relation R on a set A is called a partial order if R is reflexive, antisymmetric and
transitive and {A,R} is called a partially ordered set. Further if aRb or bRa for every a,b
in A , then R is called a simple ordering on A and the set {A, R} is called a totally ordered
set.

97
HASSE DIAGRAM:
A Hasse Diagram is a pictorial representation of a partially ordering on a finite set.

PROCEEDURE:
• Let ( A , R) be given partial ordered set.
• Consider the digraph of this relation.
• Since R is reflexive a loop will be present at every vertex. Remove these loops.
• Remove the edges present because of transitivity.
• Arrange each edge so that its initial vertex is below its terminal vertex.
• Remove all the arrows in the directed graph.
The resulting diagram is called a Hasse Diagram for the relation R.

Example:

1. Let X = {1,2,3,4} and let R be the relation given by xRy if x ≤ y. Draw the Hasse
diagram of R.

Solution:
R = {(1,1) , (1, 2 ) , (1,3) , (1, 4), (2, 2), (2,3), (2, 4), (3,3), (3, 4), (4, 4)}
Digraph of R is Fig (i).
Removing the loops gives Fig (ii)
Removing the edges present because of transitivity; arranging each edge so that its initial
vertex is below its terminal vertex and remove all arrows gives Fig (iii)
The Hasse diagram of R is given by Fig (iii)

4 4 4

3 3 3

2
2 2

1
1 1
Fig (i) Fig (ii) Fig (iii)
2. Construct Hasse diagram of the partal order R given by aRb if and only if a divides b
for a,b in the set A = {1,2,3,4,6,8,12}.

Solution:
⎧⎪(1,1) , (1, 2 ) , (1,3) , (1, 4), (1, 6), (1,8), (1,12), (2, 2), (2, 4), (2, 6), (2,8), (2,12), (3,3), (3, 6), ⎫⎪
R=⎨ ⎬
⎪⎩(3,12), (4, 4), (4,8), (4,12), (6, 6), (6,12), (8,8), (12,12) ⎪⎭

98
Digraph of R is Fig (i).
Removing the loops gives Fig (ii)
Removing the edges present because of transitivity; arranging each edge so that its initial
vertex is below its terminal vertex and remove all arrows gives Fig (iii)
The Hasse diagram of R is given by Fig (iii)

8 12
8 12 8 12

4 6 4 6
4 6

2 3

2 3
2 3
1
1 1
Fig (i) Fig (ii) Fig (iii)

3. Let P be the power set of the set {a,b,c}. Consider the partial ordering on P given by
set inclusion. Contruct its Hasse diagram.

Solution:

{a,b,c}

{a,c} {a,b} {b,c} is the required Hasse diagram

{a} {b}
{c}

φ
MAXIMAL AND MINIMAL ELEMENTS:
Given a partially ordered set (S,R) an element a in S is called maximal if there is no b
in S such that aRb. An element a is called the greatest element if bRa for all b in S. An
element a in S is called manimal if there is no b in S such that bRa. An element a is called
the least element if aRb for all b in S.

Note:

99
Maximal and minimal elements can be identified using Hasse diagram since they are the
top and bottom elements in the diagram.

1. Let P be the set of the set {2,4,5,10,12,20,25}. Consider the partial ordering R on P
given by aRb if and only if a divides b. Construct its Hasse diagram. Write down the
maximal and minimal elements.

Solution:

12 20

4 10 25 is the required Hasse diagram.

2 5

The maximal elements are 12,20 and 25 and the minimal elements are 2 and 5.

2. Determine the greatest element and the least element for the poset given by

Solution:
The Hasse diagram for the given poset is given by

a b

This has no least element. Its greatest element is d.

LOWER AND UPPER BOUNDS:


Let S be a partial ordered set with a relation R. Let A be a subset of S. If u is an element
of S such that aRu for all elements a in A, then u is called an upper bound of A. Similarly,
an element l is called a lower bound of A if l is an element of S such that lRa for all
elements a in A. An element x is called the least upper bound of A if x is an upper bound
if aRx whenever a is in A and xRz when ever z is an upper bound of A. Similarly an
element y is called the greatest lower bound of A if y is the lower bound of A and zRy
whenever z is a lower bound of A.

LATTICES:

100
A partially ordered set in which every pair of elements has both least upper bound and
greatest lower bound is called a lattice.

Example:
The set A = {1,2,4,8,16} with partial ordering given by aRb for a,b in A if and only if a
divides b is a lattice whereas the set A = {1,2,3,4,5} with partial ordering given by aRb
for a,b in A if and only if a divides b is not a lattice.

2.5.11 FUNCTIONS:

A special case of relation is that which associates to each member of the first set only
one member of the second set. Such a relation is called a function from one set into the
other.
A relation from A to B is said to be a function from A to B if to each a ∈ A , there is
exactly one b ∈ B such that ( a, b ) ∈ f . When ( a, b ) ∈ f , we write b = f ( a ) . A function
from A to B is also written as f : A → B which is read as “ f is a function of A into B”.
Here A is called the domain of f , denoted by D( f ) and B is called the codomain of f ,
y is the image of a under f , x is a pre-image of y under f .

Functions are also called mappings or transformations.


If the domain and co-domain of a function f are both the same set, say f : A → A , then
f is called an operator or transformation on A.
Two functions f : A → B and g : A → B are said to be same, and we write
f = g, if f ( x ) = g( x ), for every x ∈ A .

Not every relation is a function


1. The relation R “is less than” in the set of all real numbers is not a function in the
sense that if we consider any one member of the set, say 3, we see that the
element 3 is related to all the real numbers less than 3.
2. The relation “is a cube of” in the set of real numbers is a function since there is
only one real number y which is the cube of a given real number x.

Examples :
1. Let R be the set of all real numbers and B be the set of all non-negative real
numbers. Define f : R → B as f ( x) = x 2 . f defines a function from R to B.
2. Let A be the set of all countries in the world and let f assign to each member of A
its capital city. Let B be the set of capital cities in the world. Then f is a function
from A to B. Since the capital of India is New Delhi, we have f(India) = New
Delhi.
In this example, the correspondence between the two sets A and B is geographical.

Note: The rule of correspondence which defines a function may be indicated by a


diagram as shown below.

101
a x

b y
c z

d w

Here A = {a,b,c,d}, B = {x,y,z,w} and f : A→B is defined by f(a) = y, f(b) = x, f(c) = z and
f(d) = y. We can also write this f as the set of ordered pairs f = {(a,y), (b,x), (c,z), (d,y)}.
Given an element a in A there is exactly one ordered pair whose first element is a.
Hence f is a function. Even though the element y ∈ B appears as the second element of
two different ordered pairs in f, the definition of f holds good. Thus a function may take
the same value at two different elements of A.

RANGE:
Let f be a mapping of A into B i.e., let f: A→B. Each element in B need not appear as
an image of some element in A. The range of f contains of exactly those elements in B
which appear as the image of at least one element in A. We denote the range of f: A→B
by f(A). It is also denoted by R(f) = f(A) = {f(a) ∈ B | a ∈ A }. Clearly R(f) ⊆ B.

ONE - ONE FUNCTIONS:


Let f map A into B. Then f is called a one-to-one function (or one-one function) if
different elements in A are assigned to different elements in B.

Note:
1. f: A→B is one-to-one if any one of the following equivalent conditions hold:
(i) No two members of A correspond to the same member of B.
(ii) For x, y ∈ A , x ≠ y implies f(x) ≠ f(y).
(iii) If f(x) = f(y) then x = y.

(iv) No two distinct ordered pairs of f have the same second element when f is
described as a relation (i.e. a subset of A x B).
(v) The pre-image of each element in the range is a singleton.
2. Conditions (iii) given in the above note will be useful for proving that a given function
is one -one.
3. A one-one function is also known as injective.

102
Example:
Consider the graph representations of functions given below.

Domain {A, B, C, D}, Range {E, F, G, H, I}

A E E
A A
E
F B F B F
B
•G C
C G C G
•H
D D H
I D
H
•I I

One-to-one Not one-to-one Not even a function


(Many to one) (One to many)

ONTO FUNCTION:
Let f be a function of A into B. then the range f(A) of the function f is a subset of B.
i.e. f(A) ⊂ B.
If f(A) = B i.e. the range of f is equal to the entire co-domain B or if every member of
B appears as the image of at least one element of A, then we say “f is a function of A onto
B” or “f maps A onto B” or f is an onto function.

Note:
An onto function f is also known as a surjective function. If f: A→B is both one-to-one
and onto, then f is called a bijection. In this case, every element of B has exactly one
pre-image in A.

Fig 1, Fig 2: Domain {A, B, C, D, E}, Range {F, G, H, I}, Fig 3 Domain {A, B, C, D}, Range {F, G, H, I}
Fig 4 Domain {A, B, C, D}, Range {F, G, H, I, J}

A F A F A A
F F
B G
B G B G B G
C H C H

103
•H C
D D C H I
I I D
•J
E E D I

Fig 1 Fig 2 Fig 3 Fig 4


Onto Not Onto Both 1-1 1-1
(but not 1-1) (or 1-1) and onto (but not onto)

Example:
1. Given a f : A → B , where A and B are finite. If f is injective, then A ≤ B . If f is
surjective then B ≤ A . If f is bijective, then A = B .
Solution:
Put n = A , A = { x1 , x2 ,..., xn } and m = B , B = { y1 , y2 ,..., ym } .
If f were injective then f ( x1 ) , f ( x2 ) ,..., f ( xn ) are all distinct, and among the yk .
Hence n ≤ m .
If f were surjective then each yk is hit, and for each, there is an xi with f ( xi ) = yk .
Thus there are at least m different images, and so n ≥ m .

2. Let A and B be finite sets with |A| = n and |B| = m. then


(i) The number of functions from A to B is mn.
(ii) If n ≤ m, the number of injective functions from A to B is m(m-1)(m-2)…(m – n+1).
If n>m, there are no injective functions from A to B.
Solution:
Each of the n elements of A must be assigned an element of B, and hence there are
(m.m….m) = mn possibilities, and thus mn functions. If a function from A to B is
injective then we must have n ≤ m. If to different inputs we must assign different outputs
then to the first element of A we may assign any of the m elements of B, to the second
any of the m – 1 remaining ones, to the third any of the m – 2 remaining ones, etc., and
so have m(m – 1)…(m – n +1) injective functions.

3. Let A = {1, 2, 3, 4} and B = {a, b, c}. How many functions are there from A to B and
how many injective functions are there from B to A?

Solution:
There are 34 = 81function from A to B and none are injective.
From B to A there are 43 = 64 functions and 4.3.2 = 24 are injective.
Note:
Let A and B be two finite sets with |A| = n and |B| = m. If n < m then there are no
surjections form A to B, If n ≥ m then the number of surjective function from A to B is
mn – C(m,1)(m – 1)n + C(m,2)(m – 2 )n…+(-1)m-1C(m,m – 1)(1)n.

104
Example:
Find the number of surjections from A = {a,b,c,d} to B = {1,2,3}.
Solution:
|A| = 4 and |B| = 3. Hence the number of surjections from A to B is
34 – C(3,1)(2)4 + C(3,2)(1)4 = 81 – 3 x 16 + 3 = 36.

MANY TO ONE FUNCTIONS:


A mapping in which many elements in the domain have the same image element in
the co-domain is called a many-to-one mapping.
Note: A function f: A→B is many-to-one if it is not one-to-one.

INVERTIBLE FUNCTION:
A function f: A→B is invertible if its inverse relation f −1 is also a function from the
range of f into A.
Consider the following Example:
Let A = {a,b,c,d} and B = {1,2,3,4}
Let f = {(a,1), (b,1), (c,4), (d,3)} be a relation from A to B.
Now the inverse relation is given by
f −1 = {(1,a), (1,b), (4,c), (3,d)}
As the element 1 of B is associated with both a and b of A, f −1 is not a function.
This establishes that a function is not necessarily invertible, but is always invertible as a
relation.
We shall establish the conditions for a function to be invertible.

COMPOSITION OF FUNCTIONS:
Let f: A→B and g: B→C, then the function (g o f) : A→C defined by
(g o f) (a) = g(f(a)) is called the composition of f and g.
Example: Let f and g be function from 2 to Z defined by f(x) = 2x + 3 and g(x) = 3x + 2.
What is the composition of f and g and the composition of g and f.
Solution:
(f o g)(x) = f(g(x)) = f(3x + 2) = 2 (2x+2) + 3 = 6x +3
(g o f)(x) = g(f(x)) = g(2x + 3) – 3 (2x + 3) + 2 = 6x – 1
Example:
The floor function f is from set of real numbers to integers f ( x ) = ⎢⎣ x ⎥⎦ the largest
integer that is ≤ x .
The ceiling function g : R → show that g ( x ) = ⎢⎡ x ⎥⎤ the smallest integers ≥ x .
Example: Data stored on a computer disk or transmitted over a data network are usually
represented as a string of bytes. Each byte is made up of 8 bits. How many bytes are
required to encode 100 bits of data?

Solution:
To determine the number of bytes needed, we determine the smallest integer that is at
least as large as the quotient when 100 divided by 8, the number of bits in a byte.
Consequently, ⎢⎡100 / 8⎥⎤ = ⎢⎡12.5⎥⎤ = 13 bytes are required.

105
Example: In asynchronous transfer mode (ATM) (a communications protocol used no
backbone networks), data are organized into cells of 53 bytes. How many ATM cells can
be transmitted in 1 minute over a connection that transmits data at the rate of 500 kilobits
per second?
Solution:
In 1 minute, this connection can transmit 500,000.60 = 30,000,000 bits. Each ATM
cells is 53 bytes long, which means that it is 53.8 = 424 bits long. To determine the
number of cells that can be transmitted in 1 minute, we determine the largest
integer not exceeding the quotient when 30,000,000 is divided by 424.
Consequently, ⎢⎣30, 000, 000 / 424 ⎥⎦ = 70, 754 ATM cells can be transmitted in 1 minute
over a 500 kilobit per second connection.

HAVE YOU UNDERSTOOD THE CONCEPTS?


Answer the following

1. Let p be the relation on the set R of all real numbers defined by setting apb if
1
and only if a − b ≤ . Then, p is
2
(a) reflexive and symmetric but not transitive.
(b) Symmetric and transitive but not reflexive
(c) Transitive but neither reflexive nor symmetric
(d) None of these Ans (a)

2. The composite mapping fog of the maps


f : R → R, f ( x) = sin x; g : R → R, g ( x ) = x 2 is
sin x
(a) sin x + x 2 (b) ( sin 2 x ) (c) sin x 2 (d) Ans: (c)
x2

3. If R be a relation < from A = {1,2,3,4} to B = {1,3,5} i.e. ( a, b ) ∈ R if and only if


a < b, then RoR-1 is
(a) {(1,3), (1,5), (2,3), (2,5), (3,5), (4,5)}
(b) {(3,1), (5,1), (3,2), (5,2), (5,3), (5,4)}
(c) {(3,3), (3,5),(5,3), (5,5)}
(d) {(3,3), (3,4), (4,5)} Ans: (c)

4. Let R be the set of real numbers, If f : R → R is defined by f ( x ) = e x , then f is


(a) surjective but not injective
(b) injective but not surjective
(c) bijective
(d) neither surjective nor injective Ans: (b)

5. Let R be a relation defined as aR b if and only if |a – b| >0. Then, the relation R is

106
(a) reflexive (b) symmetric (c) transitive (d) None of these Ans: (b)

6. If R and R ′ are symmetric relations (not disjoint) on a set A, then the relation
R ∩ R ′ is
(a) reflexive (b) symmetric (c) transitive (d) None of these Ans: (b)

7. Let S = {1,2,3,4,5} and let A = S x S. Define the relation R on A as follows “(a,b)


R (c,d) if and only of ad = cd”. Then, R is
(a) reflexive only (b) symmetric only
(c) transitive only (d) equivalence relation Ans: (d)

SUMMARY:
• Sets are used to group object together. A set is a well defined collection of objects
or also called as elements. We can describe a set by using roaster notation, set
builder notation or using quantifiers.
• Union of sets, intersection of sets, complementation of a set, difference of two sets,
symmetric difference of two sets are defined.
• Venn diagram, a pictorial representation of a sets is used to indicate relationship
between sets. Set identity can be proved using membership table. The operation of
computing the union, intersection, difference of two sets is time consuming.
Computer representation of set make computing combination of sets easy.
• The rules of counting can solve a variety of problems. Permutation and
combinations are used in many counting problems. Given a set A, |A| denotes a
number of elements in A. The principle of inclusion and exclusion for n sets states
that : Let A1 , A2 ,... An be any n non-empty sets. Then, A1 ∪ A2 ∪ ... ∪ An

∑ (A ∩ A ) + ∑ (A ∩ A ∩ Ak ) − ... + ( −1)
n n n
= ∑ ( Ak ) − ( A1 ∩ ... ∩ An ) .
n −1
i j i j
i =1 i ≠ j =1 i , j , k =1

This tells how many elements are there in the union of finite number of finite sets.
• Given two sets A, B, the cartesian product of A and B is defined as
A x B = {(a,b)|a∈A , b∈B}.
The Cartesian product is not commutative. Further |A x B| = |A| |B|.
• Any subset of A x B is called a binary relation R. A binary relation R on a set A is
said to be reflexive if aRa for every a∈A. R is said to be symmetric if aRb implies
bRa for every a,b∈A. R is said to be transitive if aRb and bRc implies aRc for
a,b,c∈A. A relation R which is reflexive, symmetric and transitive is called an
equivalence relation.
• A relation can be represented by means of matrices and also by means of digraphs.
Let R be a relation on A. The reflexive closure of R is obtained by adding (a,a) to R
for each a∈A. The symmetric closure is obtained by adding (b,a) to R for each
a,b∈R. The transitive closure of R is obtained by repeatedly adding (a,c) to R for
each (a,b) and (b,c) in R.
• Warshall algorithm is used to find the transitive closure of a relation. A function is a
special case of a relation. A function f : A → B is injective if f ( x ) = f ( y ) implies

107
that x = y for all x and y ; surjective if for every element b ∈ B , there exists an
element a ∈ A such that f ( a ) = b and bijective if it is injective and surjective. When
A and B are finite sets, the number of surjective, injective and bijective functions can
be calculated.

EXERCISE:
PART A:

1. Draw the Venn diagram for each of these combinations of the sets A, B and C.
(i) A ∩ ( B ∪ C )
(ii) A′ ∩ B ′ ∩ C ′
(iii) ( A − B) ∪ ( B − C ) ∪ ( A − C )

2. If A = {0, 2, 4, 6, 8, 10}
B = {0, 1, 2, 3, 4, 5, 6}
C = {4, 5, 6, 7, 8, 9, 10}
Find A ∩ B ∩ C , A ∪ B ∪ C , ( A ∪ B) ∩ C , ( A ∩ B) ∪ C

3. Given A = {2,5,6}, B = {3,4,2}, C = {1,3,4} and find A – B and A – C.

4. Find the sets A and B if A − B = {1,5, 7,8} , B − A = {2,10} , A ∩ B = {3, 6,9} .

5. Prove the set inequality A ∩ ( B ∪ C ) = ( A ∩ B) ∪ ( A ∩ C ) using Venn diagram.

6. Let f be a function from set of integers Z to Z with f(x) = x2. Is f invertible? Find the
inverse of the function f(x) = x3 + 1.

7. Let A = {a, b, c}, B = {x, y} and C = {0,1}. Find


(a) A x B x C (b) C x B x A (c) C x A x B (d) B x B x B

8. Find the symmetric difference of {1, 3, 5} and {1, 2, 3}.


9. Draw a Venn diagram for the symmetric difference of the sets A and B.
10. Find the domain and range of these functions:
(a) The function that assigns to each nonnegative integer its last digit.
(b) The function that assigns the next largest integer to a positive integer.
(c) The function that assigns to a bit string the number of one bits in the string.
(d) The function that assigns to a bit string the number of bits in the string.

11. Determine whether the function f : Z × Z → Z is onto if


(a) f ( m, n ) = m + n (b) f ( m, n ) = m 2 + n 2
(c) f ( m, n ) = m (d) f ( m, n ) = n (e) f ( m, n ) = m − n

108
12. Given an example of a function which is one-one and not onto.

13. Determine whether each of these functions is a bijection form R to R.


(a) f ( x ) = 2 x + 1 (b) f ( x ) = x 2 + 1
(c) f ( x ) = x 3 (d) f ( x ) = ( x 2 + 1) /( x 2 + 2)

14. Let S = {-1,0,2,4,7}. Find f ( S ) if


(a) f ( x ) = 1 (b) f ( x ) = 2 x + 1 (c) f ( x ) = ⎡⎢ x / 5⎤⎥ (d) f ( x ) = ⎢⎣( x 2 + 1) / 3⎥⎦ .

15. Let R be the relation on the set {1,2,3,4,5} containing the ordered pairs (1,1),
(1,2), (1,3), (2,3), (2,4), (3,1), (3,4), (3,5), (4,2), (4,5), (5,1), (5,2) and (5,4). Find
(a) R2 (b) R3 (c) R4 (d) R5

16. Let R be the relation on the set {0,1,2,3} containing the ordered pairs (0,1), (1,1),
(1,2), (2,0), (2,2) and (3,0). Find the
(a) reflexive closure of R (b) symmetric closure of R.

EXERCISE:
PART-B

1. Prove that A ∩ ( B ∩ C ) = ( A ∩ B) ∪ ( A ∩ C ) for all set A, B, C using membership


table.

2. Draw Venn diagram for each of these combinations of sets A, B and C.


(a) A ∩ ( B ∪ C ) (b) ( A ∩ B ∩ C ) (c) ( A − B ) ∪ ( A − C ) ∪ ( B − C )

3. Each of the 49 students in an MIT class understands mathematical equations,


exercises regularly, or loves literature. Of these, 20 students understand mathematical
equations; 20 students exercise regularly; 26 students love literature; 36 students
understand mathematical equations or exercise regularly; 38 students understand
mathematical equations or love literature and 40 students exercise regularly or love
literature. How may students understand mathematical equations and exercise
regularly and love literature?

4. Which of the following function are one-to-one, onto and bijections? Find the inverse
for any function, if exists.

109
f1 : R → R f1 ( x ) = x 3 − x
f2 : Z → Z f2 ( x ) = x
f3 : Z → Z f3 ( x ) = x3
f4 : R → R f4 ( x ) = 2x + 1

5. Let f and g be two functions. When is the composite function gof is defined
when R f ⊆ D f .

6. Why is f not a function from R to R if


(a) f ( x ) = 1
x?
(b) f ( x ) = x ? (c) f ( x ) = ± (x 2
+ 1) ?

7. Determine whether each of these functions from Z to Z is one-to-one.


(a) f ( n ) = n − 1 (b) f ( n ) = n 2 + 1
(c) f ( n ) = n3 (d) f ( n ) = ⎡⎢ n / 2 ⎤⎥

8. Let f ( x ) = ax + b and g ( x ) = cx + d where a,b,c and d are constants. Determine


for which constants a,b,c and d it is true that f o g = g o f .

9. f, g, h are function from Z into Z defined by f ( x ) = x + 5, g ( x ) = x − 2, h ( x ) = x 2 .


Define (1) fg (2) f 3 (3) fh.

10. Find the inverse function of f ( x ) = x 3 + 1 .

11. How many solutions are there to the equation x1 + x2 + x3 + x4 + x5 = 21 , where


xi , i = 1,2,3,4,5 is a non-negative integer such that
(a) x1 ≥ 1? (b) xi ≥ 2 for i = 1, 2,3, 4,5? (c) 0 ≤ x1 ≤ 10?

12. How many different strings can be made from the letters in MISSISSIPPI, using
all the letters?

13. How many strings with seven or more characters can be formed from the letters in
EVERGREEN?

14. There are 2504 computer science students at a school. Of these, 1876 have taken a
course in Pascal, 999 have taken a course in Fortran, and 345 have taken a course
in C. further, 876 have taken course in both Pascal and Fortran, 231 have taken

110
course in both Fortran and C, and 290 have taken course in both Pascal and C. If
189 of these students have taken courses in Fortran, Pascal and C, how many of
these 2504 students have not taken a course in any of these three programming
languages?

15. Determine whether the relation R on the set of all real numbers is reflexive,
symmetric, antisymmetric, and/or transitive, where ( x, y ) ∈ R if and only if
(a) x + y = 0 (b) x = ± y (c) x − y is a rational number (d) x = 2 y
(e) xy ≥ 0 (f) xy = 0 (g) x = 1 (h) x = 1 or y = 1

16. Let R be the relation R = {( a, b ) | a divides b} on the set of integers. Find


(a) R −1 (b) R

17. Let A = {(1,2), (2,3), (3,4)} and B = {(1,1), (1,2), (2,1), (2,2), (2,3), (3,1), (3,2),
(3,3), (3,4)} be relations from {1,2,3} to {1,2,3,4}. Find
(a) A ∪ B (b) A ∩ B (c) A – B (d) B – A

18. Show that for any three sets A, B, C A × ( B ∩ C ) = ( A × B ) ∩ ( A × C ) .

19. How many different functions are there from a set with 10 elements to sets with
the following numbers of elements?
(a) 2 (b) 3 (c) 4 (5)

20. How many permutations of the letters ABCDEFGH contain:


(a) the string ED?
(b) the string CDE?
(c) the strings BA and FGH?
(d) the strings AB, DE and GH?
(e) the strings CAB and BED?
(f) the strings BCA and ABF?

21. Seven women and nine men are on the faculty in the mathematics department at a
school.
(a) How many ways are there to select a committee of five members of the
department if at least one woman must be on the committee?
(b) How many ways are there to select a committee of five members of the
department if at least one woman and at least one man must be on the
committee?

22. Suppose that the relation R is reflexive. Is R2 necessarily reflexive? Give a reason
for your answer?

111
23. Represent each of these relations on {1,2,3} with a matrix (with the elements of
this set listed in increasing order).
(a) {(1,1), (1,2), (1,3)} (b) {(1,2), (2,1), (2,2), (3,3)}
(c) {(1,1), (1,2), (1,3), (2,2), (2,3), (3,3)} (d) {(1,3), (3,1)}

⎛0 1 1⎞
24. Let R be the relation represented by the matrix M R = ⎜⎜ 1 1 0 ⎟⎟
⎜1 0 1⎟
⎝ ⎠
Find the matrix representing
(a) R-1 (b) R (c) R2

25. Use Warshall’s algorithm to find the transitive closures of these relations on
{1,2,3,4}.
(a) {(1,2), (2,1), (2,3), (3,4), (4,1)}
(b) {(2,1), (2,3), (3,1), (3,4), (4,1), (4,3)}
(c) {(1,2), (1,3), (1,4), (2,3), (2,4), (3,4)}
(d) {(1,1), (1,4), (2,1), (2,3), (3,1), (3,2), (3,4), (4,2)}

26. Find the transitive closure of these relations on {a,b,c,d,e}.


(a) {(a,c), (b,d), (c,a), (d,b), (e,d)}
(b) {(b,c), (b,e), (c,e), (d,a), (e,b), (e,c)}
(c) {(a,b), (a,c), (a,e), (b,a), (b,c), (c,a), (c,b), (d,a), (e,d)}

27. Which of these relations on the set of all people are equivalence relations?
Determine the properties of an equivalence relation that the others lack.
(a) {(a,b) | a and b are the same age}
(b) {(a,b) | a and b have the same parents}
(c) {(a,b) | a and b share a common parent}
(d) {(a,b) | a and b have met}
(e) {(a,b) | a and b speak a common language}

28. Which of these relations on the set of all functions from Z to Z are equivalence
relations? Determine the properties of an equivalent relation that the others lack.
(a) {(f,g) | f (1) = g (1) }
(b) {(f,g) | f (0) = g (0) or f (1) = g (1)}
(c) {(f,g) | f (x) – g (x) = 1 for all x ∈ Z }
(d) {(f,g) | f (x) – g (x) = c for some c ∈ Z for all x ∈ Z }
(e) {(f,g) | f (0) = g (1) and f (1) = g (0)}

29. Let X = {1,2,3,4,5} and R = { x y / x − y is divisible by 3} . Find whether R an


equivalence relation, also find the graph of R.

112
30. Determine whether the relations represented by these zero-one matrices are
equivalence relations.
⎛1 0 1 0⎞ ⎛1 1 1 0⎞
⎛ 1 1 1⎞ ⎜ ⎟ ⎜ ⎟
⎜ ⎟ ⎜ 0 1 0 1⎟ ⎜ 1 1 1 0⎟
(a) ⎜ 0 1 1⎟ (b) (c)
⎜ 1 1 1⎟ ⎜ 1 0 1 0 ⎟ ⎜1 1 1 0⎟
⎝ ⎠ ⎜⎜ ⎟⎟ ⎜⎜ ⎟⎟
⎝0 1 0 1⎠ ⎝0 0 0 1⎠

31. What is the congruence class [4]m when m is


(a) 2? (b) 3? (c) 6? (d) 8?

32. Which of these collections of subsets are partition of {1,2,3,4,5,6}?


(a) {1,2}, {2,3,4}, {4,5,6}
(b) {1}, {2,3,6}, {4}, {5}
(c) {2,4,6}, {1,3,5}
(d) {1,4,5}, {2,6}

33. Which of these collections of subsets are partitions on the set of bit strings of
length 8?
(a) The set of bit strings that begin with 1, the set of bit strings that begin with 00,
and the set of bit strings that begin with 01.
(b) The set of bit strings that contain the string 00, the set of bit strings that
contain the string 01, the set of bit strings that contain the string 11.
(c) The set of bit strings that end with 00, the et of bit strings that end with 01, the
set of bit strings that end with 10, and the set of bit strings that end with 11.
(d) The set of bit strings that end with 111, the set of bit strings that end with 011,
and the set of bit strings that end with 00.
(e) The set of bit strings that have 3k ones, where k is a nonnegative integer, the
set of bit strings that contain 3k + 1 ones, where k is an nonnegative integer,
and the set of bit strings that contain 3k = 2 ones, where k is a positive integer.

Books for References

1. Kenneth H.Rosen, “ Discrete Mathematics and Its Applications”, Tata McGraw


Hill, Fourth Edition, 2002.
2. M.K.Venkataraman “Engineering Mathematics”, Volume II, National
Publishing Company, 2nd Edition,1989.
3. J.P.Tremblay and R.Manohar, “Discrete Mathematical Structures with
Applications to Computer Science”, Tata McGraw Hill, Third Edition, 2003
4. Erwin Kreyzig, “Advanced Engineering Mathematics”, Wiley Publishers, 8th
Edition, 2004.

113
114

You might also like