100% found this document useful (1 vote)
176 views32 pages

Relations

This document discusses relations and binary relations. It begins by explaining that a binary relation between two sets A and B can be described using ordered pairs with the first element from A and the second from B. It then defines a binary relation more formally as a subset of the Cartesian product A × B. An example relation is given describing which people drive which cars. The document goes on to discuss several properties of relations including reflexive, symmetric, transitive, and equivalence relations. It also covers representing relations using digraphs and the equivalence classes that arise from equivalence relations.

Uploaded by

Bhad Guy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
176 views32 pages

Relations

This document discusses relations and binary relations. It begins by explaining that a binary relation between two sets A and B can be described using ordered pairs with the first element from A and the second from B. It then defines a binary relation more formally as a subset of the Cartesian product A × B. An example relation is given describing which people drive which cars. The document goes on to discuss several properties of relations including reflexive, symmetric, transitive, and equivalence relations. It also covers representing relations using digraphs and the equivalence classes that arise from equivalence relations.

Uploaded by

Bhad Guy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Relations

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.
• A relation is a set of ordered pairs.
Relations
 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.
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}
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.
Functions as Relations
A function f from a set A to a set B assigns a unique
element of B to each element of A.
In otherwords, if f : A → B, we identify f with the set:
Rf ={(a, b) є A → B : b =f(a)}, which is a relation from A to B.
The graph of f is the set of ordered pairs (a, b) such that b
= f(a).
Since the graph of f is a subset of AB, it is a relation from
A to B.
Moreover, for each element a of A, there is exactly one
ordered pair in the graph that has a as its first element.
Functions as Relations
Conversely, if R is a relation from A to B such that every
element in A is the first element of exactly one ordered pair
of R, then a function can be defined with R as its graph.

This is done by assigning to an element aA the unique


element bB such that (a, b)R.

Not all relations are functions.


Relations on a Set
Definition: A relation on the set A is a relation from A to
A.
In other words, a relation on the set A is a subset of AA.

Example: Let A = {1, 2, 3, 4}. Which ordered pairs are in


the relation R = {(a, b) | a < b} ?
Relations on a Set
Solution: R = { (1, 2), (1, 3), (1, 4), (2, 3),(2, 4),(3, 4)}
1 1 R 1 2 3 4

1 X X X
2 2
2 X X
3 3 3 X
4
4 4
Properties of Relations
We will now look at some useful ways to classify relations.
A relation R is reflexive if, we observe that for all values a:
aRa
In other words, all values are related to themselves.
The relation of equality, "=" is reflexive.
Eg: Let A = {1,2,3,4}
R1 ={(1,1),(1,2),(2,2),(2,3),(3,3),(4,4)}
R1 is reflexive
R2 = {(1,1),(2,2),(3,3)}
 R2 is not reflexive (why?)
Note that ≤ is also reflexive (a ≤ a for any a in R). On the other
hand, the relation < is not (a < a is false for any a in R).
Properties of Relations
A relation R is symmetric if, we observe that for all values
a and b: a R b implies b R a.
The relation of equality again is symmetric. If x=y, we can
also write that y=x also.
Neither ≤ nor < is symmetric.
Eg: Let A = {1,2,3}
R1 ={(1,2),(2,1),(1,3),(3,1)}
R1 is symmetric
R2 = {(1,1),(2,2),(3,3),(2,3)}.
 R2 is not symmetric because (3,2)  R2
Properties of Relations
 A relation R is antisymmetric if we observe that for
all values a and b: a R b and b R a implies that a=b
 Notice that antisymmetric is not the same as "not
symmetric."
 Take the relation greater than or equals to, "≥" If x ≥ y,
and y ≥ x, then y must be equal to x. a relation is anti-
symmetric if and only if aєA, (a,a)єR
 If a ≤ b, and b ≤ a, then a must be equal to b. So ≤ is
antisymmetric
 Eg: Let A = {0,1,2}
