Section 10.4 Composition of functions
- composition function
Warning 10.4.3. Composition order matters.
The notation for the composition of functions and involves a reversal of order, so that we write This is so that when we use this notation with input-output notation the notation reminds us that must first be applied to the input and then is applied to the result
In general, Usually, one of the two is not even defined, because domains and codomains of and will not necessarily match up in both orders. And when both are defined, the two different orders of composition usually have different domains and codomains.
Example 10.4.4. Comparing composition order.
Example 10.4.5. An undefined composition.
Checkpoint 10.4.6. Properties of compositions.
Of course, we can compose any number of functions.
Example 10.4.7. A composition of three functions.
Let us reconsider the function defined by algorithm in Example 10.1.5. As the function description involved a multi-step algorithm, we should be able to break the steps involved into their own functions, then recreate the original functions as a composition.
Each of these functions represents one step in the algorithm defining the function in Example 10.1.5, but to recreate that function we need to compose the functions in the correct order: write so that