Menu

Week 3: Functions

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 (xx)
Function (ff)
Output (f(x)f(x))

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 f:ABf: A \to B is a bijection, then there exists an inverse function f1:BAf^{-1}: B \to A such that:

f1(f(x))=xf^{-1}(f(x)) = x

REVERSING THE FLOW