Play FunctionForge

Pivot the Rule-Switcher

PIECEWISE FUNCTIONS

A story read by Pivot the Rule-Switcher

Loading audio…

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

Pivot stood at a big road fork. He was a junction-master. That was his job for twelve years. A junction-master helped people find their way. Roads split into different paths here. Each path went to a different place. Pivot made sure coaches took the right one.

The kingdom had three busy road forks. These places needed a full-time junction-master. One was Threefork. The main road split there. It went north, east, or south. Another was Whisp's Corner. It had a coast road. That road split to the harbor or inland. The third was Mason's Bend. A western road forked there. It went to the highlands or lowlands. Other small forks just had signs. But these three had real people.

Pivot was assigned to Threefork.

Pivot was nineteen years old. He got the job. The kingdom's road office hired him. They tested him first. Could he think fast? Could he speak clearly? Could he stay calm? Coachmen could get cranky. Pivot was good at all these things. He fit right in at Threefork.

The job worked like this:

A coach would roll up. Pivot waited in his little wooden booth. It sat right at the fork. He always looked at the coach. Had he seen it before? Many times, yes. Coachmen drove the same roads often. If he knew the coach, he knew where it was going. If not, he stepped out. He walked to the driver. "Where are you headed today?" he would ask.

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

The driver would call out a town. "Northgate!" Or "Easton!" Sometimes "Southport!" Once in a while, "The capital!" Or even, "I don't know. My lady just said to follow this road." If that happened, Pivot walked. He went to the lady in the coach. He asked her himself.

Then Pivot would tell them. "Take the north fork." Or "Take the east fork." Or "Take the south fork." If they needed the capital, it was trickier. "You want the central road," he'd say. "It's the middle one. Between the north and east forks. Look for the lion-and-star signs. That's the capital's crest."

The coach would proceed. The next coach would arrive.

Pivot did this work every day. Eleven hours a day. Six days a week. For twelve long years. He counted every coach. More than two hundred thousand! He never sent one the wrong way. The road office praised him often. He even won awards. Twice he got the "Reliable Service" award. It was a quiet award. But it meant a lot.

Pivot learned something important. It made him a great teacher later on. His job had a pattern. It was like a game with rules. The rules changed. They changed based on what the coachman said.

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 words from the driver. Different rules from Pivot. The job was always the same. It was about directing coaches. But the answer changed. It changed based on where they wanted to go.

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

Pivot didn't know the fancy math word for it. Not yet. But what he did was called a piecewise function.

Pivot was thirty-one. The road office sent him help. A young man named Cobble arrived. Cobble was new. He just finished school. He knew a lot about math. On his second day, Pivot was busy. He told a driver to take the south fork. Cobble spoke up. "Sir," he said, "that's a piecewise function."

Pivot said: "A what?"

Cobble explained. "In math, it's a special kind of function. It has different rules. The rules change for different numbers. Like, if 'x' is small, you use one rule. If 'x' is big, you use another. It's still the same big function. But it has different parts. You do this every day, sir. You hear where the coach wants to go. That's the 'input.' Then you pick the right rule. You tell them which road to take."

Pivot thought about it. He thought for a few days. Then he told Cobble, "That's a good word. Piecewise. I'll keep that in mind."

Pivot turned thirty-three. He wrote a letter. It went to the FunctionForge academy. His letter said: "I've been a junction-master for twelve years. I've sent two hundred thousand coaches the right way. I just learned my job is a piecewise function. I want to teach this. I think the road office can find someone new for Threefork. And honestly, I'm tired of standing all day."

The head of the academy invited him. "Come teach!" they said. Pivot said yes. He left his job at the junction. The road office sent a new person. Later, Cobble took over Threefork.

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

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

In his classroom, Pivot always starts the same way. On the first day, he stands up front. "Imagine I'm at a road fork," he says. "Three coaches drive up. The first one wants to go to 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.

05 Closing
Pivot the Rule-Switcher beat 5 of 5

Pivot smiles. "That's a piecewise function," he says. "The job is to direct traffic. That's the main function. What the driver says is the 'input.' My answer is the 'output.' The output changes. It changes based on the input. Different input, different rule. But it's still the same job."

Then he writes on the board:

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

He points to the board. "Here's the math part," he says. "The function gets a number. It checks that number. Is it smaller than zero? Or is it zero or bigger? Then it uses the right rule. It's just like me at the junction! Different input, different rule. The function puts two rules together. It makes one piecewise function."

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

"They are not hard," Pivot says. "They are like road forks. You look at the input first. Then you use the rule that fits. Different inputs make different rules happen. The function is all the rules together. Each rule is a piece. That's why it's piecewise."

Pivot still visits Threefork. He goes twice a year. Cobble is the main junction-master now. He is always glad to see Pivot. They drink tea together. They sit at the little inn by the fork. They pretend to direct coaches. It's an old joke. The innkeeper has heard it too many times. She doesn't even smile anymore.

Hear it as an audio drama

A short play starring Pivot the Rule-Switcher, from FunctionForge. Different voices, same idea. Listen any time after you read.

Loading audio…

Read the drama script
  1. Narrator: From Spark and Anvil and FunctionForge — this is Pivot The Rule-Switcher, in chapter 1 of the FunctionForge cast.
  2. Narrator: This drama uses an AI-generated voice. Voiced via Gemini 2.5.
  3. Narrator: Pivot the Rule-Switcher is a junction-master. He stands at Threefork, where one road splits into three, and directs every passing coach.
  4. Narrator: From a small wooden booth, he assesses each coach's destination, ready to give the correct instruction for the journey ahead.
  5. Pivot The Rule-Switcher: I am Pivot. For twelve years, I directed traffic. Northgate? Take the north fork. Easton? Take the east fork. Simple.
  6. Narrator: His job was a system. The instruction he gave changed based on the information he received from the coachman.
  7. Pivot The Rule-Switcher: A different destination always triggers a different instruction. My output depends entirely on the coachman's input. That is the whole job.
  8. Pivot The Rule-Switcher: The function is *junction-direction*. The input is the destination. The output is the correct road. Different input, different rule, same function.
  9. Narrator: For years, he simply did the work. Then a young assistant from the academy, Cobble, gave it a name.
  10. Pivot The Rule-Switcher: The boy called it a piecewise function. A function with different rules for different categories of input. The word was useful.
  11. Narrator: After directing two hundred thousand coaches, Pivot wrote to the FunctionForge academy. He was tired of standing but ready to teach.
  12. Pivot The Rule-Switcher: In my classroom, I ask the same thing. If a coach is bound for Northgate, what do I tell it?
  13. Pivot The Rule-Switcher: That is a piecewise function. You check the input first. You apply the rule that matches the input.
  14. Narrator: Different inputs trigger different rules. The function is the whole assembly of those rules. Each rule is a piece. Piecewise.
  15. Narrator: You've been listening to a Spark and Anvil chapter, written by the Spark and Anvil writing team for ages 9 to 14.
  16. Narrator: Apps stay free forever.
  17. Narrator: Curriculum aligned to Common Core math.
  18. Narrator: Released under Creative Commons BY-NC-SA 4.0 for educational reuse. Visit Spark and Anvil for the full transcript.

The FunctionForge ensemble

Pivot the Rule-Switcher is one of the friends in FunctionForge. Each friend shows you one idea by how they act; meet them all and you have the whole subject.

Kids also liked