Three Types of Functions
Functions can be classified by how inputs and outputs relate.
- Injective — no output is hit more than once
- Surjective — every output is hit at least once
- Bijective — both injective and surjective
Injective (One-to-One)
A function is injective if different inputs always give different outputs.
No two inputs share the same output.
Surjective (Onto)
A function is surjective if every element in the codomain is hit by some input.
Nothing in the codomain is left unused.
Bijective (One-to-One and Onto)
A function is bijective if it is both injective and surjective.
- Each output is hit exactly once
- Every output is hit
Perfect pairing — each input matches exactly one output, and vice versa.
Summary
| Type | Condition |
|---|---|
| Injective | No output hit more than once |
| Surjective | Every output hit at least once |
| Bijective | Every output hit exactly once |
Why It Matters
Bijective functions have inverses.
If is bijective, you can reverse it:
This works because:
- Injective means no ambiguity going backwards
- Surjective means every element in B came from somewhere