In a question sheet for my university course I am given the sets:
$A = \{1, 2, 3, 4\}, B = \{x, y, z, w\}$ and $C = \{a, b, c\}$.
I am then told to work out the functions:
- $f: A → B$ which is defined by $f(1) = y, f(2) = w, f(3) = z, f(4) = x$.
- $g: C → A$ which is defined by $g(a) = 2, g(b) = 3, g(c) = 4$.
- $h: A → C$ which is defined by $h(1) = a, h(2) = c, h(3) = a, h(4) = b$.
The ordered pairs of these functions is:
- $f: A → B = \{(1, y), (2, w), (3, z), (4, x)\}$
- $g: C → A = \{(a, 2), (b, 3), (c, 4)\}$
- $h: A → C = \{(1, a), (2, c), (3, a), (4, b)\}$
The above is easy enough but I am then asked to find the composition of these functions. The actual process of doing the composition seems easy enough but deciding which domains/codomains are mapped to each other confuses me. The answers are provided by the sheet I'm working from as:
- $f ∘ g: C → B$
- $g ∘ h: A → A$
- $h ∘ g: C → C$
What is considered when choosing what the domain/codomain maps to? Also, take $f ∘ g$ for example. Why is g's domain used first when it makes sense that $f$ is first so shouldn't $f$'s domain be used?
Best Answer
By definition, the composite function $(f \circ g)(x) = f(g(x))$. This means that you apply $g$ first, and $f$ second, as in the following diagram:
$$C \xrightarrow{g} A \xrightarrow{f} B $$
So if $g:C \to A$ and $f:A \to B$, the composite $f \circ g:C \to B$.