Example 15: Computing on finite sets
Let and be functions defined as , , and and . Find .
.
Want the reason behind every step, the basics and the checks?
The composition (also written ) means "first apply , then apply to the answer": . It is defined because the set where lands, , is exactly the set where starts. With finite sets there is no formula to simplify: we just follow two arrows for each of the four elements of the domain, one element at a time.
- Given
- , , . The function is listed value by value, and so is .
- To find
- The function , that is, its value at each of the four elements .
- Plan
- (1) Check that makes sense (the codomain of equals the domain of ). (2) For each , read off , then read off of that value. (3) Collect the four answers and describe the function we get.
Basics you need
A function assigns to each element of exactly one element of . When is finite, we can define completely by listing for every . No formula is needed. Basics: what a function is
For , is the domain (allowed inputs) and is the codomain (where outputs are allowed to land). Not every element of has to be used. Basics: sets and ordered pairs
If and , then is defined by for every . The function written nearer to acts first. Basics: functions
One-one: different inputs give different outputs. Onto: every element of the codomain is an output. Basics: one-one and onto
Solution
Check that is defined
goes from into , and starts from the same set . So every output is an element of , and can be applied to it. Hence is a function from to :
Blue arrows are , gold arrows are . To find , start at on the left and follow one blue arrow and then one gold arrow. The element 9 of and the element 15 of are never reached. Composition only makes sense when the second function can accept every output of the first. If could produce a value outside the domain of , then would have no meaning for that . Here 's codomain and 's domain are the same set, so there is nothing to worry about. This is exactly the setting of Definition 8.Compute and
Work from the inside out: first the inner value , then of it.
The bracket tells us the order. We cannot evaluate until we know what it is being applied to, and that is . From the list, ; then from 's list, . The same two look-ups give and .Inner function first: in , acts on and acts on the result. This is the usual rule for nested brackets, the same as working out by adding first.Compute and
(The textbook shortens the last line to , because .)
The question gives : two inputs share the output 5. Whatever does to 5, it does once, so and must be equal. Note that the value is never used, because no element of is sent to 9 by .A function may send different inputs to the same output (here ). It may not send one input to two outputs. That is why has the single value 5 and the look-up is unambiguous. Basics: what a function isCollect the answer
Putting the four values together:
2 3 4 5 3 4 5 5 7 7 11 11 So , , , . As a set of ordered pairs,
The same information as a single function from to : the middle set has disappeared. Each green arrow is a blue arrow followed by a gold arrow from the previous figure. A function on a finite set is completely known once its value at every element of the domain is known (Basic 1). We have all four values, so has been found in full. The middle set is only a stopping point; it does not appear in the answer.What kind of function is ? (an extra look)
The book does not ask this, but it is worth seeing what the composite inherits.
- is not one-one: with .
- is not onto : the range of is , and is not an output.
- Neither is one-one () or onto (nothing goes to 9), and is neither one-one () nor onto (nothing goes to 15).
Also, the other order is not defined here: outputs 7 or 11, and these are not in the domain of , so has no meaning.
Each claim is settled by the lists themselves. "Not one-one" needs one pair of different inputs with equal outputs, and is such a pair. "Not onto" needs one element of the codomain that is never hit; since only ever produces 7 and 11, the element 15 is never hit. The remark about shows that composition depends on order: one order can be defined while the other is not.To disprove "one-one" or "onto", one explicit counterexample is enough. Basics: proving and disproving
is given by that is, This agrees with the textbook's solution.
Count the two-step paths in the first figure. From 2: . From 3: . From 4: . From 5: . There are exactly four paths, one from each element of , and they end at . The verification script also rebuilds and as dictionaries and composes them by computer, getting the same four pairs.
- Applying the functions in the wrong order. means : first. Computing instead fails at once here, since is not even defined (2 is not in the domain of ).
- Using somewhere. No element of is sent to 9, so plays no part in .
- Thinking because . Once has merged 4 and 5 into the same value, no later function can separate them.
- Giving as the "answer". The question asks for the function , which means its value at every element of the domain, not just its codomain or range.
- : work from the inside out, one element at a time.
- needs the outputs of to be acceptable inputs for . The reverse composite may not exist at all.
- If sends two inputs to the same place, does too. If misses an element of , so does . Composition can never undo a merge or fill a gap left by the last function.
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| Definition of composition | Steps 1–4 | Definition 8, Section 1.4 (Lesson: composition) |
| The values of and | Steps 2–4 | Given in the question |
| A function is determined by its values on the domain | Step 4 | Meaning of a function (Basics: what a function is) |
| Definitions of one-one and onto | Step 5 | Definitions 5 and 6, Section 1.3 (Lesson: types of functions) |
| All four values and the claims in Step 5 | Result, Check | Recomputed by brute force in the site's verification script |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →