




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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
1 / 28
This page cannot be seen from the preview
Don't miss anything!





















Relations
19 July 2007
Relations
The most basic relation is “=” (e.g. x = y)
Generally x R y
TRUE or FALSE
some set A to some set B, where x
∈
A and
y∈
B
19 July 2007
Relations
(Binary) relation from A to Bwhere x
A, y
B, (x,y)
×
B and R
xRy
(x,y)
Finite example: A={1,2}, B={1,2,3}
Infinite example: A = Z and B = Z
aRb
a-b
even
19 July 2007
Relations
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?
What if A and B were the set of all integers?
∈
Z
×Z
|
∃
k∈
Z
such that x – y = 2k + 1}
19 July 2007
Relations
Define a relation of A called R
(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
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
19 July 2007
Relations
Define R(x,y) R:
to be
{(x,y)
| x|y}
Prove whether or not this is:
19 July 2007
Relations
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
=?
'
−
1
19 July 2007
Relations
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
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
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
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
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
R(x,y); R:
{(x,y)
| 3|(x – y)}
How many equivalence classes are there?
[a] = {x
| R(x,a)}
= {x
n
such that x = 3n + a}
Classes are: [0], [1], [2]