Relationships Can Be Described As Relations Or Functions
- Mathematics often begins with a simple question: how are two quantities connected?
- You might connect a student to their number of siblings, a time to a distance travelled, or a number to its square.
- Any rule (or set of pairings) that links elements from one set to elements of another set is called a relation.
Relation
A set of ordered pairs $\{(x,y)\}$ that links elements from one set (inputs) to elements of another set (outputs).
A function is a special kind of relation with an extra restriction: each input must give exactly one output.
Function
A relation in which every input value in the domain is mapped to one and only one output value in the range.
You will meet these ideas in three linked representations:
- Mapping diagrams (arrows from inputs to outputs)
- Sets of ordered pairs $(x,y)$
- Graphs on a coordinate plane
A Relation Is A Set Of Ordered Pairs With A Domain And Range
- A relation can be described using sets.
- Suppose there is a set $A$ of possible inputs and a set $B$ of possible outputs.
- A relation is a collection of ordered pairs $(x,y)$ with $x\in A$ and $y\in B$.
- In this sense, the relation is the "rule" that maps elements of set $A$ onto elements of set $B$.
Domain And Range Describe The Inputs And Outputs
Domain
The set of all input values $x$ used in a relation or function.
Range
The set of all possible output values (often $y$-values) that the function can produce from its set of input values (the domain).
If a relation is given as a list of ordered pairs, you can read the domain and range directly:
- Domain: collect all the first coordinates (the $x$-values).
- Range: collect all the second coordinates (the $y$-values).
- Consider the relation $R=\{(1,4),(2,4),(3,7),(5,7)\}$.
- Domain: $\{1,2,3,5\}$
- Range: $\{4,7\}$
- Notice that the output 4 appears twice and the output 7 appears twice.
- That is allowed in a relation.
- Students sometimes think the range must have the same number of elements as the domain. It does not.
- Multiple inputs are allowed to share the same output in a relation, and in a function too.
Mapping Diagrams Show The Type Of Relationship
- A mapping diagram uses arrows to show how elements of set $A$ (inputs) are mapped to elements of set $B$ (outputs).
- Four common patterns are useful vocabulary.
One-to-one relation
A relation where each input is mapped to a unique output, and no two different inputs share the same output.
One-to-many relation
A relation where at least one input is mapped to more than one output.
Many-to-one relation
A relation where two or more different inputs are mapped to the same output.
Many-To-Many Relation
A relation where at least one input maps to multiple outputs and at least one output is shared by multiple inputs.
- A function can be one-to-one or many-to-one.
- It cannot be one-to-many or many-to-many, because a function never allows a single input to have two different outputs.
Real-Life Examples Of Each Mapping Type
In everyday language, these mapping types show up naturally:
- One-to-one: each person in a class $\rightarrow$ their student ID number (assuming IDs are unique).
- Many-to-one: each student $\rightarrow$ their number of siblings (several students can have 2 siblings).
- One-to-many: a parent $\rightarrow$ their children (one parent corresponds to several children).
- Many-to-many: students $\rightarrow$ the sports they play (a student can play several sports, and each sport has many students).
- Think of a function like a vending machine button: when you press one button (input), exactly one snack comes out (output).
- If one button could sometimes release two different snacks, the machine would not behave like a function.
A Function Is A Relation With Exactly One Output Per Input
- The defining rule is simple but powerful:
- For every $x$ in the domain, there exists one and only one $y$ in the range.
- This is why it is correct to say:
- All functions are relations (they are sets of ordered pairs).
- Not all relations are functions (some relations assign two different outputs to the same input).
Function Notation Describes The Output From An Input
- A function is often written as $f(x)=y$, read as "$f$ of $x$ is $y$".
- $x$ is the input
- $y$ is the output
- $f$ is the name of the function
- Another common notation is $f: x\mapsto y$, which emphasizes the mapping idea.
- When you see $f(x)$, treat it as a single object meaning "the output when the input is $x$".
- It is not multiplication of $f$ and $x$.
Testing Whether A Set Of Ordered Pairs Is A Function
If a relation is listed as ordered pairs, it is a function if no input value repeats with a different output.
- Is $\{(1,2),(2,5),(1,7)\}$ a function? No.
- The input $x=1$ maps to both 2 and 7.
- One input producing two outputs breaks the function rule.
Graphs Reveal Functions Visually
When a relation is drawn on a coordinate plane, the domain corresponds to the $x$-axis and the range corresponds to the $y$-axis (often written $y=f(x)$ for functions).
The Vertical Line Test Matches The Function Definition
A graph represents a function if and only if every vertical line intersects the graph at most once.
Why this works:
- A vertical line fixes a single input value $x$.
- If that vertical line hits the graph twice, then that same input has two different $y$-values, so the relation is not a function.
- In tests, the vertical line test is often the fastest way to decide if a drawn relation is a function.
- Do not confuse it with the horizontal line test, which is used to decide if a function is one-to-one (important for inverses).
- The relation $y=4x-9$ is a function because for every $x$ there is exactly one value of $y$.
- Its graph is a straight line, so any vertical line crosses it only once.
- It is also a one-to-one function: different inputs give different outputs (the line is not horizontal).
Pick two different inputs:
- If $x=0$, then $y=-9$.
- If $x=1$, then $y=-5$.
The outputs are different, which is consistent with one-to-one behavior.
- A straight line can fail to be one-to-one if it is horizontal (for example $y=3$), because many different $x$-values all give the same output.
- That is still a function, but it is many-to-one.
Connecting The Representations Builds Stronger Understanding
The "function rule" looks different in each representation, but it is the same idea:
- Mapping diagram: each input dot has exactly one arrow leaving it.
- Ordered pairs: no $x$-value is paired with two different $y$-values.
- Graph: passes the vertical line test.
These tests are all equivalent because they all check the same condition: whether a single input can produce more than one output.
- For each relation, state whether it is a function and justify your answer.
- $\{(2,1),(3,1),(4,1)\}$
- $\{(0,5),(0,7),(2,9)\}$
- For each equation, decide whether it defines $y$ as a function of $x$.
- $y=x+2$
- $x^2=y^2$ (Hint: solve for $y$)
- Give one real-life example of a relation that is not a function.