Relations
1.2 Relation
Definition
"A relation from a set A to a set B is
a set of ordered pairs (a, b) where a ∈ A and b ∈ B. If A = B,
then the relation is said to be on A."
"For example, ‘is greater
than’ is a relation between numbers. ‘Is a parent of’
is a relation between people."
Properties of Relations
"Relations can have several
important properties that help us classify and understand them."
Reflexive: A relation R on
a set A is reflexive
if every element in A is related to itself. In other words, for all a ∈ A, (a, a) ∈ R
"Think of ‘is equal to’. Every
number is equal to itself."
Symmetric: A relation R on
a set A is symmetric
if whenever (a, b) ∈ R, then (b, a) ∈ R.
"Think of ‘is a sibling of’. If
person A is a sibling of person B, then person B is a sibling of person
A."
Transitive: A relation R on
a set A is transitive
if whenever (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R
"Think of ‘is an ancestor of’. If
person A is an ancestor of person B, and person B is an ancestor of person C,
then person A is an ancestor of person C."
Irreflexive: A relation R on
a set A is irreflexive
if no element in A is related to itself. In other words, for all a ∈ A, (a, a) ∉ R
Closures of Relations
"Sometimes a relation doesn’t
have a certain property, but we can add ordered pairs to it to make it have that property. This is
called taking the closure
of the relation."
Reflexive
Closure: The reflexive closure of a relation R is the smallest
reflexive relation that contains R.
Symmetric
Closure: The symmetric closure of a relation R is the smallest
symmetric relation that contains R.
Transitive
Closure: The transitive closure of a relation R is the smallest
transitive relation that contains R.
Equivalence Relations and Partitions
"An equivalence relation is a relation
that is reflexive, symmetric, and transitive. Equivalence relations are very
important because they partition a set into disjoint subsets called equivalence classes."
"An equivalence class is a set of
all elements that are related to each other under the equivalence
relation."
"A partition of a set is a collection of disjoint subsets
whose union is the entire set."
"Therefore, an equivalence relation
on a set creates a partition of that set, where each part of the partition is
an equivalence class."
Classroom Activities
Relation Property
Identification:
"I’ll give you some relations, and
you have to identify which properties they have (reflexive, symmetric, transitive)."
Equivalence
Relation Construction:
"I’ll give you a set, and you have
to construct an equivalence relation on that set, and then identify the
equivalence classes."
1.3 Functions:
Definitions
"Formally, a function from a set A to a set B is
a relation that assigns to each element x in A exactly
one element y in B. We write this as f: A → B,
where A is the domain
and B is the codomain."
"In simpler terms: For every
input, there is only one output. No input can have multiple outputs.
"Let’s say our machine is a
‘double it’ machine. If you put in 2, it outputs 4. If you put in 5, it outputs
10. Each input has only one output. That’s a function!"
Types of Functions
"Now, let’s explore some
special types of functions."
One-to-One: A function f: A → B is one-to-one if different elements in
A map to different elements in B. In other words, if x₁ ≠ x₂, then f(x₁) ≠ f(x₂).
"Our ‘double
it’ machine is one-to-one. Every input gives a unique output."
"Example:
f(x) = x + 5 is one-to-one. If you get a particular output, you know exactly
what the input was."
Onto: A function f: A → B is onto if every element in B is the
image of some element in A. In other words, for every y in B, there exists an x
in A such that f(x) = y.
"Imagine a
machine that always outputs even numbers. If our codomain is all even numbers, then it’s onto, because every even number
can be an output. But if our codomain is all integers, it’s not onto, because we’ll never get an odd number as an
output."
"Example: If
f(x) = 2x and B is the set of all even numbers, then f is onto."
Bijection: A function f: A → B is a bijection
if it is both one-to-one and onto.
"A bijection is a perfect pairing between the elements of two
sets. Every input has a unique output, and every output has a unique
input."
"Our ‘double
it’ machine, where the codomain is only even numbers, is a bijection."
Function Composition
"Function composition is when you
apply one function to the result of another function (Composition of Functions,
2018). It’s like having two machines in a row. You put something into the first
machine, it does its thing, and then the output goes into the second
machine."
"If we have two functions, f: A → B and g: B → C, then the composition of f and
g is denoted as g(f(x)) or (g ∘ f)(x)."
·
"Let’s say f(x) = x + 1 and g(x) = x². Then g(f(x)) =
g(x + 1) = (x + 1)²"