Weir the Chain-Linker
COMPOSITE FUNCTIONS — feeding one function's output into another as its input; f(g(x)) runs g first, then f, and the order of the chain changes the result.
A story read by Weir the Chain-Linker
Loading audio…
Press play to listen along. The line being read lights up as you go.
Show full transcript
Loading transcript…
Weir was a millwright's daughter, and she grew up building the stepped watercourses that carried a stream down a hillside to turn the mill.
A watercourse like that is not one drop of one channel. It is a chain of pools, each held back by a low stone wall — a weir — with the water spilling over each wall into the pool below. The water that leaves the top pool is the very same water that enters the second pool. What pours out of the second becomes what pours into the third. Out of one, into the next, all the way down to the wheel.
Weir understood, before she had words for it, that the output of each step was the input of the next. You could not think about the pools one at a time and separately. They were linked. Change the top pool, and every pool below it changed too, because each one was fed by the one above.
"Every wall pours into the next," she would say, watching the water step down the hill. "Whatever leaves here, arrives there. That's a chain."
What Weir came to see, rebuilding watercourse after watercourse, was that the order of the pools decided everything. A course that dropped the water then narrowed it behaved nothing like a course that narrowed it then dropped it. Same two steps. Different order. Different water at the bottom.
She tested it on a small model in the yard — two little weirs she could swap. Water down-then-through came out one way; water through-then-down came out another. The steps were identical. The order in which the water met them was not, and that was enough to change where it ended up.
She had no idea this had a name in the world of numbers.
When she was older, the FunctionForge academy, which wanted someone who understood how one rule could feed another, sent for her. Weir left the mill to her brother and went.
At the academy she taught the children how to chain functions together.
"Here are two rules," she said, and wrote them up. "g(x) = x + 1, which adds one. And f(x) = 2x, which doubles." She drew a little weir between them. "A composite pours one into the other. f(g(x)) means: run g first, then let its output spill into f."
She worked it. "Start with 3. Pour it into g: three plus one is four. Now that four spills into f: double it, eight. So f(g(3)) = 8." She drew the water stepping down. "Out of the first, into the second."
"Now watch what the order does," she said, and swapped the walls. "g(f(3)) — run f first. Three doubled is six. Then spill into g: six plus one is seven." She underlined both. "Same two rules. Eight one way, seven the other. The order of the chain changed the answer."
"So it matters which pool comes first," said a boy.
"It nearly always matters," said Weir. "A composite is a chain of rules, each pouring into the next — and which one you pour into first can change where the water ends up. Read the chain from the inside out: the rule tucked closest to the number goes first."
She still visits the old mill when the academy lets her, and still cannot pass a stepped stream without watching how each pool feeds the one below.
The thing Weir hopes the children carry is that steps are not islands — that what you do first flows into what you do next, and the order of a chain can decide the whole outcome. Chains are everywhere, and reading them from the inside out is how you keep from being surprised at the bottom of the hill.
"Follow the water," she tells them. "Out of one, into the next. The rule nearest the number goes first, and the order is the whole of it."
When the hall empties, Weir sketches a little chain of pools in the corner of the board out of habit, and feels the flowing, linked-up gladness she first felt on the hillside as a girl: that nothing she built ever stood alone, and that a well-made chain carries whatever you give it, faithfully, all the way down.
The FunctionForge ensemble
Weir the Chain-Linker is part of FunctionForge's distributed-narrative cast. Each character embodies a different curricular primitive; together they teach the full subject.
-
Stride the Pattern-Walker
Linear functions (constant rate of change)
-
Echo the Sameness-Keeper
Constant functions (zero rate of change; output unchanged regardless of input)
-
Arc the Curve-Catcher
Quadratic functions (parabola — symmetric rate-of-change-changes)
-
Burst the Doubler
Exponential functions (constant *multiplicative* rate of change)
-
Pivot the Rule-Switcher
Piecewise functions (different rules for different input ranges)
-
Rewind the Step-Reverser
Inverse functions (undoing a rule step-by-step to recover the original input)
-
Roundel the Round-Returner
Periodic functions (a pattern that repeats at a fixed interval)
-
Sill the Threshold-Keeper
Domain and range (which inputs are allowed and which outputs can appear)
-
Vale the Valley-Folder
Absolute value (folding the number line at zero so distance is always positive)