R2 = {(0,0),(0,1),(0,2),(1,1),(1,2)}. R2 is antisymmetric
Properties of Relations
A relation is transitive if for all values a, b, c:
a R b and b R c implies a R c
The relation greater-than ">" is transitive. If x > y, and y >
z, then it is true that x > z.
Let A = {1,2,3,4}
 R = {(2,1),(3,1),(3,2),(4,1),(4,2),(4,3)}
R is transitive because
(3,2) & (2,1) → (3,1)
(4,2) & (2,1) → (4,1)
(4,3) & (3,1) → (4,1)
(4,3) & (3,2) → (4,2)
Combining Relations
Relations are sets, and therefore, we can apply the usual set
operations to them.

If we have two relations R1 and R2, and both of them are
from a set A to a set B, then we can combine them to R1  R2,
R1  R2, or R1 – R2.

In each case, the result will be another relation from A to


B.
Combining Relations
… and there is another important way to combine relations.
Definition: Let R be a relation from a set A to a set B and S
a relation from B to a set C. The composite of R and S is the
relation consisting of ordered pairs (a, c), where aA, cC,
and for which there exists an element bB such that (a,
b)R and (b, c)S. We denote the composite of R and S by
SR.
In other words, if relation R contains a pair (a, b) and
relation S contains a pair (b, c), then SR contains a pair (a,
c).
Combining Relations
Example: Let D and S be relations on A = {1, 2, 3, 4}.
D = {(a, b) | b = 5 - a} “b equals (5 – a)”
S = {(a, b) | a < b} “a is smaller than b”
D = {(1, 4), (2, 3), (3, 2), (4, 1)}
S = {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}

SD = { (2, 4), (3, 3), (3, 4), (4, 2),(4, 3),(4, 4)}
D maps an element a to the element (5 – a), and afterwards
S maps (5 – a) to all elements larger than (5 – a), resulting in
SD = {(a,b) | b > 5 – a} or SD = {(a,b) | a + b > 5}.
n-ary Relations
Definition: Let A1, A2, …, An be sets. An n-ary relation on
these sets is a subset of A1A2…An.

The sets A1, A2, …, An are called the domains of the


relation, and n is called its degree.
n-ary Relations
Example:
Let R = {(a, b, c) | a = 2b and b = 2c with a, b, cN}
What is the degree of R?
The degree of R is 3, so its elements are triples.
What are its domains?
Its domains are all equal to the set of integers.
Is (2, 4, 8) in R?
No.
Is (4, 2, 1) in R?
Yes.
Converse Relations
 Consider R  AB, the converse relation R is the
relation from B to A defined by:
(b, a) є R if and only if (a, b) є R
 Since every function f : A→B is a relation, its converse f
always exists:
 As a relation f ={(b, a) є B → A : a =f(b)}
Representing Relations Using Digraphs
Definition: A directed graph, or digraph, consists of a
set V of vertices (or nodes) together with a set E of ordered
pairs of elements of V called edges (or arcs).
The vertex a is called the initial vertex of the edge (a, b),
and the vertex b is called the terminal vertex of this edge.

We can use arrows to display graphs.


Representing Relations Using Digraphs
Example: Display the digraph with V = {a, b, c, d},
E = {(a, b), (a, d), (b, b), (b, d), (c, a), (c, b), (d, b)}.

a
b

d c

An edge of the form (b, b) is called a loop.


Equivalence Relations
Equivalence relations are used to relate objects that are
similar in some way.

Definition: A relation on a set A is called an equivalence


relation if it is reflexive, symmetric, and transitive.

Two elements that are related by an equivalence relation R


are called equivalent.
Several notations are used for equivalence: a~b, ab, and a
b
Equivalence Relations
Since R is symmetric, a is equivalent to b whenever b is
equivalent to a.

Since R is reflexive, every element is equivalent to itself.

Since R is transitive, if a and b are equivalent and b and c


are equivalent, then a and c are equivalent.
Equivalence Relations
Example: Suppose that R is the relation on the set of
strings that consist of English letters such that aRb if and
only if l(a) = l(b), where l(x) is the length of the string x. Is R
an equivalence relation?
Solution:
 R is reflexive, because l(a) = l(a) and therefore
