Domain Range and Codomain Of A Function

We are familiar with Domain of a Function and Range of a Function. But what does it mean? before diving deeper in to the topic, let us understand what is a function?


Functions are one of the very important concepts in mathematics which has got numerous applications in real world. Be it the mega skyscrapers or super-fast cars, their modeling requires methodical application of functions. Almost all the real world problems are formulated interpreted and solved using functions.

An understanding of relations is required in order to understand functions. And understanding of Cartesian products is required to understand relations. A Cartesian product of two sets \(A\) and \(B\) is collection of all the ordered pairs \((a,b)\) such that \(a ∈ A\) and \(b ∈ B\) . A relation is a subset of a Cartesian product. Hence, a relation is a rule that “relates” an element from one set to an element from another set. A function is a special kind of relation. Let us consider a relation \(F\) from set \(A\) to \(B\).

Definition 1: A relation \(F\) is said to be a function if each element in set \(A\) is associated with exactly one element in set \(B\).

To understand the difference between relations and functions, let us take an example. Set \(A\) contains the name of all the countries that have won cricket world cup and set \(B\) contains the list of years in which world cup was played. The arrow diagram in the fig.1 represents a relation \(R\) but not a function. This is because elements in set \(A\) are associated to more than one element in set \(B\).

Domain And Range Of A Function

But if we define a relation \(F\) from set \(A\) to \(B\) such that it associates the countries with the year they won world cup for the first time, for every element in set \(A\), we will have exactly one association in set \(B\). This relation \(F\) shown in fig. 2 qualifies to be a function.

Domain And Range Of A Function
Domain and Range of a Function:

Remember that in case of a relation, the domain might not be same as the left set in the arrow diagram. This is because the set may contain any element which doesn’t have an image in the right set. But in case of functions, domain will always be equal to the first set. Range and Codomain of a function are defined in the same way as they are defined for relations. Let us look at some definitions with examples to understand better.

Definition 2: The set of all possible values which qualify as inputs to a function, is known as the domain of the function.

For e.g. the domain of the function \(F\) is set \(A\) i.e. {India, Pakistan, Australia, Sri Lanka}.

Definition 3: The set of all the outputs of a function is known as the range of the function \(x \).

For e.g. the range of the function \(F\) is {1983,1987,1992,1996}. On the other hand, the whole set \(B\) is known as the codomain of the function. It is the set which contains all the outputs of the function. So, the set of real numbers is a codomain for every real valued function. Codomain of the function \(F\) is set \(B\).

Till now, we have represented functions with upper case letters but they are generally represented by lower case letters. If \(f\) is a function from set \(A\) to \(B\) and \((a,b) ∈ f\), then \(f(a)\) = \(b\). \(b\) is called image of \(a\) under \(f\) and \(a\) is called pre-image of \(b\) under \(f\)..

There are several types of functions and some of them even have got funny names e.g. floor function, ceiling function, etc. To know more, visit and experience fun in learning.

Practise This Question

Which of the following collections is not a set?