Domain, Range, Codomain
Domain, Range, Codomain
But in fact they are very important in defining a function. Read on!
Functions
A function relates an input to an output:
Example: this tree grows 20 cm every year, so the height of the tree
is related to its age using the function h:
h(age) = age × 20
The function may not work if we give it the wrong values (such as a
negative age),
And knowing the values that can come out (such as always positive) can
also help
So we need to say all the values that can go into and come out of a function.
Example
• And the set of elements that get pointed to in B (the actual values produced
by the function) are the Range, also called the Image.
And we have:
Domain: {1, 2, 3, 4}
Codomain: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Range: {3, 5, 7, 9}
In fact the Domain is an essential part of the function. Change the Domain and
we have a different function.
Example: a simple function like f(x) = x2 can have the domain (what goes in)
of just the counting numbers {1,2,3,...}, and the range will then be the set
{1,4,9,...}
And another function g(x) = x2 can have the domain of integers {...,-3,-2,-
1,0,1,2,3,...}, in which case the range is the set {0,1,4,9,...}
Even though both functions take the input and square it, they have a different
set of inputs, and so give a different set of outputs.
For example f(x) always gives a unique answer, but g(x) can give the same
answer with two different inputs (such as g(-2)=4, and also g(2)=4)
Codomain vs Range
The Codomain and Range are both on the output side, but are subtly different.
The Codomain is the set of values that could possibly come out. The Codomain
is actually part of the definition of the function.
So the codomain is integers (we defined it that way), but the range is even
integers.
If we say the codomain (the possible outputs) is the set of real numbers,
then square root is not a function! ... is that a surprise?
The reason is that there could be two answers for one input, for example f(9)
= 3 or -3
A function must be single valued. It cannot give back 2 or more results for the
same input. So "f(9) = 3 or -3" is not right!
√In fact, the radical symbol (like √x) always means the principal (positive)
square root, so √x is a function because its codomain is correct.
Notation
Mathematicians don't like writing lots of words when a few symbols will do. So
there are ways of saying "the domain is", "the codomain is", etc.
and either of these say that the function "f" takes in "x" and
or
returns "x2"
There is also: