Function as Mapping Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Function as Mapping.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

Viewing a function as a mapping means thinking of it as an explicit association from each element of the domain to exactly one element of the codomain.

Like a dictionary: every word maps to a definition. Every input maps to an output.

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: A function is a rule that assigns each allowed input exactly one output.

Common stuck point: The procedure for function as mapping is the easy part; the trap is rejecting a function because two inputs share an output. Asking "Does any input point to two different outputs?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Does any input point to two different outputs?

Worked Examples

Example 1

easy
Let f:{1,2,3}โ†’{a,b,c}f: \{1,2,3\} \to \{a,b,c\} be defined by f(1)=af(1)=a, f(2)=af(2)=a, f(3)=cf(3)=c. Determine whether ff is a valid function, and find its range.

Answer

Valid function; range ={a,c}= \{a, c\}

First step

1
A function requires every element of the domain to map to exactly one element of the codomain. Check: f(1)=af(1)=a, f(2)=af(2)=a, f(3)=cf(3)=c โ€” each domain element has exactly one image. โœ“ Valid function.

Full solution

  1. 2
    The range is the set of actual output values: {a,c}\{a, c\} (note bb is in the codomain but not in the range).
  2. 3
    Observe this is many-to-one: both 11 and 22 map to aa.
A function maps each domain element to exactly one codomain element, but multiple domain elements may share an output (many-to-one). The range (image) is only the outputs actually achieved, which may be a proper subset of the codomain.

Example 2

medium
Explain why the relation R={(1,2),(1,3),(2,5)}R = \{(1,2),(1,3),(2,5)\} is NOT a function from {1,2}\{1,2\} to {2,3,5}\{2,3,5\}.

Example 3

medium
Let f:{1,2,3,4}โ†’{a,b,c}f: \{1, 2, 3, 4\} \to \{a, b, c\} with f(1)=af(1) = a, f(2)=bf(2) = b, f(3)=af(3) = a, f(4)=cf(4) = c. Find the range and decide if ff is one-to-one.

Example 4

medium
Given f:Zโ†’Zf: \mathbb{Z} \to \mathbb{Z} with f(n)=2n+1f(n) = 2n + 1, find fโˆ’1({5})f^{-1}(\{5\}) (the pre-image of 55).

Example 5

hard
Define f:Rโ†’Rf: \mathbb{R} \to \mathbb{R}, f(x)=x3f(x) = x^3. Determine whether ff is one-to-one and whether it is onto.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
Which of the following sets of ordered pairs defines a function from {1,2,3}\{1,2,3\} to R\mathbb{R}? (A) {(1,5),(2,5),(3,5)}\{(1,5),(2,5),(3,5)\} (B) {(1,2),(2,3)}\{(1,2),(2,3)\} (C) {(1,0),(2,1),(3,2),(1,4)}\{(1,0),(2,1),(3,2),(1,4)\}

Example 2

medium
Let f:Rโ†’Rf: \mathbb{R} \to \mathbb{R}, f(x)=x2f(x) = x^2. Find fโˆ’1({4})f^{-1}(\{4\}) (the pre-image of 44) and explain why ff does not have an inverse function on all of R\mathbb{R}.

Example 3

easy
A mapping sends 1โ†’a1\to a, 2โ†’b2\to b, 3โ†’c3\to c. Is it a function?

Example 4

easy
A mapping sends 1โ†’a1\to a, 2โ†’a2\to a, 3โ†’b3\to b. Is it a function?

Example 5

easy
A mapping sends 1โ†’a1\to a and 1โ†’b1\to b (with aโ‰ ba\ne b). Is it a function?

Example 6

easy
Use the vertical line test: a graph hit twice by some vertical line. Function?

Example 7

easy
Is the set of pairs {(1,2),(2,4),(3,6)}\{(1,2),(2,4),(3,6)\} a function?

Example 8

easy
Is {(1,2),(1,3),(2,4)}\{(1,2),(1,3),(2,4)\} a function?

Example 9

easy
In the dictionary mapping wordโ†’\todefinition, what plays the role of input?

Example 10

easy
Can a function map two different inputs to the same output?

Example 11

medium
A mapping from {1,2,3}\{1,2,3\} assigns 1โ†’51\to 5, 2โ†’52\to 5, 3โ†’53\to 5. Is it a function? What is special about it?

Example 12

medium
Domain {a,b}\{a,b\}, codomain {1,2}\{1,2\}. How many distinct functions exist?

Example 13

medium
Is the relation 'is a parent of' from people to people a function?

Example 14

