Week 3: Functions
The Machine Analogy
Think of a function as a machine. You put something in (Input), the machine processes it, and gives something out (Output).
Input ()
→
Function ()
→
Output ()
f: A → B
Domain, Codomain, and Range
Key Definitions
- Domain (A): The set of all possible inputs.
- Codomain (B): The set of all potential outputs.
- Range: The set of actual outputs produced by the function.
Types of Functions
✨ One-to-One (Injective)
Every element in the domain maps to a unique element in the codomain.
Distinct inputs have distinct outputs.
⚠️ Onto (Surjective)
Every element in the codomain is mapped to by at least one element in the domain.
Range = Codomain.
Bijective Function
If a function is both One-to-One and Onto, it is called a Bijective function.
Bijective functions are invertible!
Inverse Functions
If is a bijection, then there exists an inverse function such that:
REVERSING THE FLOW