Relations and Functions in Discrete Mathematics - Prof. gwapo, Assignments of Mathematics

The concepts of relations and functions in discrete mathematics. It explains how to define a relation, its domain and range, and provides examples of different types of relations. The document also discusses the properties of relations such as reflexivity, symmetry, antisymmetry, and transitivity. Furthermore, it introduces the concept of equivalence relations and their equivalence classes. Lastly, it discusses functions, their domain and range, and the difference between functions and relations.

Typology: Assignments

2020/2021

Uploaded on 03/06/2021

unknown user
unknown user 🇵🇭

6 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
DISCRETE MATHEMATICS
Jenny C. Cano, LPT, MSc
Page 1 of 11
MODULE 3
Relations and Functions
Relation
We are acquainted with different relationships here in the world. In the world of mathematics,
relationships do have its place also. As an example, in our previous discussions, we have the
relationships among sets, sequences, equality and logical equivalence. However, instead of using the
word relationships in describing these terms, we use the word relations. Generally, we can think of a
relation as a list of relationship of elements to other elements. It can be thought as a set of ordered
pairs. The formal definition of a relation follows.
Definition 3.1: A (binary) relation R between set A and set B is a subset of the Cartesian product 𝐴 𝑥 𝐵.
If (𝑥, 𝑦) 𝑅, then we write 𝑥𝑅𝑦 and say that 𝑥 is related to 𝑦. If 𝐴 = 𝐵, we call R a (binary) relation on
A.
The set
{𝑥 𝐴:(𝑥,𝑦) 𝑅 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑦 𝐵}
is called the domain of R. The set
{𝑦 𝐵: (𝑥,𝑦) 𝑅 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑥 𝐴}
is called the range of R.
Examples:
1. Let 𝐴 = {2,3,4}and 𝐵 = {3,4,5,6,7}. If we define a relation R from A to B by (𝑥, 𝑦) 𝑅 where 𝑥
divides 𝑦, we obtain
𝑅 = {(2,4),(2,6),(3,3),(3,6),(4,4)}
2. Let R be the relation on 𝐴 = {1,2,3,4} defined by (𝑥, 𝑦) 𝑅 where 𝑥 𝑦 = 0, 𝑥, 𝑦 𝐴. Then,
𝑅 = {(1,1),(2,2),(3,3), (4,4)}
3. Let R be the relation on 𝐴 = {1,2,3,4,5} defined by (𝑥, 𝑦) 𝑅 where 𝑦 = 𝑥 1, 𝑥, 𝑦 𝐴. Then,
𝑅 = {(2,1),(3,2),(4,3), (5,4)}.
The domain of R is the set {2,3,4,5} and the range of R is the set {1,2,3,4}.
4. What are the domain and range of R in #1?
An informative way to picture a relation on a set is to draw its digraph. (More detailed discussions
of digraphs will be given in the following module). We will only tackle now digraphs in connection with
relations.) Digraph is a shorthand term of directed-graph. To draw a digraph of a relation on a set A, we
first draw dots or vertices to represent the elements of A. If the element (𝑥,𝑦) is in the relation, we
draw an arrow (called directed edge) from 𝑥 to 𝑦. Note that an element of the form (𝑥, 𝑥) in a relation
corresponds to a directed edge from 𝑥 to 𝑥. Such an edge is called a loop.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Relations and Functions in Discrete Mathematics - Prof. gwapo and more Assignments Mathematics in PDF only on Docsity!

Jenny C. Cano, LPT, MSc

MODULE 3

Relations and Functions

Relation

We are acquainted with different relationships here in the world. In the world of mathematics,

relationships do have its place also. As an example, in our previous discussions, we have the

relationships among sets, sequences, equality and logical equivalence. However, instead of using the

word relationships in describing these terms, we use the word relations. Generally, we can think of a

relation as a list of relationship of elements to other elements. It can be thought as a set of ordered

pairs. The formal definition of a relation follows.

Definition 3.1 : A (binary) relation R between set A and set B is a subset of the Cartesian product 𝐴 𝑥 𝐵.

If (𝑥, 𝑦) ∈ 𝑅, then we write 𝑥𝑅𝑦 and say that 𝑥 is related to 𝑦. If 𝐴 = 𝐵, we call R a (binary) relation on

A.

The set

is called the domain of R. The set

is called the range of R.

