Basic Combination Unit-1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Sets, Relations and

Functions

UNIT 1 SETS, RELATIONS AND


FUNCTIONS
Structure Page No.
1.0 Introduction 5
1.1 Objectives 5
1.2 Introducing Sets 5
1.3 Operations on Sets 9
1.3.1 Basic Operations
1.3.2 Properties Common to Logic and Sets
1.4 Relations 13
1.4.1 Cartesian Product
1.4.2 Relations and their types
1.4.3 Properties of Relations
1.5 Functions 16
1.5.1 Types of Functions
1.5.2 Operations on Functions
1.6 Summary 22
1.7 Solutions / Answers 22

1.0 INTRODUCTION
In common parlance, we find people using the words given in the title of this unit. Do
they have the same meaning in mathematics? You’ll find this out by studying this
unit. You will also see how basic the concept of ‘set’ and ‘function’ or to any area of
mathematics and subjects depend on mathematics.

In this unit we will begin by introducing you to various kinds of sets. You will also
study operations like, ‘union’ and ‘intersection’. While doing so you will see in what
way Venn diagrams are a useful tool for understanding and working with sets.

Next we will discuss what a relation is, and expose you to some important types of
relations. You will come across while studying banking, engineering, information
technology and computer science, of course mathematics. As you will see in your
study of computer science, an extensive use of functions is made in problem-solving.

Finally, we lead you detailed discussion of functions. Over here we particularly focus
on various points of functions and fundamental operations on functions.

1.1 OBJECTIVES
After studying this unit, you should be able to:

• explain what a set , a relation or a function is


• give examples and non-examples of sets, relations and functions
• perform different operations on sets
• establish relationships between operations on sets and those on statements in
logic
• use Venn diagrams
• explain the difference between a relation and a function.
• describe different types of relations and functions.
• define and perform the four basic operations on functions

1.2 INTRODUCING SETS


In our daily life we encounter collections, like the collection of coins of various
countries, a collection of good students in a class, a collection of faculty members of
IGNOU, etc. In the first of these examples, it is easy for anybody anywhere to tell

5
Basic Combinatorics

whether an object belongs to this collection or not. If we take the collection of coins
of a country, then a coin will be in the collection if it is a coin of that country, not
otherwise. The criterion for being a member of the collection is objective and clear.
However, if we take the collection of all good students, it is very difficult to say
whether a person belongs to this collection or not because the characteristic good is
not very clearly defined. In this case the collection is not ‘well-defined’, while the
previous collection is ‘well-defined’. Similarly, the collection of all the IGNOU
students is well-defined.

Definition: A set is a well-defined collection. The objects belonging to a set are


called elements or members of that set.

We write the elements of a set within curly brackets. For instance, consider the set A
of stationary items used by Nazia. We write this as
A = {pen, pencil, eraser, sharpener, paper}
Another example is the set
B = {Lucknow, Patna, Bhopal, Itanagar, Shillong}
of the capitals of 5 states of India.

Note that A and B are well-defined collections. However, the collection of short
people is not well-defined, and therefore, it is not a set.

Also note that the elements of a set don’t have to appear ‘similar’. For example,
{pen,Lucknow,4} is a set consisting of 3 clearly defined elements.

As you have seen, we usually, denote sets by capital letters of the English alphabet.
We usually denote the elements by small letters a,b,x,y …. If x is an element of a set
A, we write this as x∈A (read as ‘x belongs to A’). If x is not an element of A, we
write this as x ∉ A (read as ‘x does not belong to A’).

There are three ways of representing sets: ‘Set-builder form’, ‘Tabular form’ and the
pictorial representation through Venn diagrams.

In the ‘Set-builder form’, or ‘property method’ of representation of sets, we write


between brackets { } a variable x,which stands for each of the elements of the set
which have the properties p(x), and separate x and p(x) by a symbol ‘:’ or ‘|’ (read
as ‘such that’). So the set looks like {x: p(x)} or {x | p(x)}.

For instance, the set {x | x is a white flower} is the set of all white flowers, or {x: x is
a natural number and 2<x<11}is the set of natural numbers lying between 2 and 11.

In ‘Tabular form’, or the ‘listing method’, the elements of a set are listed one by
one within the brackets { }, each separated from the other by a comma, as in the
examples A and B given above.
The accepted convention for writing a set by the listing method is that elements will
not be repeated. For example, in the set A= {4,2,8,2,6}, 2 is repeated, which is not
necessary.So we will write A ={4,2,8,6}.

We shall introduce you to Venn diagrams a little later. For now, let us consider a few
more sets.

Definition: A set with no element is called the empty(or null, or void) set, and is
denoted by φ or{}.
For example A = {x:x is an integer between 13 and 17 which is divisible by 6}, has
no element, i.e., A is the empty set.
Definition: A set having a finite number of elements is called a finite set.

6
Sets, Relations and
Functions
For example, {1,2,4,6} is a finite set because it has four elements, φ , the null set, is
also a finite set because it has zero number of elements; the set of stars in the sky is
also a finite set.

Definition: A set having infinitely many elements is called an infinite set.

For example, the set N of natural numbers is infinite. Similarly, Q , Z, R and C, the
set of rational numbers and complex numbers, respectively, are infinite set.

B= The set of all strengthness in a given plane.

Now try the following exercises.

E1) How would you represent the set of all students who have offered the IGNOU
course?

E2) Explain, with reason, whether or not


i) the collection of all good teachers is a set
ii) the set of points on a line is finite.

E3) Represent the set of all integers by the listing method.

When we deal with several sets, we need to understand the nature of the elements of
those sets, whether the elements of two given sets have some elements in common or
not, and so on. These questions involve concepts, which we now define.

Definition: A set A is said to be a subset of a set B if each element of A is also an


element of B. In this case B is called a superset of A. If A is a subset of B, we
represent this by A ⊆ B.

As a statement in logic we represent this situation as,


A ⊆ B ⇔ [x ∈ A ⇒ x ∈ B]

‘B contains A’ or ‘B is a superset of A’ is represented by B ⊇ A.


If A is not a subset of B, we represent this by A B.