medium
Does f(x)=x2f(x)=x^2 as a mapping from reals to reals send any input to two outputs?

Example 15

medium
Is the circle x2+y2=25x^2+y^2=25 a function of xx? Use the mapping idea.

Example 16

medium
A vending machine maps each button to one snack, but two buttons give chips. Function?

Example 17

medium
A mapping diagram has an input arrow from 44 with no arrow leaving it. Is it a function on its stated domain?

Example 18

medium
Restricting f(x)=x2f(x)=x^2 to xโ‰ฅ0x\ge 0 makes it one-to-one. What does that mean for the mapping?

Example 19

medium
A mapping diagram shows 1โ†’a1\to a, 2โ†’b2\to b, and a second arrow 2โ†’c2\to c. Is it a function?

Example 20

challenge
Domain {a,b,c}\{a,b,c\}, codomain {1,2}\{1,2\}. How many functions are there, and how many are one-to-one?

Example 21

challenge
A mapping is given by f(n)=f(n)= remainder of nn divided by 3, on inputs {0,1,2,3,4,5}\{0,1,2,3,4,5\}. Is it a function? Is it one-to-one?

Example 22

challenge
Explain via mapping why f(x)=ยฑxf(x)=\pm\sqrt{x} is NOT a function but f(x)=xf(x)=\sqrt{x} is.

Example 23

easy
Is the set of pairs {(5,8),(6,8),(7,8)}\{(5, 8), (6, 8), (7, 8)\} a function?

Example 24

easy
Is {(2,3),(2,5),(4,6)}\{(2, 3), (2, 5), (4, 6)\} a function?

Example 25

easy
Is {(1,1),(2,4),(3,9),(4,16)}\{(1, 1), (2, 4), (3, 9), (4, 16)\} a function?

Example 26

easy
A mapping diagram sends aโ†’1a \to 1, bโ†’2b \to 2, cโ†’3c \to 3, dโ†’2d \to 2. Is it a function?

Example 27

easy
Does a horizontal line graph represent a function?

Example 28

easy
Does a vertical line graph represent a function?

Example 29

medium
Domain {1,2,3}\{1, 2, 3\}, codomain {a,b,c}\{a, b, c\}. How many one-to-one functions are there?

Example 30

medium
Domain {1,2,3}\{1, 2, 3\}, codomain {a,b,c,d}\{a, b, c, d\}. How many total functions are there?

Example 31

medium
Each person maps to their birth year. Is this a function from people to years?

Example 32

medium
Each year maps to people born in it. Is this a function from years to people?

Example 33

medium
A mapping f:{1,2,3,4,5}โ†’{0,1}f: \{1,2,3,4,5\} \to \{0,1\} sends nn to nโ€Šmodโ€Š2n \bmod 2. List the pre-image of 11.

Example 34

medium
True or false: the graph of x=y2x = y^2 represents yy as a function of xx.

Example 35

medium
A function f:Aโ†’Bf: A \to B has โˆฃAโˆฃ=5|A| = 5 and โˆฃBโˆฃ=7|B| = 7. Can ff be one-to-one? Can it be onto?

Example 36

hard
Domain {1,2,3,4}\{1,2,3,4\}, codomain {a,b}\{a,b\}. How many functions are onto?

Example 37

hard
Let f:Rโ†’Rf: \mathbb{R} \to \mathbb{R} with f(x)=โˆฃxโˆฃf(x) = |x|. Is ff one-to-one? Onto?

Example 38

hard
A mapping f:{1,2,3,4}โ†’{1,2,3,4}f: \{1,2,3,4\} \to \{1,2,3,4\} has f(1)=2,f(2)=3,f(3)=4,f(4)=1f(1)=2, f(2)=3, f(3)=4, f(4)=1. Is ff a bijection?

Example 39

hard
Find the number of one-to-one functions from a 4-element set to a 6-element set.

Example 40

hard
A function f:Zโ†’Zf: \mathbb{Z} \to \mathbb{Z} is defined by f(n)=f(n) = the remainder when nn is divided by 44. Find the pre-image of 11 restricted to {1,2,โ€ฆ,12}\{1,2,\dots,12\}.

Example 41

challenge
Domain {1,2,3}\{1,2,3\}, codomain {a,b,c}\{a,b,c\}. How many functions are onto?

Example 42

challenge
Prove or refute: if f:Aโ†’Bf: A \to B is a bijection, then the inverse mapping fโˆ’1:Bโ†’Af^{-1}: B \to A is also a function.

Background Knowledge

These ideas may be useful before you work through the harder examples.

function definition