A function is a rule that takes an input and gives back exactly one output. Think of a little machine: you drop a number in, the machine does its one job, and a single number comes out the other side.
We write
That little word exactly is the whole idea. Every input is allowed just one output. A picture called a mapping diagram makes it clear: draw the inputs on the left, the outputs on the right, and an arrow from each input to its output.
It is fine for two inputs to share an output. What is not allowed is one input with
two arrows leaving it — then the rule can't decide, so it isn't a function.
Try the buttons: the middle one lets inputs
On a graph there's a quick way to check. Sweep a vertical line across the picture: if the
line ever crosses the curve more than once, that single input
(
Drag the line. A straight line like
Sal Khan walks through the same idea — one input, one output — with a handful of quick examples.