For example, if A ={4,5,6} and B ={4,5,7,8,6}, then A ⊆ B. But if C = {3,4} then


C B.

Remark: If A ⊆ B and B ⊆ C, then A ⊆ C.

Definition: Two sets A and B are equal if every element of A belongs to B and every
element of B belongs to A. We represent this by A=B.
For example, if A= {1,2,3}, B ={2,3,1}, then A ⊆ B and B ⊆ A, so that A = B.

Definition: A set A is said to be a proper subset of a set B if A is a subset of B and


A and B are not equal. We represent this by A ⊂ B.
For example, if A ={4,5,6} and B = {4,5,7,8,6}, then A ⊂ B; and if
A={Java, C, C++, Cobol} and B={Java, C++}, then A ⊃ B. (1834 -1923)
Fig 1: John Venn

Note: A set can have many subsets and many supersets. For example A={1,2,3,4,5},
B= {2,3,4,5,6,7}, and C= {2,3}, then for C, A and B can be used as supersets.
Similarly, if X= {Ram, Rani, Sita, Gita}, Y= {Rani}, and Z= {Sita}, then Y and Z
both are subsets of X.

Definition: The power set of a set A is the set of all the subsets of A, and is denoted
by P(A).

7
Basic Combinatorics

Mathematically, P(A) = { x:x ⊆ A}.

Note that φ ∈ P(A) and A ∈ P(A) for all sets A.


For example, if A={1}, then P(A)= { φ ,{1}} and
if A= {1,2}, then P(A)={ φ , {1}, {2}, {1,2}}
Similarly, if A = {1,2,3}, then P(A) = { φ ,{1}, {2}, {3}, {1,2}, {1,3}, {2,3},
{1,2,3}}.

Definition: Any set which is a superset of all the sets under consideration is known
as the universal set. This is usually denoted by Ω , S or U.

For example, if A = {1,2,3}, B = {3,4,6,9} and C = {0,1}, then we can take


U = {0,1,2,3,4,5,6,7,8,9} or U= N, or U=Z as the universal set.

Note that the universal set can be chosen arbitrarily for a given problem. But once
chosen, it is fixed for the discussion of that problem.

Theorem 1: If A is a set with n elements, then |P(A)| = 2n.

Proof: We shall prove this by mathematical induction.


For this, we first check if it is true for n= 1.Then assuming that it is true for n = m, we
prove it for the case n = m +1. It will, then, follow that the result will be true ∀ n
∈ N.

Step I: If A = 1, then P(A) = 2=21.

Step II: Assume that the theorem holds for all sets A of cardinality k, i.e. if ‫׀‬A‫ = ׀‬k,
then A has 2k subsets.

Step III: Now consider any set A = {x1, x2, x3,…,xk, xk+1}, with k+1 elements.
Consider its subset B= {x1, x2, x3,…,xk }. Now B has 2k subsets, each being a subset
of A. Now, take any such subset {x i1 ,x i 2 ,…,x i r }of B. Then {x i1 ,x i 2 ,…,x i r ,x k+1}
is a subset of A that is not a subset of B. So, for each of the 2k subsets of B, we attach
xk+1 to it to get 2k more subsets of A.

You can see that this covers all the subsets of A.

So the number of subsets of A=2k +2k = 2.2k = 2k+1 .


Hence the theorem.

Now try these exercises.

E4) Give two proper subsets and two supersets of the set of vowels of the English
alphabet.

E5) Find the power set of the set A ={a,e,i,o,u}.

E6) For which set A, is P(A) = 1 ?

E7) If A ⊆ B, is P(A) ⊆ P(B)? Why?


E8) P(A) = P(B) ⇒ A = B. True or false? Why?

Let us conclude this section with the pictorial representation of sets. You know that
the pictorial representation of any object helps in understanding the object. This is
why a pictorial representation of sets, known as a Venn diagram, helps in
understanding and dealing with sets.

8
Sets, Relations and
Functions
The English priest and logician John Venn invented the Venn diagram. Through
Venn diagrams we can easily visualize the abstract concept of a set and operations on
sets. In this diagram, the universal set is usually represented by a rectangle and its
subsets are shown as circles or other closed geometrical figures inside this rectangle.

For example, A = {Lucknow, Patna, Bhopal, Itanagar, Shillong} can be represented


using a Venn diagram as in Fig. 2. Here U could be any superset of A.

U
*Lucknow,
*Patna,
*Bhopal,
*Itanagar,
*Shillong

A
Fig. 2: A Venn diagram

Now that you are familiar with basic definitions related to sets, let us discuss some
basic operations that can be performed on sets. This is when we shall appeal to Venn
diagrams very often, as you will see.

1.3 OPERATIONS ON SETS


Let us now study sets obtained by applying operations on sets. We will cover four
operations here, namely, union of sets, intersection of sets, complement of sets and
symmetric difference. While studying them you will see how useful a Venn diagram
can be for proving results related to these operations. In this section we will also look
at some rules that are common to operations on sets and operations on statements,
which you studied in Block 1.

1.3.1 Basic Operations


In this sub-section we shall define each of the operations one by one.

Definition: The union of two sets A and B is the set of all those elements which are
either in A or in B or in both A and B. This set is denoted by A ∪ B, and read as ‘A
union B’.
Symbolically, A ∪ B= {x:x ∈ A or x ∈ B}

For example, if A = {x: x is a stamp} and B = {4,5}, then


A ∪ B= {x:x is a stamp or a natural number lying between 3 and 6}.

And A={Ram, Mohan, Ravi} and B={Ravi, Rita, Neetu},


then A ∪ B={Ram, Mohan, Ravi, Rita, Neetu}.

If A ⊆B, then A ∪ B = B, and vice versa. This can be shown immediately using a
Venn diagram, as in Fig.3.(a), where A is shown as the square contained in the circle
representing B. In Fig.3(b), A ∪ B is shown when A and B have some elements in
common, and in Fig.3(c), we depict A ∪ B when A and B have no element in
common.

U U U

A
A B

9
Basic Combinatorics

A B

(a) (b) (c)

Fig. 3: Venn diagram for union

