What Is a Function?
Medication dosages, IV drip rates, vital monitoring
Voltage drop, wire sizing, load balancing
A function is a rule that assigns every input exactly one output. You can think of it as a machine: you feed in a number, the machine does something to it, and exactly one result comes out. If a rule ever gives two different outputs for the same input, it is not a function. This single idea β one input, one output β is the foundation for nearly everything you will study from this point forward in algebra, trigonometry, and calculus.
Relations vs. Functions
A relation is any set of ordered pairs . Every function is a relation, but not every relation is a function. The difference comes down to one question: Does every -value pair with exactly one -value?
| Relation | Ordered pairs | Function? |
|---|---|---|
| Yes β each input appears once | ||
| No β input 1 maps to both 4 and 6 | ||
| Yes β different inputs may share an output |
Relation is worth studying. Multiple inputs are allowed to produce the same output. The rule is only violated when a single input produces multiple outputs.
The Function Machine Analogy
Imagine a vending machine. You press button A3 (the input), and exactly one snack drops out (the output). If pressing A3 sometimes gave you chips and other times gave you pretzels at random, the machine would be broken β it would not be a function. A properly working vending machine is a function: every button maps to exactly one product.
In algebra, the βmachineβ is a rule like βmultiply by 2 and add 3.β Feed in :
Feed in :
Every input produces exactly one output, so this rule is a function.
The Vertical Line Test
When you have a graph, the fastest way to check whether it represents a function is the vertical line test. Imagine sliding a vertical line across the graph from left to right:
- If every vertical line crosses the graph at most once, the graph is a function.
- If any vertical line crosses the graph more than once, the graph is not a function.
Example 1: Is the graph of a function?
The graph of is a straight line. Any vertical line you draw will cross it exactly once.
Answer: Yes, it is a function.
Example 2: Is the graph of a function?
This equation describes a circle with radius 5 centered at the origin. A vertical line at , for example, crosses the circle at both and .
Answer: No, it is not a function β it fails the vertical line test.
Example 3: Is a function?
Check the -values: 0, 1, 2, 3. No repeats β each input appears exactly once.
Answer: Yes, it is a function.
Domain and Range β First Look
Every function has two companion concepts:
- Domain: the set of all valid inputs (-values)
- Range: the set of all resulting outputs (-values)
For the function described by :
- Domain
- Range
For the linear function with no restrictions, every real number is a valid input, and every real number is a possible output:
- Domain
- Range
You will explore domain and range in much more depth in Domain and Range.
Identifying Functions from Tables
A table of values represents a function if and only if no -value is repeated with a different -value.
Example 4: Does this table represent a function?
The -values are β all unique. Even though appears twice and appears twice, that is perfectly fine. Different inputs may share the same output.
Answer: Yes, this is a function. (In fact, it is .)
Example 5: Does this table represent a function?
The input appears twice with different outputs ( and ).
Answer: No, this is not a function.
Identifying Functions from Equations
Most equations in the form are functions because the rule gives a single for each . Some common non-function equations to watch for:
- Circles: β two -values for most -values
- Horizontal relations like β two -values for each positive
Example 6: Is a function?
For any input , squaring it and adding 3 gives exactly one result. For instance, gives , and there is no other value could be.
Answer: Yes, it is a function.
Example 7: Is a function (of )?
If , then could be or . One input, two outputs.
Answer: No, it is not a function of .
Real-World Application: Nursing β Dosage as a Function of Weight
In clinical settings, many medication dosages are calculated as a function of patient weight. A common model for a certain antibiotic is:
where is the dosage in milligrams and is the patientβs weight in kilograms.
- A 60 kg patient: mg
- An 80 kg patient: mg
This is a function because each weight maps to exactly one dosage. A nurse would never want a formula that gives two different dosages for the same patient weight β that would be dangerous and, mathematically, not a function.
Domain in context: Patient weight must be positive, so the domain is . In practice, it might be restricted further (e.g., 2 kg to 200 kg for typical patients).
Real-World Application: Electrician β Voltage as a Function of Current
Ohmβs Law states:
where is voltage in volts, is current in amps, and is resistance in ohms (treated as a constant for a given resistor). For a 50-ohm resistor:
- At amps: volts
- At amps: volts
Every current value produces exactly one voltage. This is a function.
Common Mistakes to Avoid
- Thinking two inputs cannot share the same output. They absolutely can. In , both and give . That is still a function.
- Confusing βrelationβ with βfunction.β All functions are relations, but not all relations are functions. The word βrelationβ is more general.
- Applying the vertical line test to a table. The vertical line test applies to graphs. For tables, check whether any -value is repeated with different -values.
- Assuming every equation is a function. Equations like (a circle) are not functions because a single can yield two -values.
- Forgetting that the domain matters. A rule might fail to be a function on one domain but succeed on another. For instance, is not a function from to , but if you restrict , then is a function.
Practice Problems
Test your understanding with these problems. Click to reveal each answer.
Problem 1: Is the relation a function?
Check the -values: 2, 3, 4, 5 β all unique. Even though appears twice (for and ), that is allowed.
Answer: Yes, it is a function.
Problem 2: Is the relation a function?
The input maps to both and . One input, two outputs.
Answer: No, it is not a function.
Problem 3: A vending machine has 10 buttons, each dispensing a unique snack. Is this a function from buttons to snacks?
Yes. Each button (input) produces exactly one snack (output). Different buttons produce different snacks, but that is not required β what matters is that no single button gives two different snacks.
Answer: Yes, it is a function.
Problem 4: Does the equation define a function?
For any value of , multiplying by 3 and subtracting 7 gives exactly one value of . For example, gives and no other value.
Answer: Yes, it is a function.
Problem 5: Does the equation define as a function of ?
This is a circle with radius 10. At , for instance, , so or . One input yields two outputs.
Answer: No, it is not a function. It fails the vertical line test.
Problem 6: A nurse uses the rule to calculate a dosage in milligrams based on a patientβs weight in kilograms. What is the dosage for a 70 kg patient? Is this rule a function?
Each weight gives exactly one dosage, so this is a function.
Answer: 750 mg. Yes, it is a function.
Problem 7: An electrician measures voltage across a 120-ohm resistor using . Find the voltage when the current is 0.25 amps. State the domain and range in context.
Domain: Current must be non-negative in this context, so .
Range: Voltage is also non-negative: .
Answer: 30 volts. Domain: . Range: .
Key Takeaways
- A function assigns exactly one output to every input β one input, one output
- A relation is any set of ordered pairs; a function is a special type of relation
- The vertical line test checks graphs: if any vertical line hits the curve more than once, it is not a function
- Multiple inputs can share the same output without violating the function definition
- Domain is the set of valid inputs; Range is the set of resulting outputs
- Functions model real-world relationships (dosage vs. weight, voltage vs. current) where a single input must produce a single, predictable result
Return to Algebra for more topics in this section.
Next Up in Algebra
Last updated: March 29, 2026