CEMC Banner

Grade 6 Math Circles
Intro to Functions

What is a Function?

A function performs an action on an input to produce an output.

We could define a function that makes “_____ pie,” where the blank is filled with a type of pie filling as an input. Inputting “apple” would give us “apple pie,” and inputting “pumpkin” would give us “pumpkin pie.” However, we would not be able to use “book” as an input, because it is not a pie filling!

Additionally, a function only produces one output for each input. So, with the pie function above, inputting “blueberry” can only produce one kind of pie: “blueberry pie.”

Mathematically, functions are written like this: \(f(x)\). The letter \(f\) is the name of the function, and \(x\) is the name of the variable. In math, a variable is a placeholder for a number, like the blank line in our pie function is a placeholder for a pie filling. Variables behave the same way that a number would: you can add, subtract, multiply, divide, and do exponential operations with them. Note that when a number and a variable are directly beside each other, this signifies multiplication.

Example 1

These mathematical expressions with a variable are also examples of a “rule” that a function could follow. A number goes into the function as the input, and the function follows this given rule to produce an output based on the value of the input.

As with our pie function, the function \(f\) should only be able to produce one output for each input value of \(x\).

Example 2

Let’s set the rule to be \(f(x)=x+3\). That means that:

If we have \(x=0\), then \(f(x) = f(0) = (0)+3 = 3\).

If we have \(x=1\), then \(f(x) = f(1) = (1)+3 = 4\).

If we have \(x=2\), then \(f(x) = f(2) = (2)+3 = 5\).

And so on, for any number \(x\) that we use as an input.

You’ll most commonly see \(f\) used as the function name and \(x\) used as the variable, but you can use any symbol to represent the function name and the variable. For example, we could have \(g(x), F(a), r(t)\), or \(g(\alpha)\).

Question 1

Let \(g(x)=2x+1\). Calculate \(g(0), \,g(1), \,g(2)\), and \(g(10)\).

Solution:

\(g(0) = 2(0)+1 = 0+1 = 1\).

\(g(1) = 2(1)+1 = 2+1 = 3\).

\(g(2) = 2(2)+1 = 4+1 = 5\).

\(g(10) = 2(10)+1 = 20+1 = 21\).

Question 2

Let \[h(a) = \begin{cases} a+1 & \text{if $a$ is odd.} \\ a\div2 & \text{if $a$ is even.} \\ \end{cases}\]

Calculate \(h(a)\) for \(a = 0, \, a = 1, \, a = 2, \, a = 3, \, a = 4, \,\) and \(a = 5\).

Solution: Like before, for any value of \(a\), we input the number into the function \(h\) to calculate \(h(a)\).

Since 0 is even, \(h(0) = (0)\div2 = 0\).

Since 1 is odd, \(h(1) = (1)+1 = 2\).

Since 2 is even, \(h(2) = (2)\div2 = 1\).

Since 3 is odd, \(h(3) = (3)+1 = 4\).

Since 4 is even, \(h(4) = (4)\div2 = 2\).

Notice that each input value only produces one output value, but the outputs from different input values can be the same.

Number Systems

A number system is a set of numbers. In particular, we will be using the following sets in this lesson:

Sometimes, we will want to express that an input or output to a function must be an element of a set. If we have a variable \(x\) for example, we might use the symbol \(\in\) (“is an element of”) to write \(x \in \mathbb{R}\), meaning that “the value of \(x\) must be in the set of real numbers.” To further specify the set of numbers that a value must belong to, we can use symbols such as \(=, \neq, <, \leq, >, \geq\), and \(\notin\) (“not an element of”).

Example 3

“The set of natural numbers less than or equal to ten” can be written as \[\{n \in \mathbb{N},\, n \leq 10\}\] for variable \(n\). It can also be written as \[\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}.\]

“The set of real numbers strictly greater than zero” can be written as {\(x \in \mathbb{R},\,x > 0\)} for variable \(x\).

“The set of non-whole real numbers” can be written as \(\{\lambda \in \mathbb{R},\, \lambda \notin \mathbb{Z}\}\) for variable \(\lambda\).

“The set of integers, except zero,” can be written as \(\{a \in \mathbb{Z},\,a \neq 0\}\) for variable \(a\).

Overall, it’s worth noting that descriptions of a function’s domain or set don’t always have to be in mathematical notation. It’s perfectly okay to use words!

Domain

The domain of a function is the set of all possible values that can be inputted into a given function to produce a defined output.

Thinking back to the pie function, the function “ pie” only accepts inputs that are pie fillings. Thus, the domain is simply {all pie fillings}. For inputs outside of this domain, there is no rule in the function to produce a defined output.

Example 4