Definition: The intersection of sets A and B is the set of all the elements which are
common to both A and B. This set is denoted by A ∩ B, and read as ‘A intersection
B’.
Symbolically, A ∩ B = {x :x ∈ A and x ∈ B};
For example A = {1,2,3} and B = {2,1,5,6}, then A ∩ B ={1,2}.
Again if A= {1} and B = {5} then A ∩ B = { } or φ .

Remark: For any two sets A and B, A ∩ B ⊆ A ⊆ A ∪ B and A ∩ B ⊆ B ⊆ A ∪ B.

What is A ∩ B if A ⊆ B? Do you agree that it is A? Let us use a Venn diagram to


check this (see Fig.4(a)). If A and B have some elements in common, then the Venn
diagram for A ∩ B looks like Fig 4.(b), and if A and B have no element in common,
then the Venn diagram will be as in Fig.4(c).

U U U

B
A A∩ B
A B

A B

(a) (b) (c)

Fig. 4: Venn diagram for intersection of sets

Definition: The difference of two sets A and B is the set of all those elements of A
which are not elements of B. Sometimes, we call this set the relative component of
B in A. It is denoted by A~B or A\B, and is read as ‘A complement B’.
Symbolically, A~B = {x : x ∈ A and x ∉ B} and
B ~A = {x : x ∈ B and x ∉ A}

For example, if A = {4,5,6,7,8,9} and B = {3,5,2,7}, then A ~ B = {4,6,8,9} and


B ~ A = {3,2}. From this example it is clear that A ~ B ≠ B ~ A. In fact, this is
usually the case. So, the difference of sets is not a commutative operation.

In Fig.5(a), A ⊆ B, so that A~B= φ .

In Fig.5(b) we show A~B when A ⊇ B, and in Fig.5(c) we show A~B when neither
A ⊆ B nor B ⊆ A.

In Fig. 5(d), we show A~B when A and B are disjoint.

U U

B A
A
B
(b)
A~B = φ

10
Sets, Relations and
Functions

(a) (b)

U U

(c) (d)

A B
A B

(c) (d)
Fig. 5: A ~ B in different situation is the shaded portion.

There is one particular ‘difference’ that shows up very often, which we now define.
Definition: The complement of a set A, is the set U \ A, and is denoted by Aʹ or Ac.
For example, U={Physics, Chemistry, Mathematics} and A={Mathematics}, then the
complement of A is Aʹ= {Physics, Chemistry}.

The Venn diagram showing the complement of Á is the set of those elements of the
universal set U which are outside A (see Fig.6).
U
Aʹ́

Fig. 6: Venn diagram for Aʹ.

Definition: The symmetric difference of two sets A and B is the set of all those
elements which are in A or in B, but not in both. It is denoted by A Δ B.
i.e., A Δ B =(A~B) ∪ (B~A).

Note that A Δ B = B Δ A, i.e. the symmetric difference is commutative.

For example A= {1,2,3,4,5} and B= {3,5,6,7}, then A~ B= {1,2,4},and B~A = {6,7}


∴ A Δ B={A~B) ∪ (B~A) = {1,2,4,6,7}

Now you may try these exercises.

E 9) Make a Venn diagram for A Δ B for each of the situations i) A ⊆ B, ii) A B,


iii) B A and A ∩ B ≠ φ ; iv) A ∩ B= φ .

E10) Let A= {Math, Physics, Science}, B={Computer,Math,Chemistry}, C={Math}.


Find A ∪ (B ∩ C).

E11) If A = {1,2,3,4,5,6}, B={4,5,6,7,8,9},find i) A~ B, ii) B~ A, iii) A Δ B.

E12) For which sets A and B would A~B = B~A ?

E13) Write a program in C to perform E 10.

E14) Under what conditions can A ∩ B = A ∪ B ?

11
Basic Combinatorics

While discussing these operations, you may be wondering that they seem to satisfy
properties very similar to those of propositional logic covered in Block 1 of this
course.You are right! Let us look at this aspects now.

1.3.2 Properties Common to Logic and Sets


Before looking into the properties we shall first present a very useful principle to you.
This will allow you to see how one property can be proved in several situations
simultaneously.

Duality Principle: The ‘duality principle’ is very convenient for dealing with
theorems about sets. Basically if any theorem is given to you, by applying the duality
principle you can get another theorem (the dual of the previous one). In any statement
involving the union and intersection of sets, we can get from one of the statements to
the other by interchanging ∩ with ∪ and φ with U.

For example, the dual of A ∪ (B ∩ C) is A ∩ (B ∪ C) and the dual of U ∪ φ =U is


U ∩ φ = φ . So, for example what is true for A ∪ (B ∩ C) will be true for
A ∩ (B ∪ C) too. This is why if the first property in each of the pairs below is proved
the second one follows immediately.
For any universal set U and subsets A, B and C of U, the following properties hold.
i) Associative properties:
Union: A ∪ (B ∪ C)= (A ∪ B) ∪ C
Intersection: A ∩ (B ∩ C) = (A ∩ B) ∩ C

ii) Commutative properties:


Union: A ∪ B= B ∪ A
Intersection: A ∩ B = B ∩ A.

iii) Identity:
Union: A ∪ φ = A
Intersection: A ∩ U=A.

iv) Complement:
Union: A ∪ A′ = U
Intersection: A ∩ A′ = φ

v) Distributive properties:
Union: A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
Intersection: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

De Morgan’s Laws:
For any two sets A and B the following laws known as De Morgan’s laws, hold

Fig. 7: Augustus De 1. (A ∪ B)′ = A′ ∩ B ′, and


Morgan (1806–1871)
2. (A ∩ B)′ = A′ ∪ B′

De Morgan’s laws can also be expressed as


1. A ~ (B ∪ C) = (A~ B) ∩ (A~ C)
2. A ~ (B ∩ C)= (A~ B) ∪ (A~ C)
Fig. 7: Augustus De
Morgan (1806-1871) Each of the properties above corresponds to a related property for mathematical
statements in logic (which we have covered in Unit 2 and Unit 3 of Block 1 of this
course).

Now try these exercises.

12
Sets, Relations and
Functions

E15) Find the dual of


