relations lec 6 7 8 compatibility mode

66
Relations Lecture 05-06 Sidra Malik Spring 2016 Discrete Structures 1

Upload: independent

Post on 25-Nov-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

Relations

Lecture 05-06

Sidra Malik

Spring 2016 Discrete Structures 1

Cartesian Product AxB

Ordered Pair:

�An ordered pair (a, b) consists of two elements “a” and “b” in which “a” is

the first element and “b” is the second element.

� The ordered pairs (a, b) and (c, d) are equal if, and only if, a= c and b = d.

Note that (a, b) and (b, a) are not equal unless a = b.

Ordered n TUPLE:

� The ordered n-tuple (a1, a2, …, an) consists of elements a1, a2, …, an

together with the ordering: first a1, second a2, and so forth up to n

�Two ordered n-tuples (a1, a2, …, an) and (b1, b2, …, bn) are equal if and

only if each corresponding pair of their elements is equal, i.e., ai = bj, for all

i, j = 1, 2, …, n.

Spring 2016 Discrete Structures 2

Relations

�If we want to describe a relationship between elements of two sets A and B, we can use ordered pairs with their first element taken from A and their second element taken from B.

�Since this is a relation between two sets, it is called a binary relation.relation.

�Definition: Let A and B be sets. A binary relation from A to B is a subset of A×B.

�In other words, for a binary relation R we have R ⊆ A×B. We use the notation aRb to denote that (a, b)∈R and aRb to denote that (a, b)∉R.

Spring 2016 Discrete Structures 3

Relations

�When (a, b) belongs to R, a is said to be related to b by R.

�Example: Let P be a set of people, C be a set of cars, and D be the relation describing which person drives which car(s).

�P = {Carl, Suzanne, Peter, Carla},

�C = {Mercedes, BMW, tricycle}�C = {Mercedes, BMW, tricycle}

�D = {(Carl, Mercedes), (Suzanne, Mercedes),(Suzanne, BMW), (Peter, tricycle)}

�This means that Carl drives a Mercedes, Suzanne drives a Mercedes and a BMW, Peter drives a tricycle, and Carla does not drive any of these vehicles.

Spring 2016 Discrete Structures 4

Binary Relations

�Let A and B be sets.

�The binary relation R from A to B is a subset of A × B. When (a, b) ∈R, we say ‘a’ is related to ‘b’ by R, written aRb.

�Otherwise, if (a, b) ∉R, we write a R b.

Discrete Structures 5Spring 2016

Binary Relations

Example

�Let A = {1, 2}, B = {1, 2, 3}

�Then A × B = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}

�Let

R 1={(1,1), (1, 3), (2, 2)}

R 2={(1, 2), (2, 1), (2, 2), (2, 3)}

R 3={(1, 1)}

R 4= A × B

R 5= ∅

All being subsets of A × B are relations from A to B.Spring 2016 Discrete Structures 6

Domain of a Relation

The domain of a relation R from A to B is the set of all first elements of the ordered pairs which belong to R denoted by Dom(R).

Symbolically,

∈ ∈Dom (R) = {a ∈A | (a, b) ∈R}

Spring 2016 Discrete Structures 7

Range of a Relation

The range of a relation R from A to B is the set of all second

elements of the ordered pairs which belong to R denoted Ran(R).

Symbolically,

∈ ∈Ran(R) = {b ∈B | (a, b) ∈ R}

Spring 2016 Discrete Structures 8

Range of a Relation

The range of a relation R from A to B is the set of all second

elements of the ordered pairs which belong to R denoted Ran(R).

Symbolically,

∈ ∈Ran(R) = {b ∈B | (a, b) ∈ R}

Spring 2016 Discrete Structures 9

Exercise

Let A = {1, 2}, B = {1, 2, 3},

Define a binary relation R from A to B as follows:

R = {(a, b) ∈A × B | a < b}

Then

Then

a. Find the ordered pairs in R.

b. Find the Domain and Range of R.

