 # Differences Between Codomain and Range

## Codomain and Range in Mathematics

Like numbers, there is no end to mysteries of mathematics. The deeper you go in the world of mathematics, the more magnificent it gets. So today we are here to learn about the differences between Codomain and Range. But to understand all this we first need to know what a function is. Do you know what a function is? Any relation defined over two different sets that are of the binary format is a function, provided that every element that is a part of the first set in the relation has a corresponding element in the second set of the relation. However, the relation or the correspondence of the first set's elements must be with exactly one element of the second set.

### Function Explained with Example

To understand the definition clearly let’s take an example. Say there are two sets namely, set A and set B. The relation is from set A to set B. So for this relation to be a function all the elements of set A should have a corresponding and unique element in set B. A function is represented in the following manner:

F(x) = Y

Example:-

y=x2   is a function where x and y belong to real numbers. Here, set A and set B has all the numbers that are present in real numbers.

### Domain:

A domain is a group of possible values that the independent variable can take. This means the set of all the possible values that ‘x’ can take in the function f is the domain of the given function. A domain is a set of pre-images. According to the example taken above, set A is the domain of the function.

Example:-

y=x+4

Here x-4 is the domain of the given function. So we can write this as the domain of the function is [-4,)

### Codomain:

A codomain is the group of possible values that the dependent variable can take. This means that the set of all the possible values that ‘y’ can take in the function f is the codomain of the given function. A codomain is a set of images. According to the example taken above, set B is the codomain of the function

### Range:

The range is all the elements from set B that have the corresponding pre-image in set A. Hence, a range can also be defined as the set of all the possible values of the function that we receive upon taking the different values of x in the function f.

Example:-

Taking the example taken above,  y=x+4

Here y0 is the range of the given function. So we can write this as the range of the function is [0,) as y can only take positive values.

Here are the domain and range of some common functions that we see very frequently while solving mathematics-

## Domain and Range:

 S.NO. Types of function Domain Codomain 1. f(x) = x (-∞ , + ∞) (-∞ , + ∞) 2. f(x) = x 2 (-∞ , + ∞) [0 , + ∞) 3. f(x) = sin ( x ) (-∞ , + ∞) [-1 , 1] 4. f(x) = cos ( x ) (-∞ , + ∞) [-1 , 1] 5. f(x) = sin-1( x ) [-1 , 1] [-π/2 , π/2] 6. f(x) = cos-1( x ) [-1 , 1] [0 , π] 7. f(x) = a x (-∞ , + ∞) (0 , +∞) 8. f(x) = Log a ( x ) (0 , + ∞) (-∞ , + ∞)

### Types of Functions

There are five types of functions on the basis of how the domain and codomain is related.

1. One-One functions

2. Many-one functions

3. Onto functions

4. Into functions

5. One-One and Onto functions

They are discussed in detail below.

1. ### One-One Functions

When each element of the domain has a distinct image in the codomain then the function is One-One function. It is also called injective function.

1. Many-One Functions

When two or more elements of the domain do not have a distinct image in the codomain then the function is Many -One function.

1. Onto Functions

When each element of the codomain has a  distinct image in the domain then the function is Onto function. It is also called surjective function.

1. Into Functions

When two or more elements of the codomain do not have a distinct image in the domain then the function is Into function.

1. One-One and Onto Functions

When each element of the domain has a distinct image in the codomain and when each element of the codomain has a  distinct image in the domain then the function is One-One and Onto function. It is also called bijective function.

Now let’s summarize the difference between Codomain vs Range

## Codomain vs Range

 Basics of distinction Codomain Range MEANING A codomain is the group of possible values that the dependent variable can take. This means that the set of all the possible values that ‘y’ can take in the function f is the codomain of the given function. It is also called the range and some other additional values. The range is all the elements from set B that have the corresponding pre-image in set A. Hence, a range can also be defined as the set of all the possible values of the function that we receive upon taking the different values of x in the function f. It is a subset of the codomain. PURPOSE It restricts the output of the function. It does not restrict the output of the function. RELATION It is related to the meaning of a function. It is related to the image of a function. EXAMPLE If L = {1, 2, 3, 4} and M = {1, 2, 3, 4, 5, 6, 7, 8, 9} and the relation f: A B is defined by f (x) = x2 Codomain = Set M = {1, 2, 3, 4, 5, 6, 7, 8, 9} If L = {1, 2, 3, 4} and M = {1, 2, 3, 4, 5, 6, 7, 8, 9} and the relation f: A B is defined by f (x) = x2. Range = {1, 4, 9}

### Fun Facts:

1. The domain, codomain and range are not always equal. In some cases, it can be equal.

2. The range is a subset of codomain.

3. The denominator of the given function can never be zero.

1. Codomain and Range ever be equal?

Ans) Yes, the codomain and range can be equal when the number of elements in the range is equal to the number of elements in the codomain. This means that every element of set A has an image in set B for a function.

f: A B.

As we already know, that range is the subset of the codomain. Therefore, a set is a subset of itself indicating that for the range to be equal to codomain it must have the same number of elements. For codomain and range to be equal every element of the domain should have an image in the codomain. This will automatically make the codomain and range equal.

2. Can the range be greater than codomain? Can domain, range and codomain ever be equal?

Ans) No, it is not possible as the range is a subset of the codomain. A subset can never be greater than the universal set. Thus, implying that the number of elements present in range can never be more than the number of elements present in the codomain. Codomain will always be greater than or equal to the range.

Yes, it is possible for domain, codomain and range to be equal. The domain and codomain to be equal to each element of the domain should have an image in the codomain. This will lead to an equal number of the range. Thus, making—domain, codomain and range to be equal.

Things that appear the same may not always be. Similarly, range and codomain are also very different.