i) A ∩ (B ∩ C) = (A ∩ B) ∩ C, and ii) (A ∪ B) ∩ (A ∪ C).
E16) Draw a Venn diagram to represent A ∪ (B ∩ C).

E17) Check whether (A ∪ B) ∩ C = A ∪ (B ∩ C) or not using a Venn diagram.

Let us now focus on subsets of a particular kind of product of sets.

1.4 RELATIONS
Sometimes we need to establish relations between two or more sets. For example, a
software development company has a set of specialists in different technology
domains, or a company gets some projects to develop. Here the company needs to
establish a relation between professionals and the project in which they will
participate. To solve this type of problem the following concepts are required.

1.4.1 Cartesian product


Very often we deal with several sets at a time, and we need to study their combined
action. For instance, combinations of a set of teachers and a set of students. In such a
situation we can take a product of these sets to handle them simultaneously. To
understand this product let us first consider the following definitions. iff is short for ‘if
and only if’.
Definition: An ordered pair, usually denoted by (x,y), is a pair of elements x and y
of some sets. This is ordered in the sense that (x,y) ≠ (y,x) whenever x ≠ y,that is ,
the order of placing of the element in the pair matters.

Any two ordered pairs (x,y) and ( a,b) are equal iff x = a and y = b.

For example if, A= {a,b,c}and B= {x,y,z},then


A × B = {a,b,c} × {x,y,z} = {(a,x), (a,y),(a,z),(b,x),(b,y),(b,z),(c,x),(c,y), (c,z)},and
B × A = {x,y,z} × {a,b,c} = {(x,a),(x,b),(x,c),(y,a),(y,b),(y,c),(z,a),(z,b),(z,c)}.

Now let us think about how B × A can be represented geometrically? For instance
what is the geometric view of {2} × R ? This is the line x =2 given in Fig.8(a).

Now, after seeing geometric representation of {2} × R, can you tell what
{1,3}×{2,3} = {(1,2),(3,2),(1,3),(3,3) }looks like? You will get four points in the first
quadrant, as shown in Fig.8(b).

Now, you know that the multiplication


Fig. 8(a): {2} × R, i.e., x = 2. Fig.8(b): {1,3}×{2,3}
of numbers is commutative. Is the Cartesian
product of sets also commutative? For instance, is {1}×{2}={2}×{1}? No, because
(1,2) ≠ (2,1). So, A×B ≠ B×A usually.

We can extend the definition of A × B to define the Cartesian product of n sets A1,
A2, ….,An as follows.
A1 ×A2×A3 ×…×,An= {(x1,x2,x3,…,xn)}: x1 ∈ A1, ∧ x2 ∈ A2 ∧ x3 ∈ A3 ∧ …, ∧ xn
∈ An}.

13
Basic Combinatorics

The element (x1,x2,…,xn) is called an n-tuple. For instance, the 3–tuple (1,1,3) ∈
{1} × {1,2} × {2,3}.

Now you may try some exercises.

E18) If X= {a,b,c} and Y={1,2,3},find


i) X × X , ii) X × Y, and iii) X × φ .

E19) Under what conditions on A and B is A×B = B×A ?

E20) Give the geometric representation of R ×{2}.

With what you studied in this sub-section, you now have the background to discuss
relations.

1.4.2 Relations and their Types


We often speak of relations which hold between two or more objects, e.g., discrete
mathematics is one of the courses in the IGNOU MCA Ist semester, Nehru wrote
Freedom of India, Chennai is the capital of Tamil Nadu. These are the relations in
everyday situations. In these examples some sort of connections between pairs of
objects are shown, and hence they express a relation between the pairs of objects.

Definition: A relation between two sets A and B is a subset of A × B. Any subset


of A × A is a relation on the set A.

For instance, if A ={1,2,3} and B = {p,q}, then the subset {(1,p),(2,q),(2,p)} is a


relation on A × B. And {(1,1), (2,3)} is a relation on A.

Also, R= {(x,y) ∈ N × N : x > y} is a relation on N, the set of natural numbers,


since R ⊆ N × N.

If R ⊆ A ×B,. we write x Ry if and only if (x,y) ∈ R( xRy is read as ‘x is related to y’).

Theorem 2: The total number of distinct relations between a finite set A and a finite
set B is 2mn, where m and n are the number of elements in A and B, respectively.

For example, R1 = N × L, where L is set of straight lines, in this relation we can give
different ordering of the straight lines.
If the relation R2 = {1,2,3} × { l1,l2}, then line l1 and l2 can get three different
ordering.

Proof: The number of elements of A × B is mn. Therefore, the number of elements


of the power set of A× B is 2mn (See Theorem 1). Thus, A × B has 2mn different
subsets. Now every subset of A× B is a relation from A to B, by definition. Hence
the number of different relations from A to B is 2mn.

As you have seen, any and every subset of A×A is a relation on A. However, some
relations have special properties. Let us consider these types one by one.

1.4.3 Properties of Relations


Reflexive Relations: A relation R on a set A is called a reflexive relation if
(a,a) ∈ R ∀ a ∈ A.

In other words, R is reflexive if every element in A is related to itself.


Thus, R is not reflexive if there is at least one element a ∈ A such that (a,a) ∉ R.

14
Sets, Relations and
Functions

For example, if A= {1,2,3,4}, then the relation R1= {(1,1), (2,2), (3,3), (4,4)} in A is
reflexive because for x ∈ A,(x,x) ∈ R1. However, R2= {(1,1), (2,1), (4,4)} is not
reflexive since 2 ∈ A, but (2,2) ∉ R2.

Symmetric Relations: A relation R on a set A is called a symmetric relation if


(a,b) ∈ R ⇒ (b,a) ∈ R.Thus, R is symmetric if bRa holds whenever aRb holds.

A relation R in a set A is not symmetric if there exist two distinct elements a, b ∈ A,


such that aRb, but not bRa.

For example, if L is the set of all straight lines in a plane, then the relation R in L,
defined by ‘x is parallel to y’, is symmetric, since if a straight line a is parallel to a
straight line b, then b is also parallel to a. Thus, (a,b) ∈ R ⇒ (b,a) ∈ R.

