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:
  1. Every element in the domain A must be related to an element in the co-domain B.
  2. 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

2. Logarithmic Functions

3. Trigonometric Functions

4. Rational Functions

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:
  1. Start with `x`.
  2. Apply the "inner" function `g` to get `g(x)`.
  3. Apply the "outer" function `f` to that result.

Example: Let f(x) = x² + 1 and g(x) = 2x - 3.

Common Mistake: Order matters! As the example shows, (f ∘ g)(x) is generally NOT equal to (g ∘ f)(x).