aRa for any string a.
 R is symmetric, because if l(a) = l(b) then l(b) =
l(a), so if aRb then bRa.
 R is transitive, because if l(a) = l(b) and l(b) = l(c),
then l(a) = l(c), so aRb and bRc implies aRc.
R is an equivalence relation.
Equivalence Relations
 Example: We say that m is congruent to n modulo p
written as m  n (mod p) provided m - n is a multiple
of p (congruent relation on Z).
 m  m (mod p) for all m є Z, Reflexive
 m  n (mod p) implies n  m (mod p), Symmetric
 m  n (mod p) and n  r (mod p) imply m  r (mod p),
Transitive
Equivalence Classes
Definition: Let R be an equivalence relation on a set A.
The set of all elements that are related to an element a of A
is called the equivalence class of a.
The equivalence class of a with respect to R is denoted by
[a]R.
When only one relation is under consideration, we will
delete the subscript R and write [a] for this equivalence
class.
If b[a]R, b is called a representative of this equivalence
class.
Equivalence Classes
Example: In the previous example (strings of identical
length), what is the equivalence class of the word mouse,
denoted by [mouse] ?

Solution: [mouse] is the set of all English words


containing five letters.

For example, ‘horse’ would be a representative of this


equivalence class.
Partitions &Equivalence Classes
Theorem: Let R be an equivalence relation on a set A. The
following statements are equivalent:
 aRb
 [a] = [b]
 [a]  [b]  
Definition: A partition of a set S is a collection of disjoint
nonempty subsets of S that have S as their union. In other
words, the collection of subsets Ai, iI, forms a partition of S if
and only if
(i) Ai   for iI
 Ai  Aj = , if i  j
 iI Ai = S
Partitions &Equivalence Classes
Examples: Let S be the set {u, m, b, r, o, c, k, s}.
Do the following collections of sets partition S ?
{{m, o, c, k}, {r, u, b, s}} yes.

{{c, o, m, b}, {u, s}, {r}} no (k is missing).

{{b, r, o, c, k}, {m, u, s, t}} no (t is not in S).

{{u, m, b, r, o, c, k, s}} yes.

{{b, o, o, k}, {r, u, m}, {c, s}} yes ({b,o,o,k} = {b,o,k}).

{{u, m, b}, {r, o, c, k, s}, } no ( not allowed).


Partitions &Equivalence Classes
Theorem: Let R be an equivalence relation on a
set S. Then the equivalence classes of R form a partition
of S. Conversely, given a partition {Ai | iI} of the set S, there
is an equivalence relation R that has the sets Ai, iI, as its
equivalence classes.
Partitions &Equivalence Classes
Example: Let us assume that Frank, Suzanne and George
live in Boston, Stephanie and Max live in Lübeck, and
Jennifer lives in Sydney.
Let R be the equivalence relation {(a, b) | a and b live in
the same city} on the set P = {Frank, Suzanne, George,
Stephanie, Max, Jennifer}.
Then R = {(Frank, Frank), (Frank, Suzanne),
(Frank, George), (Suzanne, Frank), (Suzanne, Suzanne),
(Suzanne, George), (George, Frank),
(George, Suzanne), (George, George), (Stephanie,
Stephanie), (Stephanie, Max), (Max, Stephanie),
(Max, Max), (Jennifer, Jennifer)}.
Partitions &Equivalence Classes
Then the equivalence classes of R are:
{{Frank, Suzanne, George}, {Stephanie, Max}, {Jennifer}}.
This is a partition of P.

The equivalence classes of any equivalence relation R


defined on a set S constitute a partition of S, because every
element in S is assigned to exactly one of the equivalence
classes.
Review questions
1. Let R2 be the relation on {1,2,3,4,5} defined by mR2n
if and only if m - n is even. Draw a picture for this
relation.
2. Similarly, obtain a picture of the converse relation
R2 . Compare this with the picture of R2.

3. Let R1 and R2 be relations from a set S to a set T


i. Show that (R1  R2) = R1  R2
ii. Show that (R1  R2) = R1  R2
iii. Show that if R1  R2 then R1  R2

You might also like