However, if R is the relation on N defined by ‘xRy iff x–y>0’, then R is not


symmetric, since, 4−2>0 but 2−4 0.Thus, (4,2) ∈ R but (2,4) ∉ R.

Transitive Relations: A relation R on a set A is called a transitive relation if


whenever (a,b) ∈ R and (b,c) ∈ R, then (a,c) ∈ R for a,b,c ∈ A .
Thus, [(a,b), ∈ R,(b,c) ∈ R ⇒ (a,c) ∈ R] , ∀ a,b,c ∈ A ⇒ R is transitive.

A relation R in a set A is not transitive if there exist elements a,b,c ∈ A, not


necessarily distinct, such that (a,b) ∈ R, (b,c) ∈ R but (a,c) ∉ R.

For example, if L is the set of all straight lines in a plane and R is the relation on L
defined by ‘ x is parallel to y’ then if a is parallel to b and b is parallel to c, then a is
parallel to c. Hence R is transitive. However, the relation ‘xSy’on L defined by ‘iff x
intersects y’ is not transitive.

Also, the relation R on A, the set of all Indians, defined by ‘xRy iff x loves y’, is not
a transitive relation.

Equivalence Relations: A relation R on a set A is called an equivalence relation if


and only if
(i) R is reflexive, i.e., for all a ∈ R, (a, a) ∈ R,
(ii) R is symmetric, i.e., (a, b) ∈ R ⇒ (b, a) ∈ R, for all a, b ∈ A, and
(iii) R is transitive, i.e., (a, b) ∈ R and (b, c) ∈ R ⇒ (a, c) ∈ R, for all a, b, c ∈ A.

One of the most trivial examples of an equivalence relation is that of ‘equality’.


For any elements a,b,c in a set A,
(i) a = a, i.e., reflexivity
(ii) a = b ⇒ b = a, i.e., symmetricity
(iii) a = b and b = c ⇒ a = c , i.e., transitivity.

Now let us see if ‘xRy iff ’ ‘x ≤ y’ gives an equivalence relation on R.


(i) x ≤ x, i.e., (x,x) ∈ R, i.e., R is reflexive.
(ii) However, 2 ≤ 3 but 3 2. So, R is not symmetric.

Thus, R is not an equivalence relation.

Now you may try these exercises.

E 21) Let A be the set of all people on Earth. A relation R is defined on the set A by
‘aRb if and only if a loves b’ for a,b ∈ A.

15
Basic Combinatorics

Examine if R is i) reflexive, ii) symmetric, iii) transitive.

Now we shall study a particular kind of relation, which is very useful in mathematics,
as well as in computer science, as you will soon see.

1.5 FUNCTIONS
A function is a special kind of relation. If we take the example of the set A of
students of IGNOU, and the set B of their enrolment numbers. Now consider R =
{(a,b) ∈ AxB | b is enrollment number of a },this is a relation between A and B. It is
a ‘special’ relation, ‘special’ because to each a ∈ A ∃ ! b such that aRb. We call such
a relation a function from A to B.

Let us define this term formally.

Definition: A function from a non-empty set A to a non-empty set B is a subset R


of AxB such that for each a ∈A ∃ a unique b ∈B such that (a,b) ∈R. So, this relation
satisfies the following two conditions:
(i) for each a ∈ A, there is some b ∈ B such that (a,b) ∈ R
(ii) if (a,b) ∈ R and (a,b´) ∈ R then b = b´.
We usually present functions as a rule associating elements of one set with another.
So, let us present the definition again, with this view.

Definition: Let A and B be non-empty sets. A function (or a mapping) f from A to


B is a rule that assigns to each element x in A exactly one element y in B. We write
this as f: A Æ B, read it as ‘f is a function from A to B’.

Note that
( i ) to each a ∈ A, f assigns an element of B; and
( ii) to each a ∈ A, f assigns only one element of B.

So, for example, suppose A ={1,2,3}, B= {1,4,9,11} and f assigns to each member in
A its square values. Then f is a function from A to B. But if A={1,2,3,4},
B={1,4,9,10} and f is the same rule, then f is not a function from A to B since no
member of B is assigned to the element 4 in A.

Note that the former example, 11 ∈ B, but there is no element in A which is assigned
to 11. This does not matter. It is not necessary that every element of B be related to
some element of A.

Functions are not restricted to sets of numbers only. For instance, let A be the set of
mothers and B be the set of human beings. Then the rule that assigns to every mother
her eldest child is a function. But the rule that assigns to each mother her children is
not a function because it does not relate a unique element of B to each element of A.
Now, given a function, we have certain sets and terms that are associated with it. Let
us give them some names.

Definitions: Let f be a function from A to B. The set A is called the domain of the
function f and B is called the co-domain of f. The set {f(x)| x ∈ A} is called the
range of f, and is also denoted by f(A).

Given an element x ∈ A, the unique element of B to which the function f associates, it


is denoted by f (x) and is called the f-image (or image) of x or the value of the
function f for x. We also say that f maps x to f(x). The element x is referred to as the
pre-image of f (x).

16
Sets, Relations and
Functions
For example, if A = {1,2,3,4}, B = {1,8,27,64,125}, and the rule f assigns to each
member in A its cube, then f is a function from A to B. The domain of f is A, its
codomain is B and its range is {1,8,27,64}.
x
Can you tell what will be the domain and codomain for rule f : f(x) = ?
1− x
You can see that 1–x = 0, if x = 1, in this case f(x) will be undefined.
Domain of f can be taken as R~{1}and codomain can be R.

Remark: Each element of A has a unique image, and each element of B need not
appear as the image of an element in A. Further, more than one element of A can
have the same image in B.

Let us look at some examples of functions, and non-functions now.

i) If b is be a fixed element of B, then f: AÆB : f(x)= b ∀ x ∈ A is called a constant


function.

Note that if b=0, then f is called the zero map, and is denoted by 0.

ii) f : AÆ A : f(x) = x ∀ x ∈ A is called the identity function , and is denoted by I.

