Numbers & Functions · 3 Functions as Machines

3.2 A machine must be reliable

Here’s a rule that seems almost too obvious to mention, but it turns out to be the heart of what makes something a function.

A function must give the same output every time you feed it the same input.

Think about why that has to be true for a machine. If you drop 5 into the squaring machine on Monday and get 25, then drop 5 in again on Tuesday, you’d be alarmed to get 30. A machine that gives different answers to the same question isn’t a machine you can trust — it’s broken.

This is the one unbreakable law of functions: same input, same output. Always. A function is allowed to send different inputs to the same output — the Functions as Machines squaring machine sends both 3 and −3 to 9, and that’s fine. What it is never allowed to do is send one input to two different outputs. Hold onto that — in a few pages it’s going to give us a clean way to look at any graph and instantly tell whether it’s a function or not.

3.3 What can you feed it? (Domain)

Not every machine accepts every number. Take the square-root machine, g(x) = √x. Feed it 9, out comes 3. Feed it 2, out comes that irrational number from last chapter, 1.414 . . . Fine. Now feed it −1. The machine asks: “what number, times itself, gives −1?” And — at least among the real numbers — there isn’t one. The machine jams.

So the square-root machine only accepts numbers from 0 upward. The collection of numbers a machine is willing to accept has a name: the domain. Figuring out a machine’s domain is really just asking: for which inputs does this machine not jam? Two classic jams to watch for: • Square roots of negatives — jams, as we saw.

• Dividing by zero — the machine h(x) = 1 x happily eats any number except 0.

3.4 What comes out? (Range)

If the domain is everything the machine will accept, the range is everything the machine can produce. The squaring machine is interesting here. Feed it anything you like — positive, negative, huge, tiny — and the output is never negative. So even though its domain is the whole number line, its range is only the numbers from 0 up.

Domain: what am I allowed to put in?

Range: what can possibly come out?

All 8 chapters of Numbers & Functions · Foundations · All courses