FunctionsRelations and Functions
Welcome to the Hoctagon School of Magic! You’ve taken the train from King’s Cross station in London, a boat across the great lake in front of the castle, and just arrived in the great hall with all the other students.
But before the welcome feast can begin, the Sorting Hat has to assign all new students to a house. Try sorting each of these students into one of the four house:
Image
After dinner, all students return to the common rooms of their new houses. Everyone settles into their dorms and returns to the common room to meet their new housemates. Heads of houses use this time to pass out class lists. Like before, connect each of the students with different classes:
The next day, you and several of your classmates arrive early to your first lesson. Conversation quickly turns to your new wands. You trade stories about how the wands chose you. Connect each of these wands to a student.
In all of the examples above, there were two groups of things (like students, houses or wands), which you had to connect to each other.
In mathematics, we call groups of things like this
A connection between two sets is called a
| Houses | Classes | Wands |
|---|---|---|
There are many ways we can represent the same relation between sets. So far we have been using mapping diagrams. We can also represent the same information using a table. The sorting hat mapping diagram is shown in the table below.
TODO Interactive here
We can also use ordered pairs to show this relationship. The first value in an ordered pair is from the input set. The second value is from the output set.
({{Current User Name}}, Lionpaw) (Phineas Lynch, Lionpaw) (Sturgis Switch, Eaglewing) (Dilys Derwent, Badgerclaw) (Demelza Zabini, Serpentfang) (Bogod Clearwater, Serpentfang)
Domain and Range
You can think of relations as an operation: you pass in an item from the set on the left, and you get items from the set on the right as an output. Consider this relation:
| Input | | Output | |
| |
| | 14 | | even | | 3 | | odd | | 11 | | odd | | 6 | | even | | -6 | | even |
The input set for the first example is {14, 3, 11, 6, -6}. Note that these numbers don’t have to be in order from least to greatest. The output set for this example is {even, odd}. Notice the elements even and odd are not repeated.
These input and output sets have special names. The complete set of all possible inputs is called
TODO Interactive here
Coordinate Systems
We have been using mapping diagrams, coordinate pairs, and tables to represent relations. Graphs are another way to visualize relations. We can note a few interesting things when we look at relations on the
Let’s plot the relation {(0,0), (1,4), (-5,3), (-2,-1), (4, -3)} on the coordinate plane. Two points are already on the graph.
TODO Interactive here
TODO Tutor prompts here
Let’s look at the graphs of the relations we have been working with so far. Notice how the mapping diagram relates to the graph. The axes in the coordinate plane below take names other than x and y, the variables we’ve seen before. This graph, for instance, includes a name- and a house-axis.
TODO Interactive here
Using coordinate systems, it is also very easy to check whether a relation is many-to-many, or one-to-many. The many-to-one and many-to-many graphs have
Go through the coordinate system from left to right, and check if there are any two points connected by a vertical line. This means that they share the same x-value, so the relation is not many-to-one. This is called the vertical line test. The graphs that share an x-value seem like they could have a vertical line that connects
TODO Interactive here
Functions
In math, relations that are one-to-one or many-to-one are particularly important, and we will see many more examples in later chapters. That’s why they have a special name: Functions. A
Let’s return to the Hoctagon relations. Using the definition of function, select the relations that are functions.
TODO Interactive here
We can think of functions as machines. Let’s look at the sorting hat machine to see how it works.
TODO Interactive here
Every function needs to have a name. Function notation tells us the name of the function, the input value, and the rule that gives us the output value.
Let’s say a function, we’ll call f, put top hats on inputs.
IMAGE
If we are given, f(🙊), we know the output is INSERT IMAGE. Similarly, if we know f(x)= INSERT IMAGE , we know the x is 🦊.
| Function Name | | Input Value | = | Output Value | |
| |
|
|
| | f | | (x) | = | value or expression|
Let’s use this pattern to describe the sorting hat function.
sortinghat(first year name) = house name
From the function notation above, we know that putting the sorting hat on a first year shows what house the first year is sorted into. This pattern is important to remember. The notation and expressions opposite the function name can sometimes distract us from remembering how to read function notation.
sortinghat({current user name}=
sortinghat(Sturgis Switch) =
Now let’s try some examples with algebraic expressions. Let x=2 and f(x)=50-3x, find f(2).
TODO optional text for incorrect answers
Here are a few more function machines. Can you work out what the rule is in each case?
TODO Interactive here
Just like before, we can visualise functions in a coordinate system. The value along the horizontal x-axis represents the input, and the value along the vertical y-axis represents the output.
TODO Interactive here
A domain and range may include more elements than those listed. We have to think about what would make a complete list of all inputs or outputs. For each of these examples, drag the numbers into the groups “possible input” or “impossible input”.
TODO Interactive here
Look at the graphs of the functions. Determine what outputs make sense and why.
TODO coordinate plane
The graph only appears in the
TODO coordinate plane
The lowest y-value on the graph is about