Functions
You have most likely seen functions before. They are a fundamental concept in mathematics and are also often seen in the real world. Functions describe relationships between things. For example, the cost of something might be a function of the number of items bought or the distance you travel might be a function of the time and speed you travel at.
To be more formal and precise a function is a relation between two sets. The first set is the input set, also called the domain, and the second set is the output set, also called the codomain. We then also provide a rule that assigns each element in the domain to exactly one element in the codomain.
Where is the rule that assigns each element in the domain to an element in the codomain. For example we can make define the following rule:
Above we have a function that maps the elements in the set to the elements in the set . The rule that assigns each element in the domain to an element in the codomain is , which means that each element in the domain is mapped to in the codomain. The subset of elements in the codomain that are actually mapped to are called the range of the function. So the range for the function is .
Not every relation is a function. A relation is a function if each element in the domain is mapped to exactly one element in the codomain.
The relation on the right is not a function because the element in the domain is mapped to two elements in the codomain, and , which would make the function ambiguous. It is also not a function because the elements and in the domain are not mapped to any element in the codomain.
Important is also to notice that a function can have multiple input elements map to the same output element, but not the other way around. An example of such a function is where both and are mapped to .
You may however have seen functions written in different ways. The function above could also be written as:
In the above example the domain and codomain are not explicitly defined. The domain and codomain is often assumed to be the set of all real numbers, unless otherwise specified.
However, depending on the function it is important to remove 0 from the domain. For example, the function is not defined for because of the division by zero.
Therefore the domain of the function must be .
Visualising Functions
Like with everything, visualising functions can help us understand them better.
Value Tables
Show an example with value table
Graphs
show a plot of a function and explain x and y with desmos iframe. Also show the meaning of y-axis cutoff and slope. and the meaning of a slope and y-axis when drawing ie the steps and where the line crosses the y-axis.
Formally the graph of the function is the set of all points where :
Where is the graph of the function and each point is a point on the graph.
The number of elements in the tuple corresponds to the number of dimensions of the function. For example, a function is a 2-dimensional function and can be visualised in a 2-dimensional plane. A function is a 3-dimensional function and can be visualised in a 3-dimensional space.
Linear vs Non-Linear Functions
for example polynomial functions, exponential functions, logarithmic functions, trigonometric functions, etc.
Functions vs Equations
What is the difference between function and equation.
Properties of Functions
Injective
A function is injective or one-to-one if each element in the domain is mapped to a unique element in the codomain, i.e no two elements in the domain are mapped to the same element in the codomain. Because each element in the domain is mapped to a unique element in the codomain, the function is one-to-one so i.e each unique element in the domain is mapped to a unique element in the codomain. More formally, a function is injective if:
or equivalently the contrapositive:
Visually there are no two points on the graph of the function that have the same y-coordinate. This also means that because each element in the domain is mapped to a unique element in the codomain.
Surjective
A function is surjective or onto if each element in the codomain is mapped to by at least one element in the domain, i.e the range of the function is equal to the codomain. More formally, a function is surjective if:
Visually there are no points on the graph of the function that are not mapped to by an element in the domain. This also means that because each element in the codomain is mapped to by at least one element in the domain.
Bijective
A function is bijective if it is both injective and surjective. This means that an element in the domain is mapped to precisely one element in the codomain and all elements in the codomain are mapped to one element in the domain.
More formally, a function is bijective if:
Visually there are no two points on the graph of the function that have the same y-coordinate and there are no points on the graph that are not mapped to by an element in the domain. This also means that because each element in the domain is mapped to a unique element in the codomain and each element in the codomain is mapped to by an element in the domain.
Composition of Functions
Inverse Functions
must be bijective