c. Is 1R3, 2R2?

Spring 2016 Discrete Structures 10

Exercise

Given A = {1, 2}, B = {1, 2, 3},

A × B = {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3)}

Spring 2016 Discrete Structures 11

Exercise

Given A = {1, 2}, B = {1, 2, 3},

A × B = {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3)}

∈a. R = {(a, b) ∈A × B | a < b}

Spring 2016 Discrete Structures 12

Exercise

Given A = {1, 2}, B = {1, 2, 3},

A × B = {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3)}

∈a. R = {(a, b) ∈A × B | a < b}

R = {(1,2), (1,3), (2,3)}

Spring 2016 Discrete Structures 13

Exercise

Given A = {1, 2}, B = {1, 2, 3},

A × B = {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3)}

a. R = {(a, b) ∈A × B | a < b}a. R = {(a, b) ∈A × B | a < b}

R = {(1,2), (1,3), (2,3)}

b. Dom(R) = {1,2} and Ran(R) = {2, 3}

c. Since (1, 3)∈R so 1R3

But (2, 2) ∉R so 2 is not related with3 or 2R2

Spring 2016 Discrete Structures 14

Example

Let A = {eggs, milk, corn}

B = {cows, goats, hens}

∈Define a relation R from A to B by (a, b) ∈R

iff a is produced by b.

Spring 2016 Discrete Structures 15

Example

Let A = {eggs, milk, corn}

B = {cows, goats, hens}

∈Define a relation R from A to B by (a, b) ∈R

iff a is produced by b.

R = {(eggs, hens), (milk, cows), (milk, goats)}

Thus, with respect to this relation eggs R hens , milk R cows, etc.

Spring 2016 Discrete Structures 16

Example:

Find all binary relations from {0,1} to {1}

Let A = {0,1} & B = {1}

Then A × B = {(0,1), (1,1)}

All binary relations from A to B are in fact all subsets of

A ×B, which are:

A ×B, which are:

R 1= ∅

R 2={(0,1)}

R 3={(1,1)}

R 4={(0,1), (1,1)} = A × B

Spring 2016 Discrete Structures 17

Relation on a Set Itself

A relation on the set A is a relation from A to A.

In other words, a relation on a set A is a subset of A × A.

Spring 2016 Discrete Structures 18

Relation on a Set Itself

A relation on the set A is a relation from A to A.

In other words, a relation on a set A is a subset of A × A.

EXAMPLE: Let A = {1, 2, 3, 4}

∈Define a relation R on A as (a,b) ∈ R iff a divides b {symbolically written as a | b}

Spring 2016 Discrete Structures 19

Relation on a Set Itself

A relation on the set A is a relation from A to A.

In other words, a relation on a set A is a subset of A × A.

EXAMPLE: Let A = {1, 2, 3, 4}

Define a relation R on A as (a,b) ∈ R iff a divides b {symbolically written as a | b}

{symbolically written as a | b}

Then R = {(1,1), (1,2), (1,3), (1,4), (2,2), (2,4), (3,3), (4,4)}

For any set A

1. A × A is known as the universal relation.

2. ∅ is known as the empty relation.

Spring 2016 Discrete Structures 20

Arrow Diagram of a Relation

Let A = {1, 2, 3}, B = {x, y}

and R = {1,y), (2,x), (2,y), (3,x)} be a relation from A to B.

The arrow diagram of R is:

Spring 2016 Discrete Structures 21

Directed Graph of a Relation

Let A = {0, 1, 2, 3}

R = {(0,0), (1,3), (2,1), (2,2), (3,0), (3,1)} be a binary relation on A.

Spring 2016 Discrete Structures 22

Matrix Representation of a Relation

Let A = {a1, a2, …, an} and B = {b1, b2, …, bm}.

Let R be a relation from A to B. Define the n × m order matrix M by :

Spring 2016 Discrete Structures 23

Matrix Representation of a Relation

Let A = {1, 2, 3} and B = {x, y}