Examples:

  1. Let 𝐴 =

and 𝐵 =

. If we define a relation R from A to B by (𝑥, 𝑦) ∈ 𝑅 where 𝑥

divides 𝑦, we obtain

  1. Let R be the relation on 𝐴 =

defined by (𝑥, 𝑦) ∈ 𝑅 where 𝑥 − 𝑦 = 0 , 𝑥, 𝑦 ∈ 𝐴. Then,

  1. Let R be the relation on 𝐴 =

defined by (𝑥, 𝑦) ∈ 𝑅 where 𝑦 = 𝑥 − 1 , 𝑥, 𝑦 ∈ 𝐴. Then,

The domain of R is the set

and the range of R is the set

  1. What are the domain and range of R in #1?

An informative way to picture a relation on a set is to draw its digraph. (More detailed discussions

of digraphs will be given in the following module). We will only tackle now digraphs in connection with

relations.) Digraph is a shorthand term of directed-graph. To draw a digraph of a relation on a set A, we

first draw dots or vertices to represent the elements of A. If the element (𝑥, 𝑦) is in the relation, we

draw an arrow (called directed edge ) from 𝑥 to 𝑦. Note that an element of the form (𝑥, 𝑥) in a relation

corresponds to a directed edge from 𝑥 to 𝑥. Such an edge is called a loop.

Jenny C. Cano, LPT, MSc

Examples:

  1. The relation 𝑅 =

on 𝐴 =

can be described by the

following digraph.

  1. The relation 𝑅 =

on 𝐴 =

can be described by the

following digraph.

Note: The elements of the given set can be written in any order or position as long as the

relation is maintained. That is, the first element of the ordered pair should always point the

second element. One ordered pair corresponds to one arrow. So, the number of arrows in the

digraph is the number of ordered pairs in the relation.

Properties of Relations

Let R be a (binary) relation on set A. Then,

1. R is said to be reflexive if (𝑥, 𝑥) ∈ 𝑅 for every 𝑥 ∈ 𝐴. 2. R is said to be symmetric if for all 𝑥, 𝑦 ∈ 𝐴, if (𝑥, 𝑦) ∈ 𝑅, then (𝑦, 𝑥) ∈ 𝑅. 3. R is said to be antisymmetric if for all 𝑥, 𝑦 ∈ 𝐴, if (𝑥, 𝑦) ∈ 𝑅, then (𝑦, 𝑥) ∈ 𝑅. 4. R is said to be transitive if for all 𝑥, 𝑦, 𝑧 ∈ 𝐴, if (𝑥, 𝑦) ∈ 𝑅 and (𝑦, 𝑧) ∈ 𝑅, then (𝑥, 𝑧) ∈ 𝑅.

Examples:

  1. The relation 𝑅 =

on 𝐴 =

is not reflexive since 2 ∈ 𝐴

but ( 2 , 2 ) ∈ 𝑅. 𝑅 is not symmetric since ( 1 , 2 ) ∈ 𝑅 but ( 2 , 1 ) ∈ 𝑅. 𝑅 is not antisymmetric since

( 3 , 4 ) ∈ 𝑅 and ( 4 , 3 ) ∈ 𝑅. 𝑅 is not transitive since

, ( 4 , 3 ) ∈ 𝑅 but

  1. The relation 𝑅 =

on 𝐴 =

is not reflexive, not symmetric,

not transitive, but antisymmetric.

Jenny C. Cano, LPT, MSc

Examples:

}is a partition of set 𝐴 =

  1. The sets 𝐹 =

, and 𝐻 =

form a partition of set 𝐴 =

Note: If set 𝐴 has a partition 𝐶, then every element of 𝐴 should be contained to exactly one member of

Definition 3.5 : Let 𝐶 be a partition of a set 𝐴. Define 𝑥𝑅𝑦 to mean that for some set 𝐹 in 𝐶, both 𝑥 and

𝑦 belong to 𝐹. Then, 𝑅 is reflexive, symmetric, and transitive.

Note: A relation that is reflexive, symmetric, and transitive is called equivalence relation. That is, the

relation that will be derived on any set from its partition is an equivalence relation.

Examples:

  1. Consider the partition

of 𝐴 =

. The relation 𝑅 on 𝐴 given by definition 3.5 follows.

  1. Consider the partition

of 𝐴 =

