topic badge

11.02 Function machines

Lesson

Introduction

A sausage

If you think of a sausage machine: something goes in, the machine works its magic, and sausages come out the other end.

A function machine is a little like that, just with no sausages. We have three important things that happen though, just like a sausage machine.

Function machines

With a function machine, we have:

  • something going in (input)

  • something happening in the machine (operation)

  • something coming out (output)

Is that all? Yes. It looks just like this.

An arrow with the word input pointing to a box with the word operation, then an arrow with the word output pointing outward.

Let's watch a video to see how it works and how it can go in reverse as well.

Loading video...

Examples

Example 1

Look at this function machine.

A function machine with an input of 2, operation of plus 1, and missing output.
a

In the case above, what is the output of the function machine?

Worked Solution
Create a strategy

Apply the operation to the input.

Apply the idea

The operation tells us to add 1 to the input.

\displaystyle \text{Output}\displaystyle =\displaystyle 2+1Add 1 to the input
\displaystyle =\displaystyle 3Evaluate
b

If the input was changed to 7, what would the new output of the function machine be?

Worked Solution
Create a strategy

Apply the operation to the new input.

Apply the idea

The operation tells us to add 1 to the new input.

A function machine with an input of 7, operation of plus 1, and a missing output.
\displaystyle \text{New output}\displaystyle =\displaystyle 7+1Add 1 to the new input
\displaystyle =\displaystyle 8Evaluate

Example 2

Look at this function machine.

A function machine with an input of 5, a missing operation, and an output of 7.
a

What is the operation of this function machine?

Worked Solution
Create a strategy

Think about what operation needs to happen to the input to get the output.

Apply the idea

To get from 5 to 7 we need to add 2.

So, the operation is +2.

b

We can reverse the direction of a function machine.

A function machine in reverse direction with an input of 7, a missing operation, and an output of 5.

Now 7 is the input and 5 is the output.

What is the operation of this function machine now?

Worked Solution
Create a strategy

Reverse the mathematical operation found in part (a).

Apply the idea

We knew from part (a) that the operation is +2, which has a reverse operation of -2.

Example 3

Look at this function machine.

A function machine with missing input, operation of plus 5, and an output of 12.

In the case above, what is the input of the function machine?

Worked Solution
Create a strategy

Reverse the operation and apply it to the output.

Apply the idea

The reverse of +5 is -5, which we are going to apply to the output.

\displaystyle \text{Input}\displaystyle =\displaystyle 12-5Subtract 5 from the output
\displaystyle =\displaystyle 7Evaluate
Idea summary

A function machine has an input to which an operation is applied and then gives an output:

An arrow with the word input pointing to a box with the word operation, then an arrow with the word output pointing outward.

What is Mathspace

About Mathspace