Unit 2: Relations and Functions
Table of Contents
Relations
A relation is a way of showing a connection between elements of two or more sets.
Cartesian Product
First, the Cartesian Product of two sets A and B, written A × B, is the set of all possible ordered pairs (a, b) where `a` is in A and `b` is in B.
Example: If A = {1, 2} and B = {a, b}, then:
A × B = {(1, a), (1, b), (2, a), (2, b)}
Definition of a Relation
A relation R from a set A to a set B is any subset of the Cartesian Product A × B.
Example: Using A and B from above, a relation R "is less than the number of letters" (if we map 1 to 'a' and 2 to 'bb', etc.) isn't a good example. Let's use numbers.
Let A = {1, 2, 3} and B = {1, 2, 3, 4}. Let the relation R be "is half of".
R = {(a, b) in A × B | a = b/2}
R = {(1, 2), (2, 4)}
This is a relation. The Domain of R is {1, 2} and the Range of R is {2, 4}.
Functions
A function `f` from a set A (the Domain) to a set B (the Co-domain) is a special type of relation that satisfies two rules:
- Every element in the domain A must be related to an element in the co-domain B.
- No element in the domain A can be related to more than one element in the co-domain B.
We write this as f: A → B. For an element `a` in A, the unique element `b` in B it maps to is written as f(a) = b. `b` is the "image" of `a`.
Vertical Line Test
This is a simple graphical test to see if a relation is a function.
A graph represents a function if and only if no vertical line can be drawn that intersects the graph at more than one point.
Types of Functions and Their Graphs
Being able to plot and analyze graphs is a key objective of this course. This requires using mathematical software (like GeoGebra, MATLAB, Python with Matplotlib, or Desmos).
1. Exponential Functions
- Form: f(x) = aˣ, where `a` is a positive constant called the base (`a > 0, a ≠ 1`).
- Graph:
- If `a > 1` (e.g., `eˣ` or `2ˣ`), the graph is increasing (exponential growth).
- If `0 < a < 1` (e.g., `(0.5)ˣ`), the graph is decreasing (exponential decay).
- All graphs pass through the point (0, 1) because `a⁰ = 1`.
- Has a horizontal asymptote at `y = 0` (the x-axis).
2. Logarithmic Functions
- Form: f(x) = logₐ(x), where `a` is the base (`a > 0, a ≠ 1`).
- This is the inverse of the exponential function. `y = logₐ(x)` is the same as `aʸ = x`.
- Graph:
- All graphs pass through the point (1, 0) because `logₐ(1) = 0`.
- Domain is `x > 0`. You cannot take the log of zero or a negative number.
- Has a vertical asymptote at `x = 0` (the y-axis).
3. Trigonometric Functions
- `f(x) = sin(x)`: A periodic wave that oscillates between -1 and 1. It starts at (0, 0).
- `f(x) = cos(x)`: A periodic wave that oscillates between -1 and 1. It is a "shifted" sine wave, starting at (0, 1).
- `f(x) = tan(x)`: A periodic function with vertical asymptotes (e.g., at `x = π/2`, `x = -π/2`, etc.) wherever `cos(x) = 0`.
4. Rational Functions
- Form: f(x) = P(x) / Q(x), where `P(x)` and `Q(x)` are polynomials.
- Graph Features:
- x-intercepts: Occur where the numerator is zero (`P(x) = 0`).
- Vertical Asymptotes: Occur where the denominator is zero (`Q(x) = 0`).
- Horizontal Asymptotes: Depend on the degrees of `P(x)` and `Q(x)`.
- Example: `f(x) = 1 / (x - 2)`. Has a vertical asymptote at `x = 2` and a horizontal asymptote at `y = 0`.
Operations of Functions
Given two functions, `f(x)` and `g(x)`, we can combine them to create new functions.
1. Addition and Subtraction
(f + g)(x) = f(x) + g(x)
(f - g)(x) = f(x) - g(x)
2. Multiplication and Division
(f · g)(x) = f(x) · g(x)
(f / g)(x) = f(x) / g(x), (This is valid only where `g(x) ≠ 0`)
3. Composition of Functions
This is the most complex operation. It involves "plugging" one function into another.
The composition (f ∘ g)(x) is defined as f(g(x)).
This means:
- Start with `x`.
- Apply the "inner" function `g` to get `g(x)`.
- Apply the "outer" function `f` to that result.
Example: Let f(x) = x² + 1 and g(x) = 2x - 3.
- (f ∘ g)(x) = f(g(x))
= f(2x - 3)
= (2x - 3)² + 1
= (4x² - 12x + 9) + 1
= 4x² - 12x + 10 - (g ∘ f)(x) = g(f(x))
= g(x² + 1)
= 2(x² + 1) - 3
= 2x² + 2 - 3
= 2x² - 1