Now that we've learned about relations, we can discuss mathematical functions.

## Functions are Relations

Any mathematical function is a relation - a link between two sets. Consider the connection between the area of a circle \(A\) and its radius \(r\) which is the formula: \(A=\pi{r^2}\)

In this relation, both the radius \(r\) and area \(A\) are the set of real numbers. We put any number \(r\) in the expression to get the corresponding \(A\) value. The radius \(r\) is the domain of the function, while the area \(A\) is the range because it depends on radius \(r\).

## Functions are Input-Output Expressions

Usually, we think of functions as: *"input-output expressions."* It's as if it is a vending machine. We put our money and order into it; then, the device processes it. Finally, the vending machine will give out something in return.

Let's illustrate this analogy using the area-radius example. Say that we're interested in finding the area of a circle \(A\) given a radius \(r\) of one:

- Let the mathematical function between the area \(A\) and radius \(r\) be \(\pi{r^2}\)
- We input radius one into the function: \(\pi\times{1^2}\)
- The function solves it using mathematical operations.
- The function gives us \(\pi\) square units as our output.

## Function Leads Only To One Result

One characteristic of functions is that these must only give one result!

Let's consider the area-radius expression again. If we were given an \(r\) of one into the function, it must only provide one answer: \(\pi\) square units. We don't expect two answers for area \(A\) if we enter a single radius \(r\). That doesn't make any sense.

Let's create a visual diagram called *mapping* to reinforce this idea further.

- The left column is a number line containing all possible radius values, \(r\) (domain).
- The right column is also a number line containing all probable area values \(A\) (range).
- If we link each value using arrows, we'll notice that the mapping arrows of the domain will only point to one entry in the opposite column.

From this example, we can say that a function must follow a "one-to-one" type of relationship.

On a side note, sometimes, we call this single output the *image* (another term for the range element in a function)

A function can also follow a "many-to-one" relationship - many values in the domain only lead to one result in the range. An example of that is the expression for square numbers: \(y=x^2\) where \(x\) is any real number, and \(y\) is the square of said number. To illustrate this, let's take the square of +2, which is +4. In addition, the square of -2 is also +4. In this example:

- The inputs are -2 and +2, \(x\)
- The function is \(x^2\)
- The output is +4, \(y\)

We can have many inputs in a function. The most important thing is that it must lead to only one output.

## Summary

Any mathematical function is a relation.

We think of it as:"input-output expressions."

These must give only one result. It must be a "one-to-one" or "many-to-one" type of relationship.