Let R be a relation from A to B defined as

R ={(1,y), (2,x), (2,y), (3,x)}

Spring 2016 Discrete Structures 24

Properties of Relations

Fall 2002 CMSC 203 - Discrete Structures 25

Reflexive Relation:

�We will now look at some useful ways to classify relations.

�Definition: A relation R on a set A is called reflexive if (a, a)∈R for

every element a∈A.

�Are the following relations on {1, 2, 3, 4} reflexive?

R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)} No.No.

Spring 2016 Discrete Structures 26

R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)} No.No.

R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)} Yes.Yes.

R = {(1, 1), (2, 2), (3, 3)}R = {(1, 1), (2, 2), (3, 3)} No.No.

Reflexive Relation:

�R is not reflexive iff there is an element “a” in A such that

(a, a) ∉R. That is, some element “a” of A is not related to itself.

Definition:Definition: A relation on a set A is called A relation on a set A is called

Spring 2016 Discrete Structures 27

Definition:Definition: A relation on a set A is called A relation on a set A is called irreflexiveirreflexive if (a, a)if (a, a)∉∉R for every element R for every element aa∈∈AA..

Reflexive Relation:

�Let A = {1, 2, 3, 4} and define relations R1, R2, R3, R4 on A as follows:

R 1 = {(1, 1), (3, 3), (2, 2), (4, 4)}

R 2 = {(1, 1), (1, 4), (2, 2), (3, 3), (4, 3)}

R 3 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)} R 3 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}

R 4 = {(1, 3), (2, 2), (2, 4), (3, 1), (4, 4)}.

Spring 2016 Discrete Structures 28

R 1 is reflexive, since (a, a) ∈R1 for all a ∈A.

R 2 is not reflexive, because (4, 4) ∉R2.

R 3 is reflexive, since (a, a) ∈R3 for all a ∈A.

R 4 is not reflexive, because (1, 1) ∉R4, (3, 3) ∉R4

Directed Graph of Reflexive Relation:

�The directed graph of every reflexive relation includes an arrow

from every point to the point itself (i.e., a loop).

�Let A = {1, 2, 3, 4} and define relations R1, R2, R3, R4 on A as follows: R 1 = {(1,

1), (3, 3), (2, 2), (4, 4)}

R 2 = {(1, 1), (1, 4), (2, 2), (3, 3), (4, 3)} R 2 = {(1, 1), (1, 4), (2, 2), (3, 3), (4, 3)}

R 3 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}

R 4 = {(1, 3), (2, 2), (2, 4), (3, 1), (4, 4)}.

Spring 2016 Discrete Structures 29

Directed Graph of Reflexive Relation:

�The directed graph of every reflexive relation includes an arrow

from every point to the point itself (i.e., a loop).

�Let A = {1, 2, 3, 4} and define relations R1, R2, R3, R4 on A as follows: R 1 = {(1,

1), (3, 3), (2, 2), (4, 4)}

R 2 = {(1, 1), (1, 4), (2, 2), (3, 3), (4, 3)} R 2 = {(1, 1), (1, 4), (2, 2), (3, 3), (4, 3)}

Spring 2016 Discrete Structures 30

Directed Graph of Reflexive Relation:

�The directed graph of every reflexive relation includes an arrow

from every point to the point itself (i.e., a loop).

�Let A = {1, 2, 3, 4} and define relations R1, R2, R3, R4 on A as follows:

�R 3 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}

R 4 = {(1, 3), (2, 2), (2, 4), (3, 1), (4, 4)}.

Spring 2016 Discrete Structures 31

Matrix Representation of Reflexive Relation:

�R is reflexive if all the elements on the main diagonal of the

matrix M representing R are equal to 1.

Spring 2016 Discrete Structures 32

Matrix Representation of Reflexive Relation:

�R is reflexive if all the elements on the main diagonal of the

matrix M representing R are equal to 1.

The relation R = {(1,1), (1,3), (2,2), (3,2), (3,3)} on

