0% found this document useful (0 votes)
27 views19 pages

Lecture 7 (II) CSC510 Relations

The document discusses relations and their properties. It defines what a relation is as a set of n-tuples where all n-tuples satisfy a certain n-ary predicate. It then discusses different ways to represent relations including roster notation, digraphs, tabular form, and set builder notation. The rest of the document covers properties of relations such as being reflexive, symmetric, transitive, and their implications for defining equivalence relations, partial orders, and total orders.

Uploaded by

2023400072
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
0% found this document useful (0 votes)
27 views19 pages

Lecture 7 (II) CSC510 Relations

The document discusses relations and their properties. It defines what a relation is as a set of n-tuples where all n-tuples satisfy a certain n-ary predicate. It then discusses different ways to represent relations including roster notation, digraphs, tabular form, and set builder notation. The rest of the document covers properties of relations such as being reflexive, symmetric, transitive, and their implications for defining equivalence relations, partial orders, and total orders.

Uploaded by

2023400072
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
You are on page 1/ 19

SET and RELATIONS

RELATION

▶ We often use relations to order some or all of the elements


of sets.
For instance:
▶ we order words using the relation containing pairs of words
(x, y), where x comes before y in the dictionary.
▶ We schedule projects using the relation consisting of pairs
(x, y), where x and y are tasks in a project such that x
must be completed before y begins.
▶ We order the set of integers using the relation containing
the pairs (x, y), where x is less than y.
RELATION

▶ Relation is a set of n-tuples


▶ All sets of n-tuples satisfying a certain n-ary predicate define a n-ary
relation.
e.g L = {(a,b)| likes_fruit(a,b) 𝖠 a ∈ Person 𝖠 b ∈ Fruit }
L : Person L Fruit @ Person x Fruit
▶ Let A and B be sets. A binary relation from A to B is a subset of A × B.
R : A R B; R = {(a,b)| a ∈ A and b ∈ B} where R is a subset of A x B
▶ a R b denotes that (a, b) ∈ R
▶ a R b denotes that (a, b) ∈ R
▶ when (a, b) belongs to R, a is said to be related to b by R.
RELATION

Representing a relation:
1) Roster notation
2) Digraph (Arrow diagram)
3) Tabular/matrices form
4) Set builder notation
RELATION
1) Roster notation

Let A be the set {1, 2, 3, 4}. Which ordered pairs are in the relation R = {(a, b) |
a divides b}?

Solution: Because (a, b) is in R if and only if a and b are positive integers not
exceeding 4 such that a divides b, we see that
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
RELATION
2) Digraph (Arrow diagram)
R = {(1, 1), (1, 3), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (4, 1)}
RELATION
3) Tabular/matrices form
R = {(a1, b2), (a2, b1), (a2, b3), (a2, b4), (a3, b1), (a3, b3), (a3, b5)}.
RELATION
4) Set builder notation
Consider these relations on the set of integers:
R1 = {(a, b) | a ≤ b},
R2 = {(a, b) | a > b},
R3 = {(a, b) | a = b or a = −b},
R4 = {(a, b) | a = b},
R5 = {(a, b) | a = b + 1},
R6 = {(a, b) | a + b ≤ 3}.
Which of these relations contain each of the pairs (1, 1), (1, 2), (2, 1), (1,−1), and (2, 2)?
Solution:
(1, 1) - R1, R3, R4, R6
(1, 2) - R1, R6
(2, 1) - R2, R5, R6
(1,−1) - R2, R3, R6
(2, 2) - R1, R3, R4.
RELATION

▶ Theorem: Number of binary relations on a set A, where |A| = n is

Proof:
If |A| = n then |A x A| = n2
▶ R is a binary relation on A if R ⊆ A x A
▶ The number of subsets of A x A = 2|A xA| =
Properties of Relations

▶ Reflexive Relations
▶ Irreflexive Relations
▶ Symmetric Relations
▶ Antisymmetric Relations
▶ Transitive Relations
Reflexive Relations
▶ A relation R on a set A is called reflexive if (a, a) ∈ R for every element a ∈ A.
▶ ∀a((a, a) ∈ R), where the universe of discourse is the set of all elements in A.
▶ A is reflexive if every element of A is related to itself
Example: Consider the following relations on {1, 2, 3, 4}:
R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
R2 = {(1, 1), (1, 2), (2, 1)},
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)},
R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)},
R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)},
R6 = {(3, 4)}.

