Property
A function is a relationship between two variables for which a unique value of the output variable can be determined from a value of the input variable.
The input variable is also called the independent variable, and the output variable is the dependent variable.
This unique value property is what distinguishes functions from other variable relationships; exactly one output value corresponds to each input value.
Examples
- The cost to ship a package is a function of its weight. A specific weight corresponds to exactly one shipping price.
- A person's final letter grade is not a function of their quiz scores alone, because two students with the same quiz average might have different final grades due to exam performance.
- The amount of sales tax you pay is a function of an item's price. A 10 dollars item will always have the same sales tax; it won't be 1 dollar one day and 1.50 dollars the next.
Explanation
Think of a function like a coffee machine. You press one button (the input), and you get exactly one type of coffee (the unique output). You can't press the espresso button and sometimes get a latte. Each input has only one result.