Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
50 views

c1 3 Languagerelation&Functions

This document discusses relations and functions in mathematics. It defines a relation as a subset of the Cartesian product of two sets, where an ordered pair is in the relation if its elements satisfy the given condition. Relations can represent various relationships between mathematical objects. Functions are a special type of relation where each element of the domain is related to exactly one element of the co-domain. The document provides examples to illustrate relations and their representation as subsets of ordered pairs.

Uploaded by

Ronald Amoguez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

c1 3 Languagerelation&Functions

This document discusses relations and functions in mathematics. It defines a relation as a subset of the Cartesian product of two sets, where an ordered pair is in the relation if its elements satisfy the given condition. Relations can represent various relationships between mathematical objects. Functions are a special type of relation where each element of the domain is related to exactly one element of the co-domain. The document provides examples to illustrate relations and their representation as subsets of ordered pairs.

Uploaded by

Ronald Amoguez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

1.

3 The Language of Relations and Functions 13

1.3 The Language of Relations and Functions


Mathematics is a language. — Josiah Willard Gibbs (1839–1903)

There are many kinds of relationships in the world. For instance, we say that two people are related by blood if
they share a common ancestor and that they are related by marriage if one shares a common ancestor with the
spouse of the other. We also speak of the rela-tionship between student and teacher, between people who work
for the same employer, and between people who share a common ethnic background.

Similarly, the objects of mathematics may be related in various ways. A set A may be said to be related to a set
B if A is a subset of B, o r i f A is not a subset of B, o r i f A and B have at least one element in common. A
number x may be said to be related to a number y if x < y, o r i f x is a factor of y, o r i f x2 + y2 = 1. Two
identifiers in a computer

program may be said to be related if they have the same first eight characters, or if the same memory location is
used to store their values when the program is executed. And the list could go on!

Let A = { 0, 1, 2} and B = { 1, 2, 3} and let us say that an element x in A is related to an element y in B if, and
only if, x is less than y. Let us use the notation x R y as a shorthand for the sentence “x is related to y.” Then

0R1 since 0 < 1,


0R2 since 0 < 2,
0R3 since 0 < 3,
1R2 since 1 < 2,
1R3 since 1 < 3, and
2R3 since 2 < 3.
14 Chapter 1 Speaking Mathematically

On the other hand, if the notation x  R y represents the sentence “x is not related to y,”
then
1  R 1 since 1 < 1,
2  R 1 since 2 <  1, and
2  R 2 since 2 <
 2.
Recall that the Cartesian product of A and B, A × B, consists of all ordered pairs
whose first element is in A and whose second element is in B:

A × B = (x, y) | x ∈ A and y ∈ B .
In this case,

A × B = (0, 1) , (0, 2), (0, 3), (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3) .
The elements of some ordered pairs in A × B are related, whereas the elements of other
ordered pairs are not. Consider the set of all ordered pairs in A × B whose elements are
related

(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3) .
Observe that knowing which ordered pairs lie in this set is equivalent to knowing which
elements are related to which. The relation itself can therefore be thought of as the totality
of ordered pairs whose elements are related by the given condition. The formal mathe-
matical definition of relation, based on this idea, was introduced by the American math-
ematician and logician C. S. Peirce in the nineteenth century.

• Definition
Let A and B be sets. A relation R from A to B is a subset of A × B. Given an
ordered pair (x, y) in A × B, x is related to y by R, written x R y, if, and only
if, (x, y) is in R. The set A is called the domain of R and the set B is called its
co-domain.

The notation for a relation R may be written symbolically as follows:


xRy means that (x, y) ∈ R.
The notation x  R y means that x is not related to y by R:
x R y means that (x, y) ∈
/ R.
1.3 The Language of Relations and Functions 15

Example 1.3.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,
x−y
(x, y) ∈ R means that is an integer.
2
a. State explicitly which ordered pairs are in A × B and which are in R.
b. Is 1 R 3? Is 2 R 3? Is 2 R 2?
c. What are the domain and co-domain of R?
Solution
a. A × B = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}. To determine explicitly the com-
position of R, examine each ordered pair in A × B to see whether its elements satisfy
the defining condition for R.
1−1 0
(1, 1) ∈ R because 2
= 2
= 0, which is an integer.
1−2 −1
(1, 2) ∈
/ R because 2
= 2
, which is not an integer.
1−3 −2
(1, 3) ∈ R because 2
= 2
= −1, which is an integer.
2−1 1
(2, 1) ∈
/ R because 2
= 2
, which is not an integer.
2−2 0
(2, 2) ∈ R because 2
= 2
= 0, which is an integer.
2−3 −1
(2, 3) ∈
/ R because 2
= 2
, which is an integer.
Thus
R = {(1, 1), (1, 3), (2, 2)}
b. Yes, 1 R 3 because (1, 3) ∈ R.
No, 2  R 3 because (2, 3) ∈
/ R.
Yes, 2 R 2 because (2, 2) ∈ R.
c. The domain of R is {1, 2} and the co-domain is {1, 2, 3}. ■