Which of these relations are reflexive?


R3 and R5 - both contain (1, 1), (2, 2), (3, 3), and (4, 4)
Irreflexive Relations
▶ A relation R on a set A is called irreflexive if (a, a) ∈ R for every element a ∈
A.

Example: Consider the following relations on {1, 2, 3, 4}:


R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
R2 = {(1, 1), (1, 2), (2, 1)},
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)},
R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)},
R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)},
R6 = {(3, 4)}.

Which of these relations are irreflexive?


R1, R2 , R4 and R6 – does not contain (1, 1), (2, 2), (3, 3), and (4, 4)
Symmetric Relations
▶ A relation R on a set A is called symmetric if (b, a) ∈ R whenever (a, b) ∈ R, for all a, b
∈ A.

Example: Consider the following relations on {1, 2, 3, 4}:


R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
R2 = {(1, 1), (1, 2), (2, 1)},
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)},
R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)},
R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)},
R6 = {(3, 4)}.

Which of these relations are symmetric?


R2 and R3 are symmetric, because in each case (b, a) belongs to the relation whenever (a,
b) does.
Antisymmetric Relations
▶ A relation R on a set A such that for all a, b ∈ A, if (a, b) ∈ R and (b, a) ∈ R,
then a = b is called antisymmetric

Example: Consider the following relations on {1, 2, 3, 4}:


R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
R2 = {(1, 1), (1, 2), (2, 1)},
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)},
R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)},
R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)},
R6 = {(3, 4)}.

Which of these relations are antisymmetric?


R4, R5, and R6 - in each of these relations there is no pair of elements a and b
with a = b such that both (a, b) and (b, a) belong to the relation
Transitive Relations
▶ A relation R on a set A is called transitive if whenever (a, b) ∈ R and (b, c) ∈
R, then (a, c) ∈ R, for all a, b, c ∈ A.
Example: Consider the following relations on {1, 2, 3, 4}:
R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
R2 = {(1, 1), (1, 2), (2, 1)},
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)},
R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)},
R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)},
R6 = {(3, 4)}.

Which of these relations are transitive?


R4, and R5,
Types of Relations

▶ A relation, R on a set A is called an equivalence relation if it is reflexive,


symmetric, and transitive.
▶ Ordered :
▶ A relation, R on a set A is a weak order relation if it is reflexive, antisymmetric,
and transitive.
▶ A relation, R on a set A is a strict order relation if it is irreflexive, antisymmetric,
and transitive.
▶ Neither equivalence nor ordered
Partial Orderings
▶ A relation R on a set S is called a partial ordering or partial order if it is
reflexive, antisymmetric, and transitive.
▶ A set S together with a partial ordering R is called a partially ordered set, or
poset, and is denoted by (S, R). Members of S are called elements of the
poset. The notation a b is used to denote that (a, b) ∈ R in an arbitrary
poset (S,R)
▶ The symbol is used to denote the relation in any poset.
Partial Orderings

Example: Show that the “greater than or equal” relation (≥) is a partial ordering
on the set of integers.
Solution:
Because a ≥ a for every integer a, ≥ is reflexive.
If a ≥ b and b ≥ a, then a = b. Hence, ≥ is antisymmetric.
Finally, ≥ is transitive because a ≥ b and b ≥ c imply that a ≥ c.
It follows that ≥ is a partial ordering on the set of integers and (Z, ≥) is a poset.
Total Orderings
▶ The elements a and b of a poset (S, ) are called comparable if either a b
or b a
▶ When a and b are elements of S such that neither a b nor b a, a and b
are called incomparable.
▶ If (S, ) is a poset and every two elements of S are comparable, S is called a
totally ordered or linearly ordered set, and is called a total order or a
linear order.

Example:
The poset (Z,≤) is totally ordered, because a ≤ b or b ≤ a whenever a and b are
integers.

The poset (Z+, | ) is not totally ordered because it contains elements that are
incomparable, such as 5 and 7.

You might also like