iii) Consider A= {1,2,3,4}, B= {1,4,5} and the rule f which associates 1Æ1, 2Æ 4,
3Æ5, 4Æ5. Then f is a function from A to B.
A B
f
1. 1.
2. 4.
3. 5.
4. 6.
7.

Fig.11: The rule f is a function

iv) The function f from R to Z, defined by the rule that f maps any real number x to
the greatest integer less than or equal to x. is known as the greatest integer function
or the floor function. We denote this function’s action by f(x)=[x], where [x] is the
greatest integer ≤ x.

For example, if x = 0.6 then f(x) =[x]=0, if x= 2.3 then f(x)=[x]=2, and if x = –5,
then [x]ʹ= –5 .

v) Function f: RÆR: f(x)=│x│is known as the modulus (or absolute value) function,
where │x│is the absolute value of x.

For example, if x=10 then f(x)=│x│=10 and if x= –10, then f(x)=|x|=10.

vi) Now take, A={a,b,c} and B={1,2,3,4,5}. Consider the rule f which associates
aÆ1, aÆ 3, bÆ2, cÆ3. This is not a function from A to B because, elements 1 and 3
∈ B are assigned to the same element a ∈ A.
A B

f
a 1.
b 2.

c 3.
4.
5.

Fig.9: The rule f is not a function

17
Basic Combinatorics

vii) Consider A= {1,2,3}, B= {1,4,5,6,7} and the rule f which associates 1Æ1, 2Æ 1,
2Æ4. Here f is not a function from A to B since no member of B is assigned to the
element 3 ∈ A.
A B
f
1 1.
2 4.

3 5.
6.
7.

Fig.10: The rule is not a function

Now you may try these exercises.

E22) Let A= {a,b,c,d}, B= {1,2,3} and R= {(a,2), (b,1), (c,2), (d,1)}. Is R a function?
Why.

E23) Every function is a relation. Is every relation a function? Why?

E24) Consider the following pseudocode.


1. read(n)
2. while n >1 do
3. begin
4. if n is even then n := n div 2
5. else n := 2n + 1;
6. end

Write a function of n that describes the operations performed.

E25) If A= {1,2,3,4}, B = {2,3,4,5,6,7} and the rule f assigned to each member


in A is f(x)= x + 1, then find the domain and range of f.

Now let us discuss some types of functions.

1.5.1 Types of Functions


Here we shall look at different types of mappings.
‘Surjective’ comes from
the French word ‘sur’, Onto Mapping: A mapping f: AÆ B is said to an onto (or surjective) mapping if
meaning ‘on top of ’. f(A)= B, that is, the range and co-domain coincide. In this case we say that f maps A
onto B.

For example, f: ZÆ Z : f(x) = x+1, x ∈ Z, then every element y in the co-domain Z


has a pre-image y–1 in the domain Z. Therefore, f(Z) = Z ,and f is an onto mapping.

Injective Mapping: A mapping f: AÆ B is said to be injective (or one-one) if the


images of distinct elements of A under f are distinct, i.e., if x1 ≠ x2 in A, then
f(x1) ≠ f(x2) in B. This is briefly denoted by saying f is 1–1.

For example f: RÆ R be defined by f(x) = 2x+1, x ∈ R, then for x1 ,x2 ∈ R (x1 ≠ x2)
we have f(x1) ≠ f(x2). So, f is 1–1.

Bijective Mapping: A mapping f: AÆ B is said to be bijective (or one-one onto,) if


f is both injective and surjective, i.e., one-one as well as onto.

For example, f: ZÆ Z : f(x) = x+2, x ∈ Z is both injective and surjective. So, f is


bijective.

18
Sets, Relations and
Functions
There is a particular kind of bijective function that we use very often. Let us define
this.

Definition: A bijective mapping f : AÆ A is said to be a permutation on the set A.


Let A = {a1,a2,…,an}, and f be a bijection from A onto A that maps ai to f(ai), then
we write f as
⎛ a1 a2 . . . an ⎞ ⎛ a1 a2...an ⎞
f = ⎜⎜ ⎟⎟ . So, the identity mapping I= ⎜⎜ ⎟⎟ .
⎝ f(a1) f(a2)...f(an) ⎠ ⎝ a1 a2...an ⎠

Now, associated with a bijective function, we get another function very naturally,
which we now define.

Definition: Let f: AÆ B be a bijective mapping. Then the mapping g : BÆ A which


associates to each element b ∈ B the unique element a ∈ A, such that f(a) = b, is
called the inverse mapping of the mapping f: AÆ B. We denote this function g by f–1.

Note that a function f is invertible iff f –1 exists iff f is bijective.


Hence, if f: AÆB is a one-one onto mapping, then f -1 : BÆA exists, and is also
1-to-1.
⎛ a1 a2...an ⎞
Note the inverse of the permutation f = ⎜⎜ ⎟⎟ is the permutation
⎝ b1 b2...bn ⎠
⎛ b1 b2...bn ⎞
⎜⎜ ⎟⎟ .
⎝ a1 a2...an ⎠

For example, A= R~{3} and B= R~(1}, and the function f: AÆ B is defined by


x−2
f(x)= .
x −3
We can see that f is a one–to–one function.
∴ f inverse exists.

To get f –1(x) the following steps are required;


1. Replace f(x) by y in the equation describing the function. You will get
x−2
y= .
x −3

2. Interchange x and y. In other words, replace every x by y, and vice versa. You
y−2
will get x = .
y−3
3. Solve for y.

4. Replace y by f- –1(x).
3x − 2
By applying these steps we get f –1 (x)= .
x −1
Now try these exercises.

E26) Explain why f : Z Æ Z: f(x) = x2 is onto? Domain and range of f is Z.

E27) Which of the following kind of function would you use to provide photo
identity numbers? Why?
i) Constant function, ii) one‫ـ‬to‫ـ‬one function, and iii) identity function.
E28) Find f inverse of rule f : f(x) = x3–3.

19
Basic Combinatorics

Now we can see how different operations like addition, subtraction, multiplication
and division can be applied on functions.

1.5.2 Operations on Functions