Example 1.3.2 The Circle Relation


Define a relation C from R to R as follows: For any (x, y) ∈ R × R,
(x, y) ∈ C means that x 2 + y 2 = 1.
 √ 
a. Is (1, 0) ∈ C? Is (0, 0) ∈ C? Is − 12 , 23 ∈ C? Is −2 C 0? Is 0 C (−1)? Is 1 C 1?

b. What are the domain and co-domain of C?


c. Draw a graph for C by plotting the points of C in the Cartesian plane.
Solution
a. Yes, (1, 0) ∈ C because 12 + 02 = 1.
No, (0, 0) ∈/ C because 02 + 02 = 0 = 1.
 √   2  √  2
Yes, − 12 , 23 ∈ C because − 12 + 23 = 1
4
+ 3
4
= 1.
No, −2 C / 0 because (−2) + 0 = 4 = 1.
2 2

Yes, 0 C (−1) because 02 + (−1)2 = 1.


No, 1 C/ 1 because 12 + 12 = 2 = 1.
b. The domain and co-domain of C are both R, the set of all real numbers.
16 Chapter 1 Speaking Mathematically

c.
y

x2 + y2 = 1

–1 1 x

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:
1. Represent the elements of A as points in one region and the elements of B as points
in another region.
2. For each x in A and y in B, draw an arrow from x to y if, and only if, x is related to y
by R. Symbolically:
Draw an arrow from x to y
if, and only if, x R y
if, and only if, (x, y) ∈ R.

Example 1.3.3 Arrow Diagrams of Relations


Let A = {1, 2, 3} and B = {1, 3, 5} and define relations S and T from A to B as follows:
For all (x, y) ∈ A × B,
(x, y) ∈ S means that x<y S is a “less than” relation.

T = {(2, 1), (2, 5)}.


Draw arrow diagrams for S and T .
Solution
S T
1 1 1 1

2 3 2 3

3 5 3 5

These example relations illustrate that it is possible to have several arrows coming
out of the same element of A pointing in different directions. Also, it is quite possible to
have an element of A that does not have an arrow coming out of it. ■

Functions
In Section 1.2 we showed that ordered pairs can be defined in terms of sets and we defined
Cartesian products in terms of ordered pairs. In this section we introduced relations as
subsets of Cartesian products. Thus we can now define functions in a way that depends
only on the concept of set. Although this definition is not obviously related to the way
we usually work with functions in mathematics, it is satisfying from a theoretical point
1.3 The Language of Relations and Functions 17

of view and computer scientists like it because it is particularly well suited for operating
with functions on a computer.

• Definition
A function F from a set A to a set B is a relation with domain A and co-domain B
that satisfies the following two properties:
1. For every element x in A, there is an element y in B such that (x, y) ∈ F.
2. For all elements x in A and y and z in B,
if (x, y) ∈ F and (x, z) ∈ F, then y = z.

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:
1. Every element of A is the first element of an ordered pair of F.
2. No two distinct ordered pairs in F have the same first element.
In most mathematical situations we think of a function as sending elements from one
set, the domain, to elements of another set, the co-domain. Because of the definition of
function, each element in the domain corresponds to one and only one element of the
co-domain.
More precisely, if F is a function from a set A to a set B, then given any element x in
A, property (1) from the function definition guarantees that there is at least one element
of B that is related to x by F and property (2) guarantees that there is at most one such
element. This makes it possible to give the element that corresponds to x a special name.

• Notation
If A and B are sets and F is a function from A to B, then given any element x in
A, the unique element in B that is related to x by F is denoted F(x), which is read
“F of x.”

Example 1.3.4 Functions and Relations on Finite Sets


Let A = {2, 4, 6} and B = {1, 3, 5}. Which of the relations R, S, and T defined below
are functions from A to B?
a. R = {(2, 5), (4, 1), (4, 3), (6, 5)}
b. For all (x, y) ∈ A × B, (x, y) ∈ S means that y = x + 1.
c. T is defined by the arrow diagram

A B

2 1

4 3

6 5
18 Chapter 1 Speaking Mathematically

Solution
a. 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.

A B
R
2 1

4 3

6 5

b. S is not a function because it does not satisfy property (1). It is not true that every
element of A is the first element of an ordered pair in S. For example, 6 ∈ A but there
is no y in B such that y = 6 + 1 = 7. You can also see this graphically by drawing
the arrow diagram for S.

A B
S
2 1

4 3

Note In part (c), 6 5