A = {1,2,3} represented by the following matrix M, is

Spring 2016 Discrete Structures 33

A = {1,2,3} represented by the following matrix M, is reflexive.

Symmetric Relation

�Let R be a relation on a set A. R is symmetric if, and only if, for all a,

b ∈A, if (a, b)∈R, then (b, a) ∈R. That is, if aRb then bRa.

� R is not symmetric iff there are elements a and b in A such that

∈ ∉

� R is not symmetric iff there are elements a and b in A such that

(a, b) ∈R, but (b, a) ∉R.

Spring 2016 Discrete Structures 34

Symmetric Relation

Example:

Let A = {1, 2, 3, 4} and define relations R1, R2, R3, and R4 on A as follows.

R 1 = {(1, 1), (1, 3), (2, 4), (3, 1), (4,2)}

R 2 = {(1, 1), (2, 2), (3, 3), (4, 4)}

R 3 = {(2, 2), (2, 3), (3, 4)} R 3 = {(2, 2), (2, 3), (3, 4)}

R 4 = {(1, 1), (2, 2), (3, 3), (4, 3), (4, 4)}

Spring 2016 Discrete Structures 35

R1 is symmetric because for every order pair (a, b) in R1 also have (b, a) in R 1. For example, we have (1, 3) in R1 then we have (3, 1) in R1

R 2 is also symmetric. We say it is vacuously true.

R 3 is not symmetric, because (2,3) ∈ R3 but (3,2) ∉ R3.

R 4 is not symmetric because (4,3) ∈ R4 but (3,4) ∉ R4.

Directed Graph of a Symmetric Relation

For a symmetric directed graph whenever there is an arrow going

from one point of the graph to a second, there is an arrow going

from the second point back to the first.

EXAMPLE

Let A = {1, 2, 3, 4} and define relations R1, R2, R3 and R4 on A by the Let A = {1, 2, 3, 4} and define relations R1, R2, R3 and R4 on A by the

directed graphs:

R 1 = {(1, 1), (1, 3), (2, 4), (3, 1), (4,2)}

R 2 = {(1, 1), (2, 2), (3, 3), (4, 4)}

R 3 = {(2, 2), (2, 3), (3, 4)}

R 4= {(1, 1), (2, 2), (3, 3), (4, 3), (4, 4)}

Spring 2016 Discrete Structures 36

Directed Graph of a Symmetric Relation

R 1 = {(1, 1), (1, 3), (2, 4), (3, 1), (4,2)}

R 2 = {(1, 1), (2, 2), (3, 3), (4, 4)}

R 3 = {(2, 2), (2, 3), (3, 4)}

R 4= {(1, 1), (2, 2), (3, 3), (4, 3), (4, 4)}

Spring 2016 Discrete Structures 37

Directed Graph of a Symmetric Relation

R 1 = {(1, 1), (1, 3), (2, 4), (3, 1), (4,2)}

R 2 = {(1, 1), (2, 2), (3, 3), (4, 4)}

R 3 = {(2, 2), (2, 3), (3, 4)}

R 4= {(1, 1), (2, 2), (3, 3), (4, 3), (4, 4)}

Spring 2016 Discrete Structures 38

Matrix Representation of a Symmetric Relation

R is symmetric if the elements in the ith row are the same as the

elements in the ith column of the matrix M representing R. More

precisely, M is a symmetric matrix i.e. M = Mt

EXAMPLE: The relation R = {(1,3), (2,2), (3,1), (3,3)}

on A = {1,2,3} represented by the following matrix M is symmetric.on A = {1,2,3} represented by the following matrix M is symmetric.

Spring 2016 Discrete Structures 39

Transitive Relation

Let R be a relation on a set A. R is transitive if and only if for all a, b, c

∈A,

if (a, b) ∈R and (b, c) ∈R then (a, c) ∈R.

=> That is, if aRb and bRc then aRc.