If given whose domains ranges are subsets of the real numbers, we define the
function f+g by (f + g)(x) to be the function whose value at x is the sum of f(x) and
g(x). Symbolically,
(f + g)(x) = f(x) + g(x). This is called pointwise addition of f and g.

The domain of f+g is the intersection of the domains of f and g since to compute
(f + g)(x) it is necessary and sufficient to compute both f(x) and g(x).

Other operations on functions are defined similarly:


• (fg)(x) = f(x)g(x) (pointwise multiplication)
• f p (x) = (f(x))p for any real exponent p with the domain of f p consisting of those
points for which the p-th power of f(x) makes sense.
• (f/g)(x) = f(x)/g(x), for g(x) ≠ 0 (pointwise multiplication)

For example, if f(x) = 3 sin (x) and g(x) = x2, then


(f+g)(x) = 3 sin(x) + x2
(fg)(x) = 3 sin(x)*x2
(f-g)(x) = 3 sin(x) – x2
(f/g)(x) = 3 sin(x) / x2

The domains of both f and g are all real numbers, but the domain of f/g is
{ x | x ≠ 0}.

Now let us consider two functions f and g from A= {1,2} to, B= {1,2,3,4}, where
f={(1,1),(2,4)}. Let g be defined by the rule g(x)= x2 where the domain of g is the set
{1,2}. Here both have the same domain. Since f and g assign the same image to each
element in the domain, they have the same effect throughout. This is why we treat
them as the same, or equal.

Definition: If f and g are two functions defined on the same domain A and if f(a)=
g(a) for every a ∈ A, then the functions f and g are equal, i.e., f = g.

For example f(x) = x2+5, where x is a real number, and g(x) = x2+5, where x is a
complex number. Then the function f is not equal to the function g since they have
different domains although f(x)= x2+5= g(x ∀x∈ R). By this example we can
conclude that even if f(a)= g(a), f and g may not be the same.
So far, the operations you have seen are the same as those for member systems.
However, there is yet another operation on functions which we now define.
Definition: Let f and g be the operation of combining two functions by applying
them one after the other. That is, the composition of f(x) and g(x), denoted by, fog .
For example, consider f : R → R : f(x) = (x3 + 2x )3 . We can write it as the
composition of g and h, where the value of f(x) can be obtained by first calculating x3
+ 2x and then taking its third power . We can write g for first or inside function g(x)
= x3 + 2x. We write h for the second function : h(x) = x3 . The use of the variable x is
irrelevant, we could as well write h(y) = y3 for y ∈ R. We can see that goh(x) = g(x3
+ 2x) = (x3 + 2x)3 = f(x).
In general (f ο g) ≠ (g ο f).
For example, if, f(x) = x2 and g(x) = x+1, then (f ο g)(x) = (x + 1)2 and (g ο f)(x) =
x2+1.
Here we can see that f ο g ≠ g ο f.

Let us see another example, where f(x) = x2, g(x) = x +1, h(x) = x3

20
Sets, Relations and
Functions
Then, f ο (g ο h) (x) = (x3 +1)2 and (f ο g) ο h (x) = (x3+1)2. Here we can see f ο (g ο h)
= (f ο g) ο h.

Now let us see how you can get product of two permutations f and g of the same set,
⎛ a1 a2... an ⎞
Let f= ⎜⎜ ⎟⎟ and
⎝ f(a1) f(a2) … f(an) ⎠
⎛ a1 a2... an ⎞ ⎛ a1 a2.... an ⎞
g = ⎜⎜ ⎟⎟ . Then fg= ⎜⎜ ⎟⎟ is itself a
⎝ g(a1) g(a2)... g(an) ⎠ ⎝ f[g(a1)] f[g(a2)]... f[g(an)]⎠
permutation.

⎛1 2 3 ⎞ ⎛1 2 3 ⎞
For example if, f= ⎜⎜ ⎟⎟ , g= ⎜⎜ ⎟⎟ then
⎝ 2 3 1⎠ ⎝ 2 1 3⎠
⎛1 2 3 ⎞ ⎛1 2 3 ⎞
fg= ⎜⎜ ⎟⎟ and gf= ⎜⎜ ⎟⎟
⎝1 3 2 ⎠ ⎝ 3 2 1⎠

Note that f ο g ≠ g ο f. Thus the multiplication of permutations is not commutative


in general.

However, the multiplication of permutations is associative. For example, if f=


⎛1 2 3 4 ⎞ ⎛1 2 3 4 ⎞ ⎛1 2 3 4 ⎞
⎜⎜ ⎟⎟ , g= ⎜⎜ ⎟⎟ , h= ⎜⎜ ⎟⎟ be the permutations on
⎝1 3 4 2 ⎠ ⎝ 2 3 4 1⎠ ⎝ 4 2 1 3⎠
A = {1,2,3,4}, then

⎛1 2 3 4 ⎞ ⎛1 2 3 4 ⎞ ⎛1 2 3 4 ⎞
fg= ⎜⎜ ⎟⎟ ,gf= ⎜⎜ ⎟⎟ , gh= ⎜⎜ ⎟⎟ ,
⎝2 4 1 3⎠ ⎝ 3 4 2 1⎠ ⎝ 3 4 2 1⎠

⎛1 2 3 4 ⎞ ⎛1 2 3 4 ⎞
f(gh)= ⎜⎜ ⎟⎟ ,(fg)h= ⎜⎜ ⎟⎟ .
⎝ 2 3 4 1⎠ ⎝ 2 3 4 1⎠

Here we can see the multiplication of permutation is commutative.

Now try these exercises.

E 29) Let f(x) = 1/x and g(x) = x3 + 2. Find the following functions, where x ∈ R.
i) (f + g)(x)
ii) (f - g)(x)
iii) (fg)(x)
iv) (f/g)(x)

E30) Let f(x) = x + 1 ∀x ≥ −1 and g(x) = x3 ∀x ∈ R. Define the following


functions. Also give their domains.
i) (f + g)
ii) (f – g)
iii) (fg)
iv) (f/g)
v) (f ο g)

With this we have come to the end of this unit. Let us now summaries what we have
covered in this unit.

21
Basic Combinatorics

1.6 SUMMARY
In this unit we have covered the following points:
1. We introduced basic concepts related to sets and different ways of representing
them.