Let \[t(\alpha) = \begin{cases} 1 & \text{if $\alpha = 10.$} \\ 2 & \text{if $\alpha = 15.$} \\ \end{cases}\]

If we input 10, we have \(t(10)=1\), and if we input 15, we have \(t(15)=2\).

However, notice that if we try to input any other value of \(\alpha\), the output of \(t(\alpha)\) simply isn’t defined! For example, there is no defined value of \(t(25)\) or \(t(1)\) or \(t(0)\). Thus, the only possible values of \(\alpha\) are 10 and 15, and so the domain of \(t\) is {10, 15}.

An important note is that in mathematics, you cannot divide by zero. Any fraction \(\frac{x}{0}\), where \(x \in \mathbb{R}\), is undefined. For example, there is no value assigned to \(\frac{1}{0}\); you simply cannot perform this calculation, because it doesn’t make any sense!

Example 5

Let \(r(z)=\frac{1}{z}\). That means that:

If we have \(z=4\), then \(r(z) = r(4) = \frac{1}{(4)} = 0.25.\)

If we have \(z=0.5\), then \(r(z) = r(0.5) = \frac{1}{0.5} = 2.\)

However, if we have \(z=0\), then \(r(z) = r(0) = \frac{1}{0},\) which is undefined.

The number zero is not a valid input to \(r(z)\), and it is also the only number that is not a valid input to \(r(z)\). You can divide one by every other real number. (Why?)

Thus, that gives us a domain of all real numbers except for zero. We can also express this domain as {\(z \in \mathbb{R}, \,z \neq 0\)}.

When working with functions that have a variable as a divisor or in the denominator of a fraction, it is important to remember that you cannot divide a number by zero. An important step in determining the domain of a function is specifying (and excluding) all input values that would result in division by zero.

Question 3

Let \(I(x) = \frac{2}{x-5}\). Determine the domain.

Solution: Since this function has a variable in the denominator of a fraction, we need to determine what value(s) of \(x\) would result in attempted division by zero. The denominator is \((x-5)\), so \(x=5\) would result in a denominator of \((5)-5 = 0\).

Thus, the domain of the function \(I(x)\) is {\(x \in \mathbb{R}, \,x \neq 5\)}.

Range

The range of a function is the set of all possible outputs from a function and domain. Thinking back to the pie function one last time, given that the domain is {all pie fillings}, we can say that the range is {all pies}.

Example 6

(continuation of Ex. 5)

Let \[t(\alpha) = \begin{cases} 1 & \text{if $\alpha = 10.$} \\ 2 & \text{if $\alpha = 15.$} \\ \end{cases}\]

From Example 5, we know that the domain of \(t\) is {10, 15}. With this function and domain, the only possible outputs are 1 and 2.

Thus, the range of \(t\) is {1, 2}.

Question 4

Let \(s(p) = p^2\). What are the domain and range of \(s(p)\)?

Solution: There are no values of \(p\) that would cause \(s(p)\) to be undefined, so the domain is simply \(\mathbb{R}\).

For any value of \(p \in \mathbb{R}\), if you square it, it becomes non-negative. In fact, it’s impossible to have a value of \(s(p)\) that is negative! Thus, the range is {all non-negative real numbers}, or \(\{s(p) \in \mathbb{R}, s(p) \geq 0\}\).

Question 5

A submarine is diving into the ocean at a rate of 18 metres per minute, starting at the ocean surface with a depth of 0\(m\). A submarine that is 90\(m\) underwater would have a depth of \(-90m\). Express the depth of the submarine as a function of the number of minutes it has spent diving. What are the domain and range of this function?

Solution: We’ll use \(D\) as the function name (to represent “depth”), and \(t\) as the variable name (to represent “time”). At \(t=0\), the submarine is at the ocean surface, so \(D(0) = 0\). For each minute, the submarine dives another 18 metres. Thus, we have the function \(D(t) = -18t\) to calculate the submarine’s depth as a function of time.

To find the domain, we consider what values of \(t\) are valid. Any non-negative amount of time makes sense (whereas a negative amount doesn’t), since there is no theoretical maximum number of minutes that the submarine could spend diving. The value of \(t\) could be any non-negative real number. Thus, we have the domain \(\{t \in \mathbb{R}, t \geq 0\}\).

To find the range, we can then consider what values of \(D(t)\) are possible given the function and domain. Since we have established that \(t \geq 0\), the value of \(D(t)\) cannot be positive—you would need a negative value of \(t\) for \(D(t)\) to be positive. Thus, we have the range \(\{D(t) \in \mathbb{R}, D(t) \leq 0\}\). This makes sense in the context of the questions as well; you can’t dive in a submarine and end up floating above the water!