Computer Fundamentals

The Box with Knobs

Functions: the one idea behind every computer program. A human picks the knob settings.

The Box with Knobs — interactive video preview

What you'll learn

  • Functions
  • Inputs & Outputs
  • Parameters

In this video

Okay, here's something wild. Every app on your phone, every game you play, even the smartest AI in the world — they all share one tiny idea at their core. And once you see it, you can't unsee it. Ready?

Say hi to the box. Don't worry about what's inside yet. Just watch — something rolls in the left side, and something else pops out the right. That's the whole job. In, then out.

Now this box has a rule written on it — plus five. Watch what happens. We toss in a 3. The box quietly does its thing. And out the other side? An 8. Three plus five. Easy.

Same box, but let's give it a different number. Ten goes in. And out comes... fifteen. Did the box change? Nope. It's still plus five. We just fed it something new.

Pick any number you want. Zero, seven, a million — doesn't matter. The box always adds five. Always. That's what a rule is. It treats every guest the same way.

Your turn to play. Drag that slider and feed the box whatever number you want. Try a tiny one. Try a big one. See if you can predict the answer before it shows up.

But here's where it gets interesting. Some boxes don't lock the rule in forever. See that little knob popping up on top? That's a setting. A dial. We can change how the box behaves without breaking it.

Look — see how the knob spins? The rule on the box changes right along with it. Plus ten. Plus zero. Minus three. And our input never moved. The output is dancing because of the knob.

Now you try. The input is locked at three. Slide that knob around and watch the output. Can you make the output land on zero? How about negative five? Have a go.

One knob is fun. But the boxes inside real programs? They've got loads of them. Each knob nudges the answer in a slightly different direction. Together, they shape exactly what comes out.

Check out this fancier box. It draws a line on the chart. The pink knob, called a, tilts that line steeper or flatter. The blue knob, b, slides the whole line up and down. Two knobs, two jobs.

Your turn again. Grab one knob, then the other. Notice how each one changes the line in its own way. Try to make the line flat. Or super steep. Just play around — there's no wrong answer here.

Okay, time for the official name. Programmers call this thing a function. Stuff goes in, knobs shape the rule, stuff comes out. That's literally all it is. Sounds simple — and it is.

Here's the mind-bending bit. [pause:400] Take this little box, and imagine zillions of them stacked together, all wired up. That's an AI. No magic, no mystery — just a giant pile of these boxes with millions of knobs.

Quick recap. A function is a box. Numbers go in. Knobs shape the rule. Numbers come out. That's the whole deal. Seriously — you just learned the single biggest idea in all of computing. Not bad.

But wait — one big question. Who turns all those knobs to the right spot? With millions of them, no human could do it. The answer is something called learning, and that's exactly where we're heading next.

Topics

#Functions#Inputs & Outputs#Parameters

Ready to try it yourself?

The Box with Knobs is a hands-on interactive video — watch it, then play with the idea live in your browser. Free, no sign-up.

Open in Kekula →