A function is a rule that takes each member of one set and gives it exactly one partner in another set. The idea runs through the whole of higher mathematics: every graph you will draw in this chapter, every formula such as , and every logarithm and modulus you meet later is a function. This lesson sets out what a function is, how to recognise one from an arrow diagram, and the words used to describe it: image, pre-image, domain, codomain and range.
Relations and functions
In the chapter on sets and relations you met a relation from a set to a set : a collection of ordered pairs with and . A relation can be shown as an arrow diagram, with an arrow from to for every pair .
A function is a special kind of relation.
Definition. A relation from to is called a function if each and every element of is associated with a unique (exactly one) element of . We write
and read it as " maps to ".
So two conditions must both hold:
- Every element of has an arrow leaving it. No element of is left out.
- No element of has two or more arrows leaving it.
Nothing is said about . An element of may receive several arrows, or none at all.
Example 1
Let and , and let be the relation with arrows , , , . Is a function?
Check the two conditions. Every element of (that is , , and ) has an arrow. Each has only one arrow. So is a function.
Notice two things that do not spoil it. Both and go to the same element ; that is allowed. The element of receives no arrow; that is allowed too.
As a set of ordered pairs, .
Example 2
Let and , and let have arrows and only. Is a function from to ?
The element of has no arrow. Condition 1 fails, so is not a function from to .
Example 3
Let and , and let have arrows , , , . Is a function from to ?
The element has two arrows, one to and one to . Its partner is not unique, so condition 2 fails. is not a function.
A quick way to remember both tests: in an arrow diagram of a function, every element on the left sends out exactly one arrow.
Image and pre-image
If is a function and , that is, the arrow from lands on , then
- is called the image of , and we write ;
- is called a pre-image of .
In Example 1, the image of is , so . The element of has two pre-images, and . The element has no pre-image at all.
An element of the domain always has exactly one image. An element of the codomain may have one pre-image, several, or none.
Domain, codomain and range
If is a function, then
- is called the domain of ;
- is called the codomain of ;
- the set of all images of the elements of is called the range of . It is written .
The range is always a subset of the codomain: .
Example 4
For the function of Example 1, write the domain, codomain and range.
The images are , , , . Collecting them, and writing each only once,
The codomain is the set the arrows are allowed to land in; the range is the set they actually land in.
Functions given by a formula
Most functions in this chapter are given by a rule written as a formula. The rule tells you how to find the image of any element of the domain.
Example 5
Let and let be given by . Find the range of , the pre-images of and the pre-images of .
Work out each image:
Each element of has exactly one image, so is a function. The range is .
The pre-images of are the elements whose image is : these are and .
No element of has image , so has no pre-image. That is no problem: belongs to the codomain but not to the range.
Example 6
Let be given by . Find the image of and the pre-image of .
The image of is .
For the pre-image of , solve :
So the pre-image of is .
Example 7
Let and . A relation sends each in to every number in whose square is . Is this a function?
The number is sent to and also to , since both square to . One element has two partners, so the relation is not a function.
Practice
- Let and . Is a function from to ?
- With the same sets, is a function from to ?
- With the same sets, is a function from to ? Give a reason.
- With the same sets, is a function from to ? Give a reason.
- Let be defined on by . Find the range of .
- Let be defined on by . Find the range of and the pre-images of .
- For , , find the image of and the pre-image of .
- A function has domain and codomain , with , , , . Write its range, and name the element of the codomain that has no pre-image.
- Let and . Each in is sent to the number in whose square is . Is this a function? If so, write it as a set of ordered pairs.
Answers
Show answers
- Yes. Every element of has exactly one image.
- Yes. Every element has exactly one image; all images happen to be .
- No. The element has two images, and .
- No. The element has no image.
- , , , , so the range is .
- The images are , so the range is . The pre-images of are and .
- . For the pre-image, gives , so .
- Range . The element has no pre-image.
- Yes. Now only positive square roots are available, so each element has exactly one partner: .