1. ## Codomain vs. Range.

I do not quite understand the difference between the codomain and the range.

given:

$\displaystyle f:\mathbb{E}\rightarrow \mathbb{Z}$
State the domain, codomain, and range of:

$\displaystyle f(x)=\left |x \right |;x\in \mathbb{E}$

Domain: $\displaystyle \mathbb{E}$
Codomain: $\displaystyle \mathbb{Z}$
Range:$\displaystyle \mathbb{Z}^+$

Domain:$\displaystyle \mathbb{E}$
Codomain:$\displaystyle \mathbb{Z}$
Range:$\displaystyle \left (\mathbb{Z}^{+}\cap \mathbb{E}\right )\cup \left \{ 0 \right \}$

I just don't get how I should specifie the range, or really what the difference between the codomain and range is.

Any help? thx

$\displaystyle \int$

2. I think of a function as a computer, you put in numbers and you get them out.

The set of numbers you put in is the DOMAIN.

The set of numbers you EXPECT to get out is the CODOMAIN.

The set of numbers that you actually do get out is the RANGE. Note that the range is always a subset of the Codomain.

E.g. the function $\displaystyle f(x) = \frac{1}{x}$.

If you put in any real number other than 0, you would expect to get out a real number. But of course, you can not get out 0.

So that means the domain is $\displaystyle \mathbf{R}\backslash\{0\}$, the codomain is $\displaystyle \mathbf{R}$ and the range is $\displaystyle \mathbf{R}\backslash\{0\}$.

If we were to write this in full function notation it would be

$\displaystyle f := \left\{\mathbf{R}\backslash\{0\} \to \mathbf{R} | f(x) = \frac{1}{x}\right\}$

3. A function is a triple consisting of the domain A, the codomain B, and the set of pairs F (a subset of A x B), or a law F mapping elements of A into elements of B. Given the third element F, the domain can be reconstructed: it is the set of first elements of all pairs. Similarly, the set of second elements of all pairs is the range. The codomain, however, cannot be reconstructed from F; it can be an arbitrary superset of the range.

In other words, the relationship between F and the domain A is fixed and objective; the relation between F and the codomain B is subjective and is a matter of politics .

So, if $\displaystyle f:\mathbb{E}\rightarrow \mathbb{Z}$ is given, then the codomain of $\displaystyle f$ is $\displaystyle \mathbb{Z}$. It could be that $\displaystyle f$ does not cover the whole $\displaystyle \mathbb{Z}$, but someone who designed the function decided to give it this codomain. This is a matter of definition.

Next, the range does not have to be all of $\displaystyle \mathbb{Z}^+$. E.g., if $\displaystyle \mathbb{E}=\{-1,0,1\}$, then the range of $\displaystyle f$ is $\displaystyle \{0,1\}$. By the way, is $\displaystyle \mathbb{E}$ some arbitary set? This does not seem to be a standard notation.

4. $\displaystyle \mathbb{E}$ in my book is defined to be the set of all even integers.

So, the codomain is the general superset in which all possible values for the range COULD be in and the range is the specific set of outputs?
so
$\displaystyle f:=\left \{\mathbb{Z}^{+}\rightarrow \mathbb{Z}^{+}|f(x)=2x+1\right \}$
The codomain would be $\displaystyle \mathbb{Z}^{+}$ But the range would be $\displaystyle \mathbb{Z}^{+}\setminus \mathbb{E}$

5. So, the codomain is the general superset in which all possible values for the range COULD be in
Any member of the range MUST be in the codomain.

so
$\displaystyle f:=\left \{\mathbb{Z}^{+}\rightarrow \mathbb{Z}^{+}|f(x)=2x+1\right \}$
The codomain would be $\displaystyle \mathbb{Z}^+$ But the range would be $\displaystyle \mathbb{Z}^{+}\setminus \mathbb{E}$
Again, I am not sure about the notation, but since the book writes $\displaystyle \left (\mathbb{Z}^{+}\cap \mathbb{E}\right )\cup \left \{ 0 \right \}$, it seems that $\displaystyle 0\notin\mathbb{Z}^+$. In this case, the range of $\displaystyle f$ is $\displaystyle \{3,5,\dots\}$, i.e., 1 is not in the range.

6. By the way the word "range" has somewhat varied usage. The unambiguous word for what you mean by it is image.

Sometimes authors use "range" to refer to image (as is done all throughout this thread) and sometimes authors use "range" to refer to codomain!