No history yet

The Function Machine

The Function Machine

Think about a simple vending machine. You put in your money, press a button for a specific snack, and out it comes. The machine follows a rule: a certain button gives you a certain snack. Every single time.

Mathematicians have a name for this kind of predictable relationship: a function. A function is like a machine that takes something you give it and turns it into something else based on a set of instructions.

The two key parts of any function are the input and the output. The input is what you start with. The output is what you get after the function does its work.

Input

noun

The value or piece of information that you put into a function.

The output, naturally, is the result.

Output

noun

The result or value that comes out of a function after it processes an input.

The One-Output Rule

Functions have one very important rule. For any single input, you can only get one single output.

Let's go back to our vending machine. If you press the button for potato chips, you expect to get potato chips. You wouldn't be happy if it sometimes gave you chips and other times gave you pretzels. That machine would be broken. A function is the same way. It must be predictable.

Every input has exactly one output. This is the core rule of a function.

This doesn't mean that different inputs can't lead to the same output. In our vending machine, the button for pretzels and the button for cheese crackers might both cost $1.50. Two different inputs (the buttons) lead to the same output (the price). That's perfectly fine.

The rule is only broken if one input leads to multiple different outputs. If the button for pretzels sometimes charged you $1.50 and sometimes charged you $2.00, it would not be a function.

A Simple Math Machine

Let’s imagine a function machine with a simple rule: "Double the input, then add one."

If we put the number 3 into this machine, it first doubles it to get 6. Then it adds one, giving us a final output of 7. The relationship is predictable. Every time we put in a 3, we will get a 7.

What if our input is 10? The machine doubles it to 20, then adds one. The output is 21.

What if our input is -4? The machine doubles it to -8, then adds one. The output is -7.

InputThe Rule: (Input × 2) + 1Output
3(3 × 2) + 17
10(10 × 2) + 121
-4(-4 × 2) + 1-7
0(0 × 2) + 11

This table shows our function at work. For each input on the left, there is only one possible output on the right, determined by the function's rule. This consistency is what makes it a function.