T (4) = T (6). This
illustrates the fact that
although no element of c. T is a function: Each element in {2, 4, 6} is related to some element in {1, 3, 5}
the domain of a function and no element in {2, 4, 6} is related to more than one element in {1, 3, 5}. When
can be related to more
these properties are stated in terms of the arrow diagram, they become (1) there is an
than one element of the
co-domain, several arrow coming out of each element of the domain, and (2) no element of the domain
elements in the domain has more than one arrow coming out of it. So you can write T (2) = 5, T (4) = 1,
can be related to the same and T (6) = 1. ■
element in the co-domain.

Example 1.3.5 Functions and Relations on Sets of Real Numbers


a. In Example 1.3.2 the circle relation C was defined as follows:

For all (x, y) ∈ R × R, (x, y) ∈ C means that x 2 + y 2 = 1.

Is C a function? If it is, find C(0) and C(1).


b. Define a relation from R to R as follows:

For all (x, y) ∈ R × R, (x, y) ∈ L means that y = x − 1.

Is L a function? If it is, find L(0) and L(1).

Solution
a. The graph of C, shown on the next page, indicates that C does not satisfy either func-
tion property. To see why C does not satisfy property (1), observe that there are many
real numbers x such that (x, y) ∈
/ C for any y.
1.3 The Language of Relations and Functions 19

x2 + y2 = 1
( 1 , √3
2 2 )
Graph of C

x=2

( 1,
2
– √3
2 )
x = 12

For instance, when x = 2, there is no real number y so that


x 2 + y 2 = 22 + y 2 = 4 + y 2 = 1
because if there were, then it would have to be true that
y 2 = −3.
which is not the case for any real number y.
To see why C does not satisfy property (2), note that for some values of x there
are two distinct values of y so that (x, y) ∈ C. One way to see this graphically is to
observe that there are vertical lines, such as x = 12 , that intersect the graph of C at two
 √   √ 
separate points: 12 , 23 and 12 , − 23 .

b. L is a function. For each real number x, y = x − 1 is a real number, and so there is a


real number y with (x, y) ∈ L. Also if (x, y) ∈ L and (x, z) ∈ L, then y = x − 1 and
z = x − 1, and so y = z. In particular, L(0) = 0 − 1 = −1 and L(1) = 1 − 1 = 0.
You can also check these results by inspecting the graph of L, shown below. Note
that for every real number x, the vertical line through (x, 0) passes through the graph
of L exactly once. This indicates both that every real number x is the first element of
an ordered pair in L and also that no two distinct ordered pairs in L have the same first
element.

y=x–1

(x, 0)

Graph of L

Function Machines
Another useful way to think of a function is as a machine. Suppose f is a function from X
to Y and an input x of X is given. Imagine f to be a machine that processes x in a certain
way to produce the output f (x). This is illustrated in Figure 1.3.1 on the next page.
20 Chapter 1 Speaking Mathematically

x
Input

function machine

f (x) Output
Figure 1.3.1

Example 1.3.6 Functions Defined by Formulas


The squaring function f from R to R is defined by the formula f (x) = x 2 for all real
numbers x. This means that no matter what real number input is substituted for x, the
output of f will be the square of that number. This idea can be represented by writing
f () = 2 . In other words, f sends each real number x to x 2 , or, symbolically,
f : x → x 2 . Note that the variable x is a dummy variable; any other symbol could replace
it, as long as the replacement is made everywhere the x appears.
The successor function g from Z to Z is defined by the formula g(n) = n + 1. Thus,
no matter what integer is substituted for n, the output of g will be that number plus
one: g() =  + 1. In other words, g sends each integer n to n + 1, or, symbolically,
g: n → n + 1.
An example of a constant function is the function h from Q to Z defined by the
formula h(r ) = 2 for all rational numbers r . This function sends each rational number
r to 2. In other words, no matter what the input, the output is always 2: h() = 2 or
h: r → 2.
The functions f, g, and h are represented by the function machines in Figure 1.3.2.

x n r

squaring successor constant


function function function

f (x) = x 2 g(n) = n + 1 h(r) = 2


(a) (b) (c)

Figure 1.3.2 ■

A function is an entity in its own right. It can be thought of as a certain relationship


between sets or as an input/output machine that operates according to a certain rule. This
is the reason why a function is generally denoted by a single symbol or string of symbols,
such as f, G, of log, or sin.
A relation is a subset of a Cartesian product and a function is a special kind of relation.
Specifically, 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.
1.3 The Language of Relations and Functions 21

Example 1.3.7 Equality of Functions


Define f : R → R and g: R → R by the following formulas:
f (x) =√|x| for all x ∈ R.
g(x) = x 2 for all x ∈ R.
Does f = g?
Solution
Yes. Because
√ the absolute value of any real number equals the square root of its square,
|x| = x 2 for all x ∈ R. Hence f = g. ■

You might also like