⇒In words, if any one element is related to a second and that ⇒In words, if any one element is related to a second and that

second element is related to a third, then the first is related to the

third.

The “first”, “second” and “third” elements need not to be distinct.

Spring 2016 Discrete Structures 40

Transitive Relation

R is not transitive iff there are elements a, b, c in A such that

if (a, b) ∈R and (b, c) ∈R but (a, c) ∉R.

EXAMPLE : Let A = {1, 2, 3, 4} and define relations R1, R2 and R3 on A as follows:

R 1 = {(1, 1), (1, 2), (1, 3), (2, 3)}

R 2 = {(1, 2), (1, 4), (2, 3), (3, 4)} R 2 = {(1, 2), (1, 4), (2, 3), (3, 4)}

R 3 = {(2, 1), (2, 4), (2, 3), (3,4)}

Spring 2016 Discrete Structures 41

Then R1 is transitive because (1, 1), (1, 2) are in R, then to be transitive relation (1,2) must be there and it belongs to R. Similarly for other order pairs.R2 is not transitive since (1,2) and (2,3) ∈ R2 but (1,3) ∉ R2.

R 3 is transitive.

Directed Graph of a Transitive Relation

For a transitive directed graph, whenever there is an arrow going

from one point to the second, and from the second to the third, there

is an arrow going directly from the first to the third.

EXAMPLE : Let A = {1, 2, 3, 4} and define relations R1, R2 and R3 on A as follows:

R 1 = {(1, 1), (1, 2), (1, 3), (2, 3)} R 1 = {(1, 1), (1, 2), (1, 3), (2, 3)}

R 2 = {(1, 2), (1, 4), (2, 3), (3, 4)}

R 3 = {(2, 1), (2, 4), (2, 3), (3,4)}

Spring 2016 Discrete Structures 42

Directed Graph of a Transitive Relation

EXAMPLE : Let A = {1, 2, 3, 4} and define relations R1, R2 and R3 on A as follows:

R 1 = {(1, 1), (1, 2), (1, 3), (2, 3)}

R 2 = {(1, 2), (1, 4), (2, 3), (3, 4)}

R 3 = {(2, 1), (2, 4), (2, 3), (3,4)}

Spring 2016 Discrete Structures 43

Exercise

Let A = {1, 2, 3, 4} and define the null relation φ

and universal relation A ×A on A.

Test these relations for reflexive, symmetric and

transitive properties.

Spring 2016 Discrete Structures 44

transitive properties.

Exercise: Reflexive

� Let A = {1, 2, 3, 4} and define the null relation φ and universal

relation A ×A on A.

a) ∅ is not reflexive since (1,1), (2,2), (3,3), (4,4) ∉ ∅.

b) A × A is reflexive since (a,a) ∈ A × A for all a ∈ A.

Spring 2016 Discrete Structures 45

Exercise: Symmetric

� Let A = {1, 2, 3, 4} and define the null relation φ and universal

relation A ×A on A.

a) For the null relation ∅ on A to be symmetric, it must

satisfy the implication:

∈ ∅ ∈ ∅

∈ ∅

Spring 2016 Discrete Structures 46

if (a,b) ∈ ∅ then (a, b) ∈ ∅.

Since (a, b) ∈ ∅ is never true, the implication is vacuously true or

true by default. Hence ∅ is symmetric.

b) The universal relation A × A is symmetric, for it contains all

ordered pairs of elements of A. Thus, if (a, b) ∈ A × A then

(b, a) ∈ A × A for all a, b in A

Exercise: Transitive

� Let A = {1, 2, 3, 4} and define the null relation φ and universal

relation A ×A on A.

a) The null relation ∅ on A is transitive, because the

implication. if (a, b) ∈ ∅ and (b, c) ∈ ∅ then (a, c) ∈ ∅ is true

by default, since the condition (a, b) ∈ ∅ is always false.

Spring 2016 Discrete Structures 47

∈ ∅ ∈ ∅ ∈ ∅

