Relations and Functions
Relations and functions are the bridge between chapter-01-sets and the broader mathematical landscape.
Start with the simplest version: this lesson is about Relations and Functions. If you can explain the core idea to a friend using everyday language, examples, and one clear reason why it matters, you have moved from memorising to understanding.
Relations and functions are the bridge between chapter-01-sets and the broader mathematical landscape. While sets organize collections of objects, relations describe how objects from different sets connect to each other. Functions are special relations with a crucial constraint: each input maps to exactly one output. This chapter establishes fundamental concepts used throughout algebra, calculus, and applied mathematics. Understanding functions is essential because they model real-world phenomena—how temperature changes over time, how costs increase with quantity, or how populations grow.
Relations: Connecting Elements Between Sets
A relation describes a connection between elements from two sets. Think of it like a matching game. You have names in one set {Alice, Bob} and sports in another set {tennis, swimming}. A relation might connect Alice to tennis and Bob to swimming. We can also have Alice connected to both sports—that's allowed in a relation.
If we have set A = {1, 2, 3} and set B = {a, b}, a relation from A to B is any subset of ordered pairs (x, y) where x ∈ A and y ∈ B. The pair (1, a) means "1 is related to a."
Ordered pairs matter: (1, a) is different from (a, 1). Order signals direction and meaning.
Special Relations: Functions
A function is a special relation with a strict rule: every input has exactly one output.
Imagine a vending machine. You press button number 5 (input). Out comes exactly one item, say a chocolate bar (output). If button 5 sometimes gave chocolate and sometimes gave chips, it wouldn't be a function—it violates the "exactly one output" rule.
Formally, f: A → B is a function if for every element in A, there is exactly one corresponding element in B.
Domain: The set of all possible inputs (the first set).
Codomain: The set of all possible outputs (the second set).
Range: The set of outputs actually used. The range is a subset of or equal to the codomain.
Function Notation and Terminology
We write f(x) = y to mean "when you input x into function f, you get output y."
If f(x) = 2x + 3 and you input x = 5, then f(5) = 2(5) + 3 = 13. The function transforms 5 into 13.
Variable distinction: x is the independent variable (the input you choose), and y = f(x) is the dependent variable (it depends on what x is).
Types of Functions
One-to-One (Injective): Different inputs give different outputs. If f(a) = f(b), then a must equal b. Think of assigning unique ID numbers to students—each student gets exactly one ID, and each ID belongs to one student.
Onto (Surjective): Every element in the codomain is an output of some input. Nothing in the codomain is "unused." The range equals the codomain.
Bijective: Both one-to-one AND onto. A perfect pairing with no leftovers and no duplicates. These are the functions that have inverses.
Operations on Functions
Just as you add or multiply numbers, you can combine functions:
(f + g)(x) = f(x) + g(x): Add the outputs.
(f · g)(x) = f(x) · g(x): Multiply the outputs.
(f ∘ g)(x) = f(g(x)): Composition. First apply g, then apply f to that result. This is like a two-step process where one transformation follows another.
Inverse Functions
If a function is bijective, it has an inverse, written f⁻¹. The inverse "undoes" what the function does.
If f(x) = 2x + 3, the inverse is f⁻¹(x) = (x - 3)/2. Applying the function then its inverse returns you to where you started: f⁻¹(f(x)) = x.
To find an inverse: swap x and y, then solve for y.
Graphical Representation
The graph of a function plots (x, f(x)) as points on a coordinate system. The vertical line test determines if a relation is a function: if any vertical line crosses the graph more than once, it's not a function (because one input x would have multiple outputs).
Real-World Context
Relations model direct connections (like "person x supervises person y"). Functions model transformations and dependencies. Distance is a function of time, revenue is a function of sales quantity, student grades are functions of study hours. Functions let us describe patterns, make predictions, and understand cause-and-effect relationships in our world.
Key Formulas
- Function evaluation: y = f(x)
- Composition: (f ∘ g)(x) = f(g(x))
- Inverse condition: f(f⁻¹(x)) = x and f⁻¹(f(x)) = x
Socratic Questions
- In a function, why is the restriction that each input has exactly one output necessary? What would change in mathematics if we allowed one input to map to multiple outputs?
- Consider the function f(x) = x². Is it one-to-one? Is it onto (if the codomain is all real numbers)? How would your answers change if the domain were restricted to non-negative numbers?
- If you have two functions f and g, does f ∘ g always equal g ∘ f? Can you construct an example where they're different? What does this tell you about the order of operations?
- Think about a real-world scenario: tracking student grades across multiple classes. How would you distinguish between a relation and a function? What information would you lose or gain with each model?
- Why must a function be bijective for its inverse to exist? What goes wrong if you try to find the inverse of a function that's not one-to-one?
