Introduction to Functions

by mrichard, Oct 30, 2018, 4:51 AM

Previously, we talked about sets. Once we have these basic objects, we can start to create, define, and communicate relationships and patterns between sets. Mathematics uses the language of a function to describe these relationships.

Most simply, a function is a rule that takes elements on one set (often called inputs) and assigns them to elements of another set (often called outputs.) The one rule to remember to make sure you have a proper function is a function only has a single output for each input.

Let's look at a simple example of a function.

There are many notations used to discuss functions. The most common, and the one used throughout this blog, will be the form $f: A\to B$. We call $f$ the function, where it takes elements from the set $A$ and assigns them to elements in the set $B$.

So, we could call the function from our example $g: S\to F.$ While the letter used to name the function can be arbitrary, it is common to use $f$, $g$, or $h$ if no other information is given.

It is good to have a common language to describe the sets $A$ and $B$ in the context of a function.

Definition

Let's consider the function $g:S\to F$ from before. We say that $S$ is the domain, and $F$ is the codomain.

Imagine you wanted to tell a friend that our function $g$ took the input $2$ and assigned it to strawberries; however, you don't want to copy down the list of rules we had each time! This may not seem like a big deal, but imagine you had a domain with $1{,}000$ elements. We'd need an easier notation for these situations!

The accepted notation to tell our friends that $g$ sends $2$ to $\text{strawberries}$ is
$$g(2) = \text{strawberries}.$$This is most commonly read as "$g$ of $2$ equals $\text{strawberries}.$"

This notation is very flexible, as it allows us to have more than one element as the input. For example, since the subset $\{1,3\}\subset S$ has elements assigned to $\{\text{bananas},\text{apples}\} \subset F,$ we can say
$$g(\{1,3\}) = \{\text{bananas},\text{apples}\}.$$Remember that a set does not have its elements in a specific order, so we can also write
$$g(\{1,3\}) = \{\text{apples},\text{bananas}\}.$$Given just the above, we cannot tell exactly what $f(1)$ and $f(3)$ are; if we need to communicate that information, we can list them. But there are many situations where you just need to know if a particular element (very frequently $0$ or $1$) is among the outputs of a set of inputs.

Definition

As noted before, given the function $f:A\to B$, there is no guarantee that every element in $B$ is actually an output of the function! We are only guaranteed that $B$ contains every output. So, it is then natural to wonder what exactly $f(A)$ is. Since $A$ is the domain (i.e. the set of all possible inputs) of $f$, every element in $A$ is assigned to some element in $B$. So, $f(A)$ must be a subset of $B$, and in particular is the set that contains all possible outputs of the functions, and no extra elements.

Definition

Since all possible outputs must exist in the codomain $B$, for any function $f:A\to B$ we must have $f(A)\subset B.$

Here is another example.

It is also good to note that a function can assign different inputs to the same output!

Here is a function where the codomain only has one element.


Questions

Consider the function $g:\{1,2\}\to \{1,2,3\}$ defined by $g(1)=3$ and $g(2)=1.$

What is the cardinality of this function's domain?

What is the codomain of the function?

What is the image of the function?

Consider another function $h:\{1,2\} \to \{1,2,3\}$.

How many ways can we define this function so that every input is sent to a different output?

Consider a function $\iota: \{1\} \to A.$ Suppose $|A| = n.$

How many ways can we define this function?

Comment

0 Comments

For those who see AoPS posts and think "Wow. That's a bit scary."

avatar

mrichard
Tags
About Owner
  • Posts: 17840
  • Joined: May 22, 2017
Search Blog
a