Discrete Structures: Understanding Relations, Study notes of Discrete Structures and Graph Theory

An introduction to relations, a fundamental concept in discrete mathematics. It covers the basics of relations, binary relations, formal definition, properties of relations, and examples. The document also discusses reflexive, symmetric, and transitive properties, as well as inverse and complement of relations.

Typology: Study notes

Pre 2010

Uploaded on 02/13/2009

koofers-user-yuh
koofers-user-yuh 🇺🇸

10 documents

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSC 250
Discrete Structures
Relations
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Discrete Structures: Understanding Relations and more Study notes Discrete Structures and Graph Theory in PDF only on Docsity!

CMSC 250

Discrete Structures

Relations

19 July 2007

Relations

Relations



The most basic relation is “=” (e.g. x = y) 

Generally x R y

TRUE or FALSE

  • R(x,y) is a more generic representation– R is a binary relation between elements of

some set A to some set B, where x

A and

y∈

B

19 July 2007

Relations

Formal Definition



(Binary) relation from A to Bwhere x

A, y

B, (x,y)

A

×

B and R

A
×
B

xRy

(x,y)

R



Finite example: A={1,2}, B={1,2,3} 

Infinite example: A = Z and B = Z

aRb

a-b

Z

even

19 July 2007

Relations

Example



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

Define a relation R from A to B such that:

xRy

x – y is odd



How could this explicitly be represented as tuples?

  • R = {(2,2),(2,3),(3,6)} 

What if A and B were the set of all integers?

  • R = {(x,y)

Z

×Z

|

k∈

Z

such that x – y = 2k + 1}

19 July 2007

Relations

Example



Define a relation of A called R

  • A = {2,3,4,5,6,7,8}– R = {(4,4),(4,7),(7,4),(7,7),(2,2),(3,3),(3,6),(3,9),

(6,6),(6,3),(6,9),(9,9),(9,3),(9,6)}



Draw the arrow diagram 

Is R

^

Reflexive? ^

Symmetric? ^

Transitive?



Could this arrow diagram represent a function?

19 July 2007

Relations

Example



A = {0,1,2,3}



R over A = {(0,0),(0,1),(0,3),(1,0),(1,1),(2,3),(3,0),(3,3)} 

Draw the arrow diagram for it 

Is R

  • Reflexive?– Symmetric?– Transitive?

19 July 2007

Relations

Proving Properties on Infinite Sets



Define R(x,y) R:

Z
Z

to be

{(x,y)

Z
×
Z

| x|y}



Prove whether or not this is:

  • Reflexive?– Symmetric?– Transitive?

19 July 2007

Relations

The Inverse of the Relations

and the Complement of the Relation



R:

A

B

R

= {(x,y)

A

×

B | xRy}



R

:B

A

R

= {(y,x)

B

×

A | (x,y)

R}



R

’: A

B

R

’^

= {(x,y)

A

×

B | (x,y)

R}



D: {1,2}

{2,3,4}

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

D

’^

=?

D

=?



S = {(x,y)

R

×

R | y = 2*|x|}

S

=?

R y x R y x Y y X x

,^

'

R y x R x y Y y X x

,^

1

19 July 2007

Relations

Example



Given the relation R = {(0,1),(1,2),(2,3)} 

What is R

RC



What is R

SC



What is R

TC

19 July 2007

Relations

Matrix Representation

of a Relation



M

R^

= [m

]ij

-^

m

={1 iff (i,j)ij

R and 0 iff (i,j)

R}



Example:

-^

R : {1,2,3}

{1,2}

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

   

   

=

0 0 1 0 1 1 1 2 3

2 1

R M

19 July 2007

Relations

Example



Let ID = set of student IDs 

Let Class = set of classes offered 

Define relation Summer2007^ {(x,y)

ID

×Class | student x is registered for class y}



Can we do this? 

Relational databases …

19 July 2007

Relations

Binary Relation Induced by a Partition



Let A1,A2,…,An be a partition of A 

Let relation R: A

×

A be defined as:

{(x,y)

A

×

A |

i 1

i≤

n x

A

∧i

y

A

}i



A = {1,2,3,4,5,6,7} 

A

1

= {1,2,3}; A

2

=

{4,5}

; A

3

=

{6,7}



R = {(1,1),(2,2),(3,3),(1,2),(1,3),(2,3),(2,1),(3,2),(3,1),^ (4,4),(4,5),(5,4),(5,5)

,(6,6),(6,7),(7,6),(7,7)

}



Note that this (or any partition-induced relation) isreflexive, symmetric, and transitive

19 July 2007

Relations

Examples



R: X
X

X={a,b,c,d,e,f}



{(a,a),(b,b),(c,c),(d,d),(e,e),(f,f),(a,e),(a,d),(d,a)(d,e),(e,a),(e,d),(b,f),(f,b)} 

Lemma 10.3.

If A is a set and R is an

equivalence relation on A and x and y areelements of A, then either

[x]

[y] =

or

[x]=[y]

19 July 2007

Relations

Example



R(x,y); R:

Z
Z

{(x,y)

Z
×
Z

| 3|(x – y)}



How many equivalence classes are there? 

[a] = {x

Z

| R(x,a)}

= {x

Z

n

Z

such that x = 3n + a}



Classes are: [0], [1], [2]