A function is a relation between a set of inputs (called the domain), and a permissible set of outputs (called the codomain), such that each input is is related to exactly one output. We often denote a function on 1 variable by . When is an element of the domain, we say that the output has the value .
Note that the domain, and codomain, need not always be the set of real numbers. Other common sets that are used are the complex numbers, positive integers, people, matrices, graphs, etc. For example, we can have a function , which given the name of a Brilliant student, tells us the country that the student is a citizen of. In this case, the domain is the set of names of Brilliant students, while the codomain is the set of countries. In order for this to be truly a function, we must make the assumption that a student is a citizen of only 1 country. In order to deal with the possibility of dual citizenships, we must add pairs of countries to our codomain.
We can certainly add irrelevant items to the codomain, like {alligator}, {purple} and {Calvin}. As such, we define the range of a function (also called the image) to be the set of all outputs. Note that by definition, the range of a function has to be a subset of the codomain.
The mathematical shorthand (since mathematicians are lazy) to state that is a function from set to set is . For example, since stands for complex numbers, and stands for integers, stands for positive integers, so refers to a function from the set of complex numbers to the set of positive integers. Because we mainly deal with functions of real numbers, if the domain and codomain are not explicitly stated (or immediately obvious from the setup), they are assumed to be the set of real numbers,
While it is common for the domain and codomain to be the same set, it is important to make a clear distinction between the two. The identity function is the unique function on a set, which maps every element to itself. We denote this function be , where for all elements of .
If we were to change the domain of a function, then we will get a different function. For example, is a very different function from . This is because we have , while does not make any sense. As such, we say that 2 functions and are equal if and for all values in , . The codomain is less important, since by our previous observation we can add arbitrary elements to it while not affecting the essence of the function.
Given a function and any subset , we say that the image of is the set of all values , where is an element of . Given a subset , we say that the preimage of is the set of all values where is an element of . Using this terminology, we say that the range is the image of the domain. Essentially, the range is the part of the codomain that we really care about, which is why we will like to restrict our attention to just the range.
When the domain is the set of real numbers, we like to think of as the graph of the function. Conversely, given any graph, it is a function if each x-value corresponds to at most 1 y-value. Such a graph must pass the vertical line test: Every vertical line cuts the graph in at most 1 point.
What if we want to find all possible inputs, which give a certain output? For example, if I want to know who are all the Brilliant students that are citizens of India, I am asking for the list of students who satisfy India. The inverse of a function, need not always be a function (as in this example). In order for an inverse to be an actual function, the original function needs to pass the horizontal line test: Every horizontal line cuts the graph in at most 1 point.
If the inverse is a function, we denote it as . What is the domain and codomain of ? Can we take the inverse of any value in the codomain? We certainly could, though it might not make sense. For example, would not be valid. As such, we often restrict our attention to simply the range of the original function (which, as you recall, is the image of the domain). What is the codomain of the inverse? It would be the pre-image of the range. Note that the pre-image of the range need not be the entire domain of .
In the event that the inverse is not a function, we can restrict our attention to a subset of the domain. Specifically, if , and , we define the function as for all values in . For example, the function given by does not have an inverse function because it doesn't satisfy the horizontal line test. However, since does satisfy the horizontal line test, it has an inverse. In this case, we know that .
A function is injective (or one-to-one) if for any 2 distinct elements in the domain. A function is surjective (or onto) if for every element in the codomain, there exists an element in the domain such that . A function is bijective if it is both injective and surjective. With this terminology, an injective function has an inverse that is a function. A bijective function has an inverse (which is a function by the previous observation) whose domain is .
Now that we've build up this vocabulary, we can talk about the composition of functions. You may not always be able to compose 2 functions. For example, will not make any sense, no matter what we try to do. Let's understand how to make composition of functions work.
Assuming that we have 2 functions to be a function, , when does make sense? Given any value in the domain A, we must be able to apply to the value . Hence, this implies that must be a subset of . With this condition, we can define to be equal to . Note that the order of composition is important, since we might not be able to define , unless we further know that is a subset of .
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
There are no comments in this discussion.