by default, since the condition (a, b) ∈ ∅ is always false.

b) The universal relation A × A is transitive for it contains all

ordered pairs of elements of A. Accordingly, if

(a, b) ∈ A × A and (b, c) ∈ A × A then (a, c) ∈ A × A

Equivalence Relation

� Let A be a non-empty set and R a binary relation on A. R is an

equivalence relation if, and only if, R is reflexive, symmetric,

and transitive.

� EXAMPLE:

Let A = {1, 2, 3, 4} and R = {(1,1), (2,2), (2,4), (3,3), (4,2), (4,4)}

be a binary relation on A. Note that R is reflexive, symmetric

and transitive, hence an equivalence relation.

Discrete Structures 48Spring 2016

Irreflexive Relation

� Let R be a binary relation on a set A.

� R is irreflexive iff for all a∈A,(a,a) ∉R.

� That is, R is irreflexive if no element in A is related to itself by

R.

R.

�R is not irreflexive iff there is an element a∈A such that (a,a)

∈R.

Discrete Structures 49Spring 2016

Irreflexive Relation

Example:

� Let A = {1,2,3,4} and define the following relations on A:

� R 1 = {(1,3), (1,4), (2,3), (2,4), (3,1), (3,4)}

� R 2 = {(1,1), (1,2), (2,1), (2,2), (3,3), (4,4)}

� R 3 = {(1,2), (2,3), (3,3), (3,4)} � R 3 = {(1,2), (2,3), (3,3), (3,4)}

� Then R1 is irreflexive since no element of A is related to itself in R1. i.e.

(1,1)∉ R1, (2,2) ∉ R1, (3,3) ∉ R1,(4,4) ∉ R1

� R 2 is not irreflexive, since all elements of A are related to themselves in

R2

� R 3 is not irreflexive since (3,3) ∈R3. Note that R3 is not reflexive. NO

A relation may be neither reflexive nor irreflexive.

Discrete Structures 50Spring 2016

Directed Graph of Irreflexive Relation

Let R be an irreflexive relation on a set A.

Then by definition, no element of A is related to itself by R.

Accordingly, there is no loop at each point of A in the directed

graph of R.

Discrete Structures 51Spring 2016

Directed Graph of Irreflexive Relation

EXAMPLE: Let A = {1,2,3} and R = {(1,3), (2,1), (2,3), (3,2)} be

represented by the directed graph.

Discrete Structures 52Spring 2016

Matrix Representation of Irreflexive Relation

Let R be an irreflexive relation on a set A. Then by definition, no

element of A is related to itself by R. S

ince the self related elements are represented by 1’s on the

main diagonal of the matrix representation of the relation, so

for irreflexive relation R, the matrix will contain all 0’s in its for irreflexive relation R, the matrix will contain all 0’s in its

main diagonal.

Discrete Structures 53Spring 2016

Matrix Representation of Irreflexive Relation

EXAMPLE: Let A = {1,2,3} and R = {(1,3), (2,1), (2,3), (3,2)} be

represented by the matrix

Discrete Structures 54Spring 2016

Matrix Representation of Irreflexive Relation

EXAMPLE: Let R be the relation on the set of integers Z

defined as: for all a,b ∈Z, (a,b) ∈R ⇔ a > b. Is R irreflexive?

Discrete Structures 55Spring 2016

Matrix Representation of Irreflexive Relation

EXAMPLE: Let R be the relation on the set of integers Z

defined as: for all a,b ∈Z, (a,b) ∈R ⇔ a > b. Is R irreflexive?

R is irreflexive if for all a ∈Z, (a,a) ∉R.

Now by the definition of given relation R, for all a ∈Z, (a,a) ∉R

∈ ∉

Now by the definition of given relation R, for all a ∈Z, (a,a) ∉R

since a > a. Hence R is irreflexive.

Discrete Structures 56Spring 2016

AntiSymmetric Relation

Let R be a binary relation on a set A.

