In general mathematics, functions and relations are fundamental concepts used to describe relationships between sets of objects. Let's break them down:
1. Relation
A relation is a connection or correspondence between elements of two sets. It is defined as a set of ordered pairs.
Definition: A relation
𝑅
R from set
𝐴
A to set
𝐵
B is a subset of the Cartesian product
𝐴
×
𝐵
A×B, i.e.,
𝑅
⊆
𝐴
×
𝐵
R⊆A×B.
This means that for each pair
(
𝑎
,
𝑏
)
∈
𝑅
(a,b)∈R,
𝑎
a is related to
𝑏
b, where
𝑎
∈
𝐴
a∈A and
𝑏
∈
𝐵
b∈B.
Example: Let
𝐴
=
{
1
,
2
,
3
}
A={1,2,3} and
𝐵
=
{
𝑎
,
𝑏
}
B={a,b}. A relation
𝑅
R from
𝐴
A to
𝐵
B could be:
𝑅
=
{
(
1
,
𝑎
)
,
(
2
,
𝑏
)
,
(
3
,
𝑎
)
}
R={(1,a),(2,b),(3,a)}
This means that 1 is related to
𝑎
a, 2 is related to
𝑏
b, and 3 is related to
𝑎
a.
Properties of Relations:
Reflexive: A relation is reflexive if every element is related to itself. For example,
(
𝑎
,
𝑎
)
∈
𝑅
(a,a)∈R for every
𝑎
∈
𝐴
a∈A.
Symmetric: A relation is symmetric if whenever
(
𝑎
,
𝑏
)
∈
𝑅
(a,b)∈R, then
(
𝑏
,
𝑎
)
∈
𝑅
(b,a)∈R.
Transitive: A relation is transitive if whenever
(
𝑎
,
𝑏
)
∈
𝑅
(a,b)∈R and
(
𝑏
,
𝑐
)
∈
𝑅
(b,c)∈R, then
(
𝑎
,
𝑐
)
∈
𝑅
(a,c)∈R.
Anti-symmetric: A relation is anti-symmetric if whenever
(
𝑎
,
𝑏
)
∈
𝑅
(a,b)∈R and
(
𝑏
,
𝑎
)
∈
𝑅
(b,a)∈R, then
𝑎
=
𝑏
a=b.
2. Function
A function is a special type of relation in which every element of the domain (input) is related to exactly one element of the codomain (output).
Definition: A function
𝑓
f from set
𝐴
A to set
𝐵
B is a relation such that for every element
𝑎
∈
𝐴
a∈A, there is exactly one element
𝑏
∈
𝐵
b∈B such that
(
𝑎
,
𝑏
)
∈
𝑓
(a,b)∈f. We write this as:
𝑓
:
𝐴
→
𝐵
where
𝑓
(
𝑎
)
=
𝑏
f:A→Bwheref(a)=b
Example: Let
𝐴
=
{
1
,
2
,
3
}
A={1,2,3} and
𝐵
=
{
𝑎
,
𝑏
}
B={a,b}. A function
𝑓
f could be:
𝑓
=
{
(
1
,
𝑎
)
,
(
2
,
𝑏
)
,
(
3
,
𝑎
)
}
f={(1,a),(2,b),(3,a)}
Here, each element of
𝐴
A is mapped to exactly one element in
𝐵
B, so this is a valid function.
Domain and Range:
Domain: The set of all possible inputs (the first elements of the ordered pairs).
Range: The set of all possible outputs (the second elements of the ordered pairs).
For the above example:
Domain:
{
1
,
2
,
3
}
{1,2,3}
Range:
{
𝑎
,
𝑏
}
{a,b}
Types of Functions:
Injective (One-to-One): A function is injective if different elements in the domain map to different elements in the codomain. In other words, if
𝑓
(
𝑎
1
)
=
𝑓
(
𝑎
2
)
f(a
1
)=f(a
2
), then
𝑎
1
=
𝑎
2
a
1
=a
2
.
Surjective (Onto): A function is surjective if every element of the codomain is the image of some element from the domain. In other words, for every
𝑏
∈
𝐵
b∈B, there exists an
𝑎
∈
𝐴
a∈A such that
𝑓
(
𝑎
)
=
𝑏
f(a)=b.
Bijective: A function is bijective if it is both injective and surjective. This means each element of the domain maps to a unique element in the codomain, and every element of the codomain has exactly o