Pivot the Rule-Switcher chapter opener illustration

Pivot the Rule-Switcher

PIECEWISE FUNCTIONS — different rules for different input ranges. y = f(x) where f varies depending on which interval x falls in.

Chapter 5 — Pivot and the Junction at Threefork

Pivot was, for twelve years, a junction-master.

This is, in the kingdom’s bureaucracy, a specific civil-service title. A junction-master’s job is to stand at a road-fork — specifically, at a major road-fork where two or more roads diverge and the diverging roads lead to meaningfully different destinations — and direct passing traffic to the correct branch.

The kingdom had three major junctions where traffic was busy enough to require a full-time junction-master: Threefork (where the central road split into the north-road, the east-road, and the south-road); Whisp’s Corner (where the southern coast-road split into the harbour-road and the inland-road); and Mason’s Bend (where the western road forked into the highland-road and the lowland-road). The other junctions in the kingdom had part-time signage, but these three had real human beings stationed at them.

Pivot was assigned to Threefork.

He was nineteen when he started. He had been hired by the kingdom’s bureau of roads after a brief examination of his ability to think quickly and speak clearly and handle a small crowd of impatient coachmen without panicking. He was, by Threefork standards, a good fit.

The job worked like this:

A coach approached Threefork. Pivot, who stood in a small wooden booth at the head of the junction, would look at the coach. He would assess: was this a coach he had seen before? (Many were; coachmen travelled their routes repeatedly.) If so, he already knew the destination. If not, he would step out of the booth, walk to the coach, and ask: “Where are you bound today?”

The coachman would say: “Northgate.” Or “Easton.” Or “Southport.” Or, occasionally, “The capital.” Or “I don’t actually know; my mistress just told me to follow this road.” (Pivot would, in that last case, walk the coach to the coachman’s mistress and ask her.)

Pivot would then say: “Take the north fork.” Or “Take the east fork.” Or “Take the south fork.” Or “You want the central road; that is the middle one between the north and east forks; follow the signs marked with the capital’s lion-and-star crest.”

The coach would proceed. The next coach would arrive.

Pivot did this — eleven hours a day, six days a week, for twelve years. He handled, by his own careful count, more than two hundred thousand coaches during his service. He never directed a coach to the wrong road. (The bureau of roads commended him repeatedly. He received, twice, the bureau’s quiet annual Reliable Service citation.)

What Pivot understood — and what made him the teacher he became — was that his job was a function with different rules for different inputs.

If a coach said “Northgate,” Pivot’s rule was “take the north fork.” If a coach said “Easton,” Pivot’s rule was “take the east fork.” If a coach said “Southport,” Pivot’s rule was “take the south fork.” If a coach said “the capital,” Pivot’s rule was “take the central road; follow the lion-and-star signs.”

Different input, different rule. Same function (junction-direction), different output (specific direction) based on which input the coachman provided.

This was — although Pivot did not have the algebraic word for it for a long time — a piecewise function.

When Pivot was thirty-one, the bureau of roads sent him a junior assistant — a young man named Cobble — who had been hired straight out of the academy. Cobble had studied mathematics. On his second day at the junction, while Pivot was directing a coachman to the south fork, Cobble said: “Sir, that is a piecewise function.”

Pivot said: “A what?”

Cobble said: “In mathematics, a piecewise function is a function with different rules for different ranges of input. Like: if x is less than zero, y is x squared; but if x is greater than or equal to zero, y is two x. The same overall function. Different rules in different domains. You are doing that every day at the junction. You match the input — the coach’s destination — to a domain, and you apply the rule appropriate to that domain.”

Pivot considered this for several days. Then he said to Cobble: “That is a useful word. Piecewise. I will remember it.”

When Pivot was thirty-three, he wrote a letter to the FunctionForge academy. The letter said: “I have been a junction-master at Threefork for twelve years. I have directed two hundred thousand coaches to the correct road. I have recently learned that what I do is called a piecewise function in mathematics. I would like to teach this, because I am beginning to think the bureau of roads can find someone else to stand at Threefork and I am, frankly, tired of standing.”

The academy master invited him to teach. Pivot accepted. He retired from the junction. The bureau sent a replacement (Cobble, eventually, took over Threefork).

Pivot has been teaching piecewise functions at the academy for eleven years.

In his classroom, he begins every first-day lesson the same way. He stands at the front of the room. He says: “Imagine I am at a road junction. Three coaches arrive. The first coach is bound for Northgate. What do I tell it?”

The children — always — say take the north fork.

Pivot says: “The second coach is bound for Easton.”

The children say take the east fork.

Pivot says: “The third coach is bound for Southport.”

The children say take the south fork.

Pivot smiles. He says: “That is a piecewise function. The function is junction-direction. The input is the destination. The output depends on which input was given. Different input, different rule. Same function.”

Then he writes on the board:

If x < 0, y = x² If x ≥ 0, y = 2x

He says: “Here is the algebra. The function takes an input. It checks: is x less than zero, or greater than or equal to zero? It then applies the appropriate rule. That is the same thing as me at the junction. Different input, different rule. The function combines two rules into one piecewise function.”

When children ask whether piecewise functions are hard, Pivot always says the same thing:

“They are not hard. They are junctions. You check the input first. You apply the rule that matches the input. Different inputs trigger different rules. The function is the whole assembly of rules. Each rule is a piece. Piecewise.

He still visits Threefork twice a year. Cobble — now the senior junction-master — is happy to see him. They have tea together at the small tavern at the head of the junction. They direct each other to imaginary coaches as a running joke that the tavernkeeper has heard so many times she no longer reacts.


Voice register

Guidance: Brisk, practical, fond of clear instructions. Speaks in coachman-directing cadences. Friends with all cast (piecewise functions can include any of the other primitives as sub-rules).

Sample lines:

  • “Different input, different rule.”
  • “A piecewise function checks the input first, then applies the matching rule.”
  • “If x < 0, use rule A. If x ≥ 0, use rule B. Same function, different pieces.”
  • “The boundary between pieces is called the break-point. That is where the rule switches.”

Arc across kits

  • Kit 1-4 — Not yet present.
  • Kit 5Anchor character. Full feature: piecewise functions.
  • Kit 6-8 — Recurring (real-world piecewise: tax brackets, shipping rates, absolute value).
  • Kit 9-12 — Cameo (piecewise functions combining linear, quadratic, exponential pieces).
  • Kit 13-16 — Recurring ensemble member.

Relationships

  • Alliance: All cast (piecewise can compose any other primitive).
  • Tension: None.

Cultural-context note

The junction-master civil-service framing is a deliberate generic European-medieval-bureaucracy tradition without specific cultural attribution. Threefork, Whisp’s Corner, Mason’s Bend are invented. The Cobble-junior-assistant + Cobble-eventually-takes-over detail is a deliberate small move surfacing apprenticeship-to-succession patterns in civil service. The “tired of standing” retirement-driver is a deliberately humanizing detail — Pivot is not a hero seeking a higher calling; he is a competent civil servant who decided he wanted a chair.

The FunctionForge ensemble

Pivot the Rule-Switcher is part of FunctionForge's distributed-narrative cast. Each character embodies a different curricular primitive; together they teach the full subject.