A relation is a way of showing a connection between elements of two or more sets.
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)}
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}.
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`.
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.
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).
Given two functions, `f(x)` and `g(x)`, we can combine them to create new functions.
(f + g)(x) = f(x) + g(x)
(f - g)(x) = f(x) - g(x)
(f · g)(x) = f(x) · g(x)
(f / g)(x) = f(x) / g(x), (This is valid only where `g(x) ≠ 0`)
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.