Week 18 - Relations B
9.201 Equivalence relations and equivalence classes
- Definition of Equivalence Relation
- Let R be a relation of elements on a set S. R is an equivalence relation if and only if R is reflexive, symmetric and transitive.
- Example 1
- Let R be relation of elements in Z:
- We have already proved that this relation is:
- Reflexive as a
- Symmetric as if a R b then b R a, \forall a, b \in Z
- Transitive as if a R b and b R c then a R c, \forall a, b, c \in Z
- This is an equivalence relationship.
- Let R be relation of elements in Z:
- Example 2
- Let R be a relation of elements in Z:
- Already proved relationship is :
- Reflex as a R a for all a in Z
- Transitive as if and then ,
- Not symmetric as but
- This is not equivalence.
- Let R be a relation of elements in Z:
- Definition of Equivalence Class
- Let R be an equivalence relation on a set S. Then, the equivalence class of a \in S is:
- a subset of S containing all the elements related to a through R.
- Let R be an equivalence relation on a set S. Then, the equivalence class of a \in S is:
- Example 1
- Let and R be a relation on elements in S:
- R is an equivalence relation with 2 equivalence classes:
- `[1] = [3] = {1, 3}
[2] = [4] == {2, 4}
- Let and R be a relation on elements in S:
- Example 2
- Let and R be relation of elements in Z:
- R = { (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (2, 4), (4, 2), (1, 3), (3, 1), (1, 5), (5, 1), (3, 5), (5, 3) }
- R is an equivalence relation with 2 equivalence classe:
[1] = [3] = [5] = {1, 3, 5}
[2] = [4] = {2, 4}
- Let and R be relation of elements in Z:
9.203 Partial and total order
- Definition of a Partial Order.
- Let be a relation on elements in set . is a partial order if and only if is:
- reflexive
- anti-symmetric
- transitive.
- Example 1
- Let R be a relation of elements in Z:
- It can easily be proved that R is:
- reflexive as ,
- transitive as if and then ,
- anti-symmetric as if and then ,
- Therefore, R is a partial order.
- Let R be a relation of elements in Z:
- Example 2
- Let be a relation of elements in Z+:
- It can easily be proven that R is:
- reflexitive as a divides
- transitive as if and then ,
- anti-symmetric as if and then ,
- Therefore, R is a partial order.
- Let be a relation of elements in Z+:
- Let be a relation on elements in set . is a partial order if and only if is:
- Definition of a Total Order
- Let R be a relation on elements in a set S.
- R is a total order if and only if:
- R is a partial order
- we have either or .
- Example 1
- Let R be a relation of elements in Z:
- It has been shown that R is a partial order.
- Also, , or is true.
- Let R be a relation of elements in Z:
- Example 2
- Let R be a relation on elements in Z+:
- We proved R is a partial order
- However, Z* contains elements that are incomparable, such as 5 and 7.
- R is not totally ordered.
- Let R be a relation on elements in Z+:
Peer-graded Assignment: 9.207 Relations
Question
Let R be a relation on given by if and only if is divisible by 3. Show that this relation is an equivalence relation and find its corresponding equivalence classes.
Answer
To prove has an equivalence relationship, we must show it's reflexive, symmetric and transitive.
We know it's reflexive, because for any integer , which is divisible by 3.
We know it's symmetric, because . If is divisible by three, is also divisible by three.
When know it's transitive, where and therefore , because we know , so when and are both divisible by 3, will also be divisible by 3.
To find the corresponding equivalence classes, we must find all integers related to a given .
Suppose is related to , then is divisible by 3. That means that all means they have the same residual mod 3.
There are 3 residual mods possible: 0, 1, 2.
Therefore we can assign the integers into these equivalence classes:
However, 1 and 2 are the same. So it's only 2 equivalence classes.
Peer Review
Question 1
1. Reflexive
is reflexive if ,
Example: Equality is reflexive, but < is not reflexive.
2. Symmetric
is symmetric if , if then .
Example: a marriage is symmetric, but is parent of is not symmetric.
3. Anti-symmetric
is anti-symmetric if , if and then x = y
Example: * subset ($\subseteq$) is antisymmetric relation. If x is a subset of y, and y is a subset of x, then by definition x = y. * an ancestor. If x is an ancestor or y, and y is an ancestor of y, they must be the same person.
Counterexample: * marriage from above. a husband is related to his wife, the wife is related to the husband, but they are not the same.
4. Transitive
is transitive if , if and then
Example: is in immediate family is transitive, is a parent is not.
5. An equivalence relation.
is an equivalence relation if it is reflexive, symmetric and transitive.
Example: * is equal to on the set of real number is an equivalence relation. * is less or equal ($\leq$) is not equivalence relation.
6. A partial order.
is a partial order if it is reflexive, antisymmetric and transitive
Example:
The relationship divides on the set of positive integers (natural numbers ), is reflexive, antisymmetric and transitive. But the same relation applied to the set of integers is not antisymmetric since and but
Question 2
Let and
Define a relation on by "$x$ is related to whenever "
- Draw the relationship digraph
- The relationship is not reflexive. What pair (x, y) should be added to to make refexive?
(a, a)
Correct
- The relationship is not symmetric. What pair (x, y) should be added to A to make R symmetric?
(b, a)
Correct
- The relation R is not anti-symmetric. What pair (x, y) should be removed to make R anti-symmetric?
(b, c) or (c, b)
Right now b R c and c R b but b != c
Correct
- The relation R is not transitive. What pair (x, y) should be added to A to make R transitive?
(a, c)
Correct
Question 3
The following relations are defined on a set S = {a, b, c}
is the relation given by is given by is given by is given by
Reflexive | Symmetric | Antisymmetric | Transitive | Equivalence Relation | Partial Order | |
---|---|---|---|---|---|---|
R_1 | Y | Y | N | N | N | N |
R_2 | Y | Y | N | Y | Y | N |
R_3 | N | Y | N | N | Y | N |
R_4 | Y | N | Y | Y | N | Y |
Note, that is considered transitive. We have (a, b) and (b, a) therefore we need (a, a) which we have. is not considered transtive. We have (a, b) and (b, a) therefore we need (a, a) to be transitive, which is missing.
is the only equivalence relation. a related to b c related to c only.
So there are equivalence classes.
Question 4
Let and let P be the partition on S given by =
Define to be the equivalence relation associated to .
-
Give 2 conditions for to be a partition.
-
Let be the subsets of . P is a partition as each subset ,
-
We also know that is a partition as
-
Draw the relationship digraph.
On paper. It's 3 disjointed graphs.
- Write down the equivalence class [5] as a set.
Apparently it's {2, 5, 8}
So the equivalence class refers to the elements that are in the same class?
Question 5
Let and let be a relation on S defined as follows:
whenever
Show that is an equivalence relation.
- R is reflexive. As ,
- R is symmetric as if then ad = bc AND cb = da then
- R is transitive as . and => ad = bc and cf = de => cbde = dacf => be = af =>
Define the equivalence class generated by for and
Question 6
Let A and B be two sets where:
and
.
Let R be a relation defined from A to B, given by when b is a national language of a.
The national language of each of the countries is as follows:
- French for France
- German for Germany
- English for England
- Arabic for Morocco
- Switzerland has 2 national languages, French and German.
Find the logical matrix for the relation R.
French | Germany | English | Arabic | |
---|---|---|---|---|
French | 1 | 0 | 0 | 0 |
Germany | 0 | 1 | 0 | 0 |
England | 0 | 0 | 1 | 0 |
Morocco | 0 | 0 | 0 | 1 |
Switzerland | 1 | 1 | 0 | 0 |
Question 7
For each of the following relations on the set of all people, state if it is an equivalence relation. Explain your answer.
- R_1 = { (x, y) | x and y are the same height }
R_1 is flexive as every is the same height as itself, or: R_1 is symmetic as if then R_1 is transitive as if and then
Therefore, this is an Equivalence Relationship.
Correct
- R_2 = { (x, y) | x and y have, at some point, lived in the same country. }
R_2 is reflexive as . lives in the same country as itself. R_2 is symmetric as if ie x and y where in the same country, then , as again, they must be in the same country. R_2 is NOT transitive. If x, y both lived in Australia, and y, z both lived in Malaysia, it does not imply x lived in the same country.
Therefore, it is NOT an Equivalence Relationship.
Correct
- R_3 = { (x, y) | x and y have the same first name }
is reflexive. is symmetric. is transitive.
Therefore, is an equivalence relationship.
- R_4 = { (x, y) | x is taller than y }
R_4 is not reflexive as x is not taller than x.
Therefore, it it not an equivalence relationship.
- R_5 = { (x, y) | x and y have the same colour hair }
R_5 is reflexive. x R x R_5 is symmetric. x R y and y R x R_5 is transitive. x R y and y R z therefore x R y
Therefore, it is an equivalence relationship.
Question 8
Let S = { {1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}, {1, 2, 3, 4, 5}}
X is related to Y whenever
- Draw the relationship digraph.
-
Determine whether or not is reflexive, symmetric, antisymmetric or transitive. Give a brief justification for each of your answers.
-
R is reflexive as , for example
- R is NOT symmetric. if then is NOT true. For example,
- R is anti-symmetric. if and then .
-
R is transitive. If and , then
-
State, with reasons, whether or not is an equivalence relation, whether or not it is a partial order and whether or not it is a total order.
R is not an equivalence relation as it is NOT symmetric. R is a partial order as it is reflexive, anti-symmetric and transitive. R is a total order, as it is a partial order and every 2 elements are comparable. we have either or .
Question 9
Let and let be given by:
A relation on is defined by:
is related to whenever
- Draw the relationship digraph
-
Determine whether or not is reflexive, symmetric, antisymmetric or transitive. Give brief justification of each answer.
-
is reflexive as ,
- is symmetric as , if then
- is NOT anti-symmetric as , if and , it DOES NOT imply
- is transitive. , if and , then
is a equivalence relationship as it is reflexive, symettric and transitive. is not a partial order as it is NOT anti-symmetric. is not a total order as it is NOT a partial order.
Question 10
Let be a relation from a set to a set . The inverse of , denoted , is the relation from to defined by
Given a relation from to defined by if divides .
Elements: (2, 4), (2, 6), (3, 3), (3, 6), (4, 4)
of
3 | 4 | 5 | 6 | 7 | |
---|---|---|---|---|---|
2 | 0 | 1 | 0 | 1 | 0 |
3 | 1 | 0 | 0 | 1 | 0 |
4 | 0 | 1 | 0 | 0 | 0 |
Elements : (4, 2), ( 6, 2), (3, 3), (6, 3), (4, 4)
2 | 3 | 4 | |
---|---|---|---|
3 | 0 | 1 | 0 |
4 | 1 | 0 | 1 |
5 | 0 | 0 | 0 |
6 | 1 | 1 | 0 |
7 | 0 | 0 | 0 |
Question 11
Let and be the relations on a set given by:
- Find the matrix representation and that of .
1 | 2 | 3 | 4 | |
---|---|---|---|---|
1 | 1 | 1 | 0 | 0 |
2 | 0 | 0 | 0 | 1 |
3 | 0 | 0 | 0 | 1 |
4 | 0 | 1 | 0 | 0 |
1 | 2 | 3 | 4 | |
---|---|---|---|---|
1 | 1 | 0 | 0 | 0 |
2 | 0 | 1 | 0 | 0 |
3 | 0 | 1 | 0 | 0 |
4 | 0 | 1 | 0 | 1 |
- Find the matrix of the intersection of both matrices in (1).
1 | 2 | 3 | 4 | |
---|---|---|---|---|
1 | 1 | 0 | 0 | 0 |
2 | 0 | 0 | 0 | 0 |
3 | 0 | 0 | 0 | 0 |
4 | 0 | 1 | 0 | 0 |
- Find the matrix of the union of both matrices in (1).
1 | 2 | 3 | 4 | |
---|---|---|---|---|
1 | 1 | 1 | 0 | 0 |
2 | 0 | 1 | 0 | 1 |
3 | 0 | 1 | 0 | 1 |
4 | 0 | 1 | 0 | 1 |
- List the elements of
- List the elemnts of
Question 12
Let be a relation on set .
- How can we quickly determine whether a relation R is reflexive by examining the matrix of ?
- How can we quickly determine whether a relation R is symmetrix by examining the matrix of R?
- How can we quickly determiner whether a relation R is anti-symmetric by examining the matrix of R?