# Difference between codomain and range

1. Nov 9, 2012

### smithnya

I am having a difficult time wrapping my mind around the differences between a codomain and a range. Could someone explain the difference between the two and possibly provide an example?

2. Nov 9, 2012

3. Nov 9, 2012

### Klungo

Consider the function f(x)=sin(x)

We could say f:R->R. The codomain of f is R because that's where the values of x are mapped to.

The range of f:X->Y, S, is defined as: for all elements y in Y, there exists x in X such that y=f(x). Basically, S=f(X).

In our example above, the range is [-1,1].
We have π mapped to 0, π/2 mapped to 1, etc.

Note that the range is dependent on the domain.

Edit: If you consider g:[0,π/2]->R, then the range of g(x)=sin(x) is [0,1].

If you consider h:R->C, the range of h(x)=sin(x) is still [-1,1]. The codomain being the complex numbers. Since the domain are reals, sin maps them to real values.

Last edited: Nov 9, 2012