. What is 𝑅?

Definition 3.6 : Let 𝑅 be a equivalence relation on set 𝐴. For each 𝑥 ∈ 𝐴, let

[𝑥] = {𝑦 ∈ 𝐴: 𝑦𝑅𝑥}

Then,

𝐶 = {[𝑥]: 𝑥 ∈ 𝐴}

is a partition of 𝐴. The sets

[

]

are called the equivalence classes of 𝐴 given by the relation 𝑅.

Examples:

  1. Let the relation

on 𝐴 =

be an equivalence relation. The equivalence class

[

]

containing 1 consists

of all 𝑥 such that (𝑥, 1 ) ∈ 𝑅. Therefore,

[

]

The remaining equivalence classes are found similarly:

[

]

[

]

[

]

[

]

[

]

  1. Consider the partition

on 𝐴 =

. Then, the following equivalence classes are found:

[ 0 ] = [ 2 ] = [ 3 ] = { 0 , 2 , 3 }, [ 1 ] = { 1 }, [ 4 ] = { 4 }.

  1. Given the equivalence relation

on the set

. What are the equivalence classes?

Jenny C. Cano, LPT, MSc

Function

Definition 3.7 : Let 𝐴 and 𝐵 be sets. A function 𝒇 from 𝐴 to 𝐵 is a subset of the Cartesian product 𝐴 𝑥 𝐵

having the property that for each 𝑥 ∈ 𝐴, there is exactly one 𝑦 ∈ 𝐵 with (𝑥, 𝑦) ∈ 𝑓.

𝑓 is a set of ordered pair. We sometimes denote a function 𝑓 from 𝐴 to 𝐵 as 𝑓: 𝐴 → 𝐵. The set 𝐴 is

called the domain of 𝑓 and the set

(which is a subset of 𝐵) is called the range of 𝑓. The set 𝐵 is sometimes called as the codomain of 𝑓.

Note that a function is a special kind of relation. All functions are relation but not all relations are

functions. From the above definition, it is very clear that for a function 𝑓: 𝐴 → 𝐵 all the elements of the

set 𝐴 must have exactly one pair in the set 𝐵. If (𝑥, 𝑦) ∈ 𝑓, then we call 𝑦 the image of 𝑥 under 𝑓 and

we write 𝑓

Examples: Given the sets 𝐴 =

and 𝐵 =

. Then,

1

is not a function since 1 has two different pairs.

2

is a function.

3

= {( 1 , 𝑎)} is not a function from A to B since 2 has no pair.

  1. How about 𝐴 𝑥 𝐵?

The situation of classifying a set to be a function or not can be depicted by drawing a schematic or

arrow diagram. For an arrow diagram to be a function there should only be exactly one arrow from

each element in the domain. Consider the following examples.

𝐴 𝐵 C D

Fig. 3.7.1 Fig. 3.7.

Fig. 3.7.1 is a function from A to B since all the elements in the domain (set 𝐴) has exactly one

arrow. Fig. 3.7.2 is not a function from C to D since 3 ∈ 𝐴 has no arrow. Another case wherein the

arrow diagram is not a function is when one or more elements in the domain have two or more

arrows. Consider the following cases:

  1. The set

is not a function from 𝐴 =

to 𝐵 =

because the element 4 in 𝐴 is not assigned

to an element in 𝐵.

1

2

3

a

b

c

1

2

3

4

a

b

c

Jenny C. Cano, LPT, MSc

The condition given in definition 3.8 is equivalent to the following statements:

1

2

∈ 𝐴 if 𝑓

1

2

), then 𝑥

1

2

1

2

∈ 𝐴 if 𝑥

1

2

, then 𝑓(𝑥

1

2

The negation of definition 3.8 is given by the following statement:

➢ 𝑓 is not injective if ∃𝑥

1

2

1

2

but 𝑓

1

2

Examples:

  1. The function

from 𝐴 = { 1 , 2 , 3 } to 𝐵 = {𝑎, 𝑏, 𝑐, 𝑑} is one-to-one.

  1. The function

is not one-to-one since 𝑓( 1 ) = 𝑎 = 𝑓( 3 ).

  1. The function

from the set of positive integers to the set of positive integers is one-to-one. The proof follows.

We will show that for all positive integers 𝑛

1

and 𝑛

2

, if 𝑓

1

2

), then 𝑛

