Relations and Functions
Relations and Functions
1
The Language of Relations and Functions
2
The Language of Relations and Functions
Now consider
4
The Language of Relations and Functions
6
Example 1 – A Relation as a Subset
Let A = {1, 2} and B = {1, 2, 3} and define a relation R from
A to B as follows: Given any (x, y) ∈ A B,
b. Is 1 R 3? Is 2 R 3? Is 2 R 2?
7
Example 1 – Solution
a. A B = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}. To
determine explicitly the composition of R, examine each
ordered pair in A B to see whether its elements satisfy
8
Example 1 – Solution cont’d
Thus
b.
c.
9
Arrow Diagram of a Relation
10
Arrow Diagram of a Relation
Suppose R is a relation from a set A to a set B. The arrow
diagram for R is obtained as follows:
11
Example 3 – Arrow Diagrams of Relations
12
Example 3 – Solution
13
Functions
14
Functions
15
Functions
Properties (1) and (2) can be stated less formally as
follows: A relation F from A to B is a function if, and only if:
16
Example 4 – Functions and Relations on Finite Sets
17
Example 4(a) – Solution
R is not a function because it does not satisfy property (2).
The ordered pairs (4, 1) and (4, 3) have the same first
element but different second elements.
You can see this graphically if you draw the arrow diagram
for R. There are two arrows coming out of 4: One points to
1 and the other points to 3.
18
Example 4(b) – Solution cont’d
19
Example 4(c) – Solution cont’d
20
Function Equality
If f and g are functions from a set A to a set B, then
f = {(x, y) ∈ A × B | y = f (x)}
and
g = {(x, y) ∈ A × B | y = g (x)}.
It follows that
f equals g, written f = g,
if and only if f (x) = g (x) for all x in A.
21
Example 7 – Equality of Functions
Define f : R → R and g: R → R by the following formulas:
Does f = g?
Solution:
Yes. Because the absolute value of any real number equals
the square root of its square,
22