Category: Functions Level: 201
function: each input has exactly one arrow out
Draw the inputs in one oval and the possible outputs in another, then draw an arrow for each pair. A function sends exactly one arrow out of every input. On a graph this becomes the vertical line test.
Put the inputs in the left oval, the domain. Put the outputs we allow in the right oval, the codomain. The rule is: square it.
domain {-2, -1, 1, 2}, codomain {1, 4, 9}
Each input gets one arrow to its square. Two inputs may share an output: −2 and 2 both go to 4. That is fine. A function only forbids one input with two outputs.
-2 → 4, -1 → 1, 1 → 1, 2 → 4
The range is the outputs that actually get hit: 1 and 4. Nobody sends an arrow to 9. It sits in the codomain, unused, like a spare chair.
range = {1, 4} ⊂ codomain
Now pair each x with every y where y² = x. The input 1 sends arrows to 1 and −1, and 4 sends arrows to 2 and −2. Two arrows from one input: not a function.
1 → ± 1, 4 → ± 2: two outputs, so no function
Plot each arrow as a point (input, output). A vertical line x = 1 picks one input. It hits y = x² once, but it hits y² = x twice. One hit means function.
vertical line test: at most one hit per vertical line
cd svg-generator python3 -m svgmath render mapping-diagram --out /tmp/mapping-diagram
Source: svgmath/diagrams/function_basics.py