1

2

Let 𝑓

1

2

). Then, 2 𝑛

1

2

Thus,

1

2

1

2

1

2

Therefore, 𝑓 is one-to-one.

  1. The function

𝑛

2

from the set of positive integers to the set of integers is not one-to-one. The proof follows.

We must find positive integers 𝑛

1

and 𝑛

2

1

2

, such that 𝑓

1

2

). Suppose 𝑛

1

and 𝑛

2

= 4. Then, 𝑓

2

2

= 0 and 𝑓

4

2

= 0. Thus, 𝑓

Therefore, 𝑓 is not one-to-one.

Definition 3.9 : If 𝑓 is a function from 𝐴 to 𝐵 and the range of 𝑓 is 𝐵, 𝑓 is said to be onto 𝐵 (or an onto

function or a surjective function). In symbol, 𝑓 is surjective if ∃𝑥 ∈ 𝐴 𝑠. 𝑡. 𝑓

= 𝑦, ∀𝑦 ∈ 𝐵. Also, 𝑓 is

surjective if 𝑓

The negation of definition 3.9 is given by the following statement:

➢ 𝑓 is not surjective if ∃𝑦 ∈ 𝐵 𝑠. 𝑡. ∀𝑥 ∈ 𝐴, 𝑓

Examples:

  1. The function

from 𝐴 =

to 𝐵 =

is one-to-one and onto 𝐵.

Jenny C. Cano, LPT, MSc

  1. The function

from 𝐴 = { 1 , 2 , 3 } to 𝐵 = {𝑎, 𝑏, 𝑐, 𝑑} is not onto 𝐵.

  1. The function pictured by an arrow diagram in Fig. 3.7.1 is neither one-to-one nor onto 𝐵.
  2. The function

from the set of natural numbers to the set of natural numbers is not surjective. The proof

follows. We will show that 𝑓

Thus, 𝑓(𝐴) ≠ 𝐵. Therefore, 𝑓 is not surjective.

  1. The function

2

from 𝐴 (set of real numbers) to 𝐵 (set of positive real numbers including zero) is onto 𝐵. The

proof follows.

2

Thus, 𝑓

= 𝐵. Therefore, 𝑓 is onto 𝐵.

Definition 3.10 : A function that is both injective and surjective is called a bijection.

Exercises:

  1. Show that the function

3

from the set of real numbers to the set of real numbers is a bijection.

  1. Using vertical line test, verify whether the following are functions or not:

a. 𝑓

2 − 3 𝑥

5

b. 𝑥 = 𝑦

2

Definition 3.11 : Let 𝑓: 𝐴 → 𝐵 be a bijection. The inverse of 𝑓, denoted by 𝑓

− 1

, is the set

− 1

Jenny C. Cano, LPT, MSc

  1. Let 𝑓

2

and 𝑔

= 5 𝑥 + 2. Then,

2

2

2

2

What is 𝑓(𝑔

Exercises: Do what is asked.

  1. Let 𝑓

𝑥

2

  • 3

2

. Then, find 𝑓(− 1 ) and 𝑓 (

1

2

  1. Find the inverse of the following:

a. 2 𝑥 − 𝑦 = 1

b. 3 𝑥 = 2 𝑦 − 5

c. 0 = 𝑦 − 𝑥

Jenny C. Cano, LPT, MSc

Worksheet 4

Name: ____________________________________ Score: _________

Date: ________________

Instruction: For your answers, you can use the back portion of this paper or in the extra sheet.

I. Refer the following (numbers 1-6) to the relation 𝑅 on the set { 1 , 2 , 3 , 4 , 5 } defined by the

rule

∈ 𝑅 if 3 divides 𝑥 − 𝑦.

  1. List the elements of 𝑅.
  2. Find the domain of 𝑅.
  3. Find the range of 𝑅.
  4. List the elements of 𝑅

− 1

  1. Identify the properties of 𝑅.
  2. Draw the digraph of 𝑅

− 1

II. Determine whether the given relation is an equivalence relation on

. If the relation

is equivalence relation, list the equivalence classes.

2

III. Verify whether the function

is a bijection from the set of real numbers to the set of real numbers. If 𝑓 is a bijection, find

its inverse.

IV. Let 𝑓

2

− 4 𝑥 + 1 and 𝑔

𝑥

. Find the following:

1

2