Mathematics is often referred to as the language of logic, and one of its foundational building blocks is the concept of sets, relations, and functions. These concepts are critical in understanding many areas of mathematics, computer science, and logic. This article will provide a simple and comprehensive explanation of these topics.
A set is a collection of distinct objects, considered as a whole. These objects are called the elements or members of the set. Sets are often denoted using curly brackets {}
and can include anything: numbers, letters, symbols, or even other sets.
{1, 2, 3, 4, 5}
{a, e, i, o, u}
{Monday, Tuesday, Wednesday, ...}
{1, 2, 3}
{x | x is a positive integer less than 4}
{}
{1, 2, 3}
{1, 2, 3, ...}
(all natural numbers)A = {1, 2}
and B = {1, 2, 3}
, then A ⊆ B
.A = {1, 2}
, then the power set of A
is { {}, {1}, {2}, {1, 2} }
.A = {1, 2}
and B = {2, 3}
, then A ∪ B = {1, 2, 3}
.A ∩ B = {2}
.A − B = {1}
.A relation is a connection or association between elements of two sets. If there are two sets, A
and B
, then a relation from A
to B
links elements of A
to elements of B
.
A
is the set of parents and B
is the set of children, then a relation might be {(parent1, child1), (parent2, child2)}
.A = {1, 2}
and B = {2, 3}
, then the relation "greater than" could be {(2, 1), (3, 2)}
.{(1, 2), (2, 3)}
A
and B
.1
(exists) or 0
(does not exist).(a, a) ∈ R
for all a
.(a, b) ∈ R
, then (b, a) ∈ R
.(a, b) ∈ R
and (b, c) ∈ R
, then (a, c) ∈ R
.R = {}
.R = A × B
(cartesian product).R = {(a, a) | a ∈ A}
.A function is a special type of relation where each element in the first set (A
) is related to exactly one element in the second set (B
). Functions are also called mappings.
f(x) = x^2
. If A = {1, 2, 3}
, then f(A) = {1, 4, 9}
.A
maps to a unique element in B
. Example: f(x) = x + 1
.B
is mapped by some element in A
. Example: f(x) = x^2
for x ∈ {−2, −1, 0, 1, 2}
.f(x) = x
for x ∈ {1, 2, 3}
.f(x) = x + 2
.A
are mapped to elements of B
.f(x) = x^2
is a parabola.Feature | Relation | Function |
Definition | Connects elements of two sets. | Special relation with one-to-one mapping. |
Mapping | An element in A can relate to multiple B . | Each element in A maps to exactly one B . |
Representation | Roster, arrow diagram, matrix. | Equations, graphs, arrow diagrams. |
A relation between two sets would be a collection of ordered pairs that each contains one object from the other set.
When a set of ordered pairs passes the vertical line test, it is a function. Since there is only one corresponding value for any given value, the ordered pair relation IS a function.