Tutelage

Lessons › coding and computer science · taught by Leo

Functions explained: inputs, outputs, and graphs

Learn what a function is, how to read input-output pairs, and how to use the vertical line test on graphs.

Learn this with Leo, freeA voiced lesson with a live whiteboard, quizzes and a tutor you can call, at tutelage.app

A function is a rule

Think of a function like a machine. You put one thing in, and it gives one thing out.

The important rule is this: each input gets exactly one output.

input → output

Big idea: input and output

A function connects inputs to outputs by a rule.

The input is the x-value. The output is the y-value.

If the same input tried to give two different outputs, it would not be a function.

Predict the function rule

If a rule takes an input and always gives one output, is it a function?

  1. Yes, if each input has one output
  2. No, only if outputs repeat
  3. No, only if the input is y
Show answer

Yes, if each input has one output: Yes. That is the definition of a function.

Read a table as pairs

A function can be shown in a table. Each row is one input-output pair.

Here, x equals one gives y equals three. x equals two gives y equals five.

(x, y) pairs

Worked example: is it a function?

Let’s test a set of pairs. I am checking whether any input is matched to two outputs.

First pair: one goes to four. That is fine.

Second pair: two goes to six. Still fine.

Third pair: three goes to four. Repeated outputs are allowed, so this is still a function.

Quick check: what fails?

Which situation breaks the function rule?

  1. One input has two different outputs
  2. Two different inputs share one output
  3. Every input has one output
Show answer

One input has two different outputs: Correct. One input cannot point to two different outputs.

Why vertical line test works

A graph is a function if any vertical line hits it at most once.

On a graph, x is the input. A vertical line fixes one x-value.

If that line hits the graph twice, one x would have two y-values, so it is not a function.

Graph test for functions

This curve passes the vertical line test. Each x has only one y.

The flat horizontal line is also a function, because every x still matches one y.

vertical line test

Watch out: repeated y is okay

A lot of students mix this up. Repeated outputs are okay.

The real no-go is two outputs from the same input.

Your turn: is it a function?

A relation has pairs (1, 2), (2, 2), (3, 5). Is it a function?

  1. Yes, because each input is used once
  2. No, because the output 2 repeats
  3. No, because 2 appears twice
Show answer

Yes, because each input is used once: Yes. Each input has exactly one output, so it is a function.

Recap: function checklist

Here is your checklist. Start with the input side.

Then check that each input has exactly one output.

Remember: outputs can repeat, and graphs must pass the vertical line test.

Learn this with Leo, freeA voiced lesson with a live whiteboard, quizzes and a tutor you can call, at tutelage.app