2. We worked at different operations on sets and there Venn diagram


representations.

3. We explored some properties common to operations on sets and logical


statements.

4. In the process we also documented the duality principle.

5. We defined relations as a Cartesian product of sets and looked at several


examples and type of relations.

6. We defined a function as a particular kind of relation. Then we studied different


types of functions as well as basic operations on functions. In the process we
considered permutations and their product.

1.7 SOLUTIONS / ANSWERS


E1) A={x:x is a student of IGNOU.}

E2) i) The collection of all good teachers is not a set because this collection is not
well-defined. The characteristic ‘good’ cannot be measured objectively.
ii) The set of points on a line is not finite because infinitely many points make
a straight line.

E3) {…, –3, –2, –1,0,1,2,3,…}.

E4) Set of vowels of English alphabet V={a,e,i,o,u}. Two subsets of set V are
V1={a,e}, and V2={i,o}. Two supersets of V are V3={a,b,c,…,z}, and
V4={a,c,d,e,i,o,u,…,z}.

E5) Powerset of A={a,e,i,o,u} is


{ φ ,{a},{e},{i},{o},{u},{a,e},{a,i},{a,o},{a,u},{e,i},{e,o},{e,u},{i,o},{i,u},
{o,u},{a,e,i},{a,i,o},{a,o,u},{e,i,o},{i,o,u},{i,o,u},{a,e,i,o},{e,i,o,u},{a,e,i,o,u}
.

E6) For empty set A={ } or φ , P(A)=1

E7) If A ⊆ B, then P(A) ⊆ P(B) because every subset of A is a subset of B.

E8) If P(A) =P(B) then A ∈ P(A)= P(B)= A ⊆ B. Similarly, B ⊆ A. Therefore A =


B.

E9) A B U

22
Sets, Relations and
Functions

Fig.12: The Shaded portion is A Δ B

You can try them for the other situations. We are showing in Fig. 12 for the
second situation.

E10) A ∪ (B ∩ C) = {Math, Physics, Science}= A.

E11) i) A ~B ={1,2,3}
ii) B ~A ={7,8,9}
iii) A Δ B ={1,2,3,7,8,9}
E12) Only if A and B are φ .

E13) Write separate functions to find A~B, B~A and A Δ B with passing sets A and
B as argument, return the resultant set.

E14) A ∩ B can be equal to A ∪ B if either A ⊆ B or B ⊆ A.

E15) i) Dual of A ∩ (B ∩ C) = (A ∩ B) ∩ C is A ∪ (B ∪ C) = (A ∪ B) ∪ C.
ii) Dual of (A ∪ B) ∩ (A ∪ C) is (A ∩ B) ∪ (A ∩ C).

E16)
A B U

C
A ∪ (B ∩ C)

Fig.13: The lined portion represents A ∪ (B ∩ C)

E17) A B U A B U

C
C
(A ∪ B) ∩ C (A ∪ (B ∩ C)

Fig.14(a) Fig.14(b)

Shaded area in Fig.14 (a) and Fig.14(b) are not same so (A ∪ B) ∩ C is not
equal to (A ∪ (B ∩ C).

E18) i) X Χ X={(a,a),(a,b),(a,c),(b,b),(b,c),(c,c)}.
ii) X Χ Y={(a,1), (b,1), (c,1), (a,2), (b,2), (c,2), (a,3), (b,3), (c,3)}.
iii) X Χ φ = φ .

23
Basic Combinatorics

E19) A Χ B = B Χ A iff A = B.

E20) The geometric diagram for RΧ{2}


will be the line parallel to Y axis.
See Fig.15.

Fig.15: y=2

E21) i) For a ∈ A, aRa is reflexive because every one loves herself or himself.
ii) R is not symmetric because if a loves b then b need not love a, i.e., aRb
does not always imply bRa. Thus R is not symmetric.
iii) R is not transitive, because if a loves b and b loves c then a need not love c;
i.e., if aRb and bRc, aRc need not be. Thus, R is not transitive.
Hence, R is reflexive but is neither symmetric nor transitive.

E22) R is a function because each element of A is assigned to a unique element of B.

E23) Not every relation is a function. For example, this relation does not satisfy the
property that,
a) Each element of A must have assigned one element in B.

b) If a ∈ A is assigned b ∈ B and a ∈ A is assigned bʹ ∈ B then b = bʹ .


That is why relations those who don’t satisfy above properties are not a
function

E24) We can see that the code has no effect on the value of n ≤ 0.In the While loop,
the value of n is halved whenever it is even. If n becomes odd before reaching
1, the second part of the while loop is invoked, and n remains odd and increases
forever.
⎧0 if n = 0.
This shows that f : NÆN is the function defined by f(n)= ⎪⎨1, if n is a powerof 2,
⎪ undefinedotherwise

E25) The domain of f is {1,2,3,4} and range of f is {2,3,4,5}.

E26) Function f(x) = x2 is one-to-one because for every value of x, x2 will be a


number that is different for different x. Hence, f(x) = x2 is one-one mapping.

E27) One-to-one function will be used for providing identity card number, because
each person must have unique identity numbers.

E28) Step 1: y = x3–3


Step 2: x = y3–3

Step 3: y = 3
x+3
Step 4: f –1(x) = 3
x+3.

1
E29) i) (f+g) (x)= + x3 +2
x
1
ii) (f−g) (x)= − (x3 +2)
x
⎛1⎞
iii) (f.g) (x)= ⎜ ⎟ (x3 +2)
⎝ x⎠

24
Sets, Relations and
Functions
1
iv) (f/g) (x)= ∀x∈ R.
x( x + 2)
3

E30) i) (f+g) (x) = x + 1 +x3 ∀x ≥ −1


ii) (f-g) (x) = x + 1 –x3 ∀x ≥ −1
iii) (f.g) (x) = x + 1 x3 ∀x ≥ −1
iv) (f/g) (x) = x + 1 /x3 ∀x ≥ −1, x ≠ 0

v) (f ο g)(x) = f(x3) = x 3 + 1 ∀x ≥ −1 .

25

You might also like