R is anti-symmetric iff ∀a, b ∈A if (a,b) ∈R and (b,a) ∈R

then a = b.

Note:Note:

1) R is not anti-symmetric iff there are elements a and b in A

such that (a, b) ∈R and (b, a) ∈R but a ≠ b.

2) The properties of being symmetric and being anti-symmetric

are not negative of each other.

Discrete Structures 57Spring 2016

AntiSymmetric Relation

Example: Let A = {1,2,3,4} and define the following relations on A.

R 1 = {(1,1),(2,2),(3,3)}

R2 = {(1,2),(2,2), (2,3), (3,4), (4,1)}

R 3={(1,3),(2,2), (2,4), (3,1), (4,2)}

R4={(1,3),(2,4), (3,1), (4,3)} R4={(1,3),(2,4), (3,1), (4,3)}

R 1 is anti-symmetric and symmetric .

R 2 is anti-symmetric but not symmetric because (1,2) ∈ R2but (2,1) ∉ R2.

R 3 is not anti-symmetric since (1,3) & (3,1) ∈ R3 but 1 ≠ 3. Note that R3 is

symmetric.

R 4is neither anti-symmetric because (1,3) & (3,1) ∈ R4 but 1 ≠ 3 nor

symmetric because (2,4) ∈ R4 but (4,2) ∉R4

Discrete Structures 58Spring 2016

Directed Graph of AntiSymmetric Relation

EXAMPLE: Let A = {1,2,3} And R be the relation defined on A is R ={(1,1),

(1,2), (2,3), (3,1)}.Thus R is represented by the directed graph as below. R is

anti-symmetric, since there is no pair of arrows between two distinct points

in A.

Discrete Structures 59Spring 2016

Matrix Representation of Antisymmetric

Relation

EXAMPLE: Thus in the matrix representation of R there is a 1

in the ith row and jth column iff the jth row and ith column

contains 0 vice versa.

EXAMPLE: Let A = {1,2,3} and a relation R = {(1,1), (1,2),

(2,3), (3,1)}on A be represented by the matrix. (2,3), (3,1)}on A be represented by the matrix.

Discrete Structures 60Spring 2016

Inverse Relation

Let R be a relation from A to B.

The inverse relation R-1 from B to A is defined as: R -1 = {(b,a)

∈B×A | (a,b) ∈R}

More simply, the inverse relation R-1 of R is obtained by

∈ ∈

More simply, the inverse relation R-1 of R is obtained by

interchanging the elements of all the ordered pairs in R. .

Discrete Structures 61Spring 2016

Inverse Relation

Let R be a relation from A to B.

The inverse relation R-1 from B to A is defined as: R -1 = {(b,a)

∈B×A | (a,b) ∈R}

More simply, the inverse relation R-1 of R is obtained by

∈ ∈

More simply, the inverse relation R-1 of R is obtained by

interchanging the elements of all the ordered pairs in R. .

Discrete Structures 62Spring 2016

Inverse Relation

EXAMPLE: Let A = {2, 3, 4} and B = {2,6,8}and let R be the “divides” relation from A to B i.e. for all (a,b) ∈ A × B, a R b ⇔ a | b (a divides b)

Discrete Structures 63

∈ ⇔

(a divides b)

Then R = {(2,2), (2,6), (2,8), (3,6), (4,8)}and

R-1= {(2,2), (6,2), (8,2), (6,3), (8,4)}

In words, R-1may be defined as: for all (b,a) ∈B × A, b R a ⇔ b is a multiple of a.

Spring 2016

Arrow Diagram of Inverse Relation

The relation R = {(2,2), (2,6), (2,8), (3,6), (4,8)} is represented by the arrow diagram.

Discrete Structures 64Spring 2016

Arrow Diagram of Inverse Relation

Then inverse of the above relation can be obtained simply changing the directions of the arrows and hence the diagram is

Discrete Structures 65Spring 2016

Matrix Representation of Inverse Relation

Discrete Structures 66Spring 2016