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.

A story read by Pivot the Rule-Switcher

Press play to listen along. The line being read lights up as you go.

Show full transcript

Loading transcript…

01 Opening
Pivot the Rule-Switcher beat 1 of 5

For twelve years, Pivot served the kingdom as a junction-master. This was a specific, if somewhat overlooked, civil-service title within the royal administration. A junction-master’s duty was straightforward: to stand at a significant road-fork, a place where two or more roads branched off toward distinctly different destinations, and guide passing travelers to the correct path.

The kingdom maintained three major junctions busy enough to warrant a full-time master. There was Threefork, where the central road split into the north-road, the east-road, and the south-road. Then came Whisp's Corner, where the southern coast-road divided into the harbour-road and the inland-road. Finally, Mason's Bend marked where the western road forked into the highland-road and the lowland-road. Other, smaller crossroads had simple signs, but these three relied on living, breathing human beings.

Pivot's assignment was Threefork.

He began the work at nineteen. The kingdom’s bureau of roads had hired him after a brief but rigorous examination. They tested his ability to think quickly, speak clearly, and manage a small crowd of impatient coachmen without losing his composure. By the standards of Threefork, he was an excellent fit.

The job followed a predictable rhythm.

A coach would approach the junction. Pivot, stationed in a small wooden booth at the head of the crossroads, would study it. He would quickly assess if he recognized the coach or its driver. Many were regulars, traveling their routes repeatedly. If so, he already knew their destination. If not, he would step out of his booth, walk briskly to the coach window, and ask, "Where are you bound today?"

02 Pivot the Rule-Switcher
Pivot the Rule-Switcher beat 2 of 5

The coachman might call back, "Northgate!" Or perhaps, "Easton." Sometimes, "Southport." Occasionally, a driver would admit, "The capital." Or, more rarely, "I don't actually know; my mistress just told me to follow this road." In that last, unusual case, Pivot would calmly walk the coach to the passenger window and ask the mistress directly.

Once he knew the destination, Pivot would issue his instruction. "Take the north fork," he would say. Or, "You want the east fork." He might direct, "That's the south fork for you." For the capital, he would specify, "You need the central road; it's the middle one between the north and east forks. Just follow the signs marked with the capital's lion-and-star crest."

The coach would then proceed, rumbling away. Soon after, the next coach would arrive, and the process would begin again.

Pivot performed this task for eleven hours a day, six days a a week, for twelve years. He handled, by his own meticulous count, more than two hundred thousand coaches during his service. Not once did he direct a coach to the wrong road. The bureau of roads praised him often for his perfect record. Twice, he received the bureau's quiet annual Reliable Service citation.

What Pivot understood, deep in his bones, was that his job was a system, a set of instructions that changed based on the information he received. It was a kind of internal logic, a precise mechanism for decision-making.

If a coachman said "Northgate," Pivot's internal rule was simple: "tell them to take the north fork." If the destination was "Easton," his rule became: "direct them to the east fork." For "Southport," the rule shifted: "point them toward the south fork." And if a coach was headed for "the capital," his rule expanded: "instruct them to take the central road and follow the lion-and-star signs."

A different destination always triggered a different instruction. The overall task remained the same—directing traffic at a junction. But the specific output, the precise direction given, depended entirely on the input provided by the coachman.

03 Pivot the Rule-Switcher
Pivot the Rule-Switcher beat 3 of 5

This pattern, this system of varied responses, was something Pivot recognized intuitively. He didn't have a formal name for it for a long time, but he knew its mechanics intimately.

When Pivot was thirty-one, the bureau of roads sent him a junior assistant. The young man, named Cobble, had been hired straight out of the academy. Cobble had studied mathematics extensively. On his second day at the junction, while Pivot was directing a coachman toward the south fork, Cobble spoke up. "Sir," he said, "that is a *piecewise function*."

Pivot paused, turning. "A what?"

Cobble explained, "In mathematics, a piecewise function is a function with different rules for different categories of input. Think of it like this: if a number 'x' is less than zero, you might square it. But if 'x' is greater than or equal to zero, you might multiply it by two. It’s the same overall function, but it applies different rules depending on the conditions. You do that every day here at the junction. You match the input—the coach's destination—to a condition, and you apply the rule appropriate to that condition."

Pivot considered this explanation for several days. He watched coaches, listened to destinations, and issued directions, seeing his work through this new lens. Then he said to Cobble, "That is a useful word. Piecewise. I will remember it."

Two years later, when Pivot was thirty-three, he wrote a letter to the FunctionForge academy. The letter was direct. "I have been a junction-master at Threefork for twelve years," he wrote. "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, intrigued by Pivot's unique experience, invited him to teach. Pivot accepted immediately. He retired from the junction, and the bureau sent a replacement. Eventually, Cobble, the former junior assistant, took over Threefork.

04 Pivot the Rule-Switcher
Pivot the Rule-Switcher beat 4 of 5

Pivot has now 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, hands clasped behind his back. "Imagine I am at a road junction," he says. "Three coaches arrive. The first coach is bound for Northgate. What do I tell it?"

The children, always, respond in unison, "Take the north fork!"

Pivot nods. "The second coach is bound for Easton."

"Take the east fork!" the children call out.

"The third coach is bound for Southport."

"Take the south fork!"

05 Closing
Pivot the Rule-Switcher beat 5 of 5

Pivot smiles, a quiet, knowing expression. "That," he says, "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 turns and writes on the board:

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

"Here is the algebra," he says, tapping the equations with a piece of chalk. "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 offers the same reassurance.

"They are not hard at all," he tells them. "They are simply 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 always happy to see him. They share tea together at the small tavern at the head of the junction. As a running joke, they direct each other to imaginary coaches, a ritual the tavernkeeper has heard so many times she no longer even reacts.

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.