Relation Discrete Math 17
Relation Discrete Math 17
QUESTION:
b) ∈ R if and only if
List the ordered pairs in the relation R from A = {0, 1, 2, 3, 4} to B = {0, 1, 2, 3}, where (a,
a) a = b. b) a + b = 4.
c) a > b. d) a | b.
e) gcd(a, b) = 1 . f ) lcm(a, b) = 2.
ANSWER:
a) a = b:
b) a + b = 4:
R = {(0, 4) - Not possible since 4 ∉ B, (1, 3), (2, 2), (3, 1), (4, 0) - Not possible since 4 ∉ B}
c) a > b:
R = {(1, 0), (2, 0), (2, 1), (3, 0), (3, 1), (3, 2), (4, 0), (4, 1), (4, 2), (4, 3)}
d) a | b (a divides b):
R = {(0, 0), (1, 1), (1, 2), (1, 3), (2, 2), (2, 0), (3, 3), (3, 0)}
R = {(0, 1), (0, 2), (0, 3), (1, 0), (1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2), (3, 4) - Not possible since 4 ∉ B,
(4, 1), (4, 3)}
Corrected R = {(0, 1), (0, 2), (0, 3), (1, 0), (1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2), (4, 1), (4, 3)
Note that for (b), (e), and (f), I've removed pairs with 4 since 4 ∉ B.
QUESTION:
a) List all the ordered pairs in the relation R = {(a, b) | a divides b} on the set {1, 2, 3, 4, 5,
6}.
ANSWER:
a) Ordered Pairs:
R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6),
(4, 4),
(5, 5),
(6, 6)}
b) Tabular Form:
| |1|2|3|4|5|6|
|---|---|---|---|---|---|---|
|1|×|×|×|×|×|×|
|4| | | |×| | |
|5| | | | |×| |
|6| | | | | |×|
In the table:
× indicates (a, b) ∈ R
QESTION:
For each of these relations on the set {1, 2, 3, 4}, decide whether it is reflexive, whether it is
symmetric, whether it is antisymmetric, and whether it is transitive.
a) {(2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4)}
b) {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
f ) {(1, 3), (1, 4), (2, 3), (2, 4), (3, 1), (3, 4)}
ANSWER:
a) {(2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4)}
- Transitive: No (e.g., (2, 3) and (3, 4) but (2, 4) is not guaranteed because of symmetry)
b) {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
- Transitive: No (e.g., (1, 2) and (2, 1) but (1, 1) is already guaranteed by reflexivity)
- Transitive: Yes (e.g., (1, 2) and (2, 3) implies (1, 3), although (1, 3) is not present, there's no
counterexample)
- Symmetric: Yes (for every (a, b), (b, a) is also present, trivially)
f) {(1, 3), (1, 4), (2, 3), (2, 4), (3, 1), (3, 4)}
- Transitive: No (e.g., (1, 3) and (3, 1) implies (1, 1) which is not present)
QUESTION:
a) a is taller than b.
ANSWER:
a) a is taller than b:
- Transitive: Yes (if a is taller than b, and b is taller than c, then a is taller than c)
- Transitive: Yes (if a and b share a birthday, and b and c share a birthday, then a and c share a birthday)
c) a has the same first name as b:
- Symmetric: Yes (if a and b share a first name, b and a share a first name)
- Transitive: Yes (if a and b share a first name, and b and c share a first name, then a and c share a first
name)
- Transitive: No (if a and b share a grandparent, and b and c share a grandparent, it doesn't necessarily
imply a and c share a grandparent)
QUESTION:
a) everyone who has visitedWeb page a has also visited Web page b.
b) there are no common links found on both Web page a andWeb page b.
c) there is at least one common link onWeb page a and Web page b.
d) there is a Web page that includes links to both Web page a andWeb page b.
ANSWER:
a) everyone who has visited Web page a has also visited Web page b:
- Symmetric: No (if all visitors of a visited b, it doesn't imply all visitors of b visited a)
- Antisymmetric: Yes (if all visitors of a visited b, and all visitors of b visited a, then a and b have the
same visitors)
- Transitive: Yes (if all visitors of a visited b, and all visitors of b visited c, then all visitors of a visited c)
b) there are no common links found on both Web page a and Web page b:
- Symmetric: Yes (if a has no links in common with b, b has no links in common with a)
- Transitive: No (a has no links in common with b, b has no links in common with c, doesn't imply a has
no links in common with c)
c) there is at least one common link on Web page a and Web page b:
- Symmetric: Yes (if a has links in common with b, b has links in common with a)
- Transitive: No (a has links in common with b, b has links in common with c, doesn't imply a has links in
common with c)
d) there is a Web page that includes links to both Web page a and Web page b:
- Transitive: Yes (if a is linked with b, b is linked with c, then a is linked with c through the intermediate
page)
QUESTION:
c) x − y is a rational number.
d) x = 2y. e) xy ≥ 0.
f ) xy = 0. g) x = 1.
h) x = 1 or y = 1.
ANSWER:
a) x + y = 0:
- Reflexive: No (x + x ≠ 0 unless x = 0)
b) x = ±y:
c) x − y is a rational number:
- Reflexive: No (x ≠ 2x unless x = 0)
e) xy ≥ 0:
f) xy = 0:
g) x = 1:
- Reflexive: No (x ≠ 1 for x ≠ 1)
h) x = 1 or y = 1:
- Reflexive: No (x ≠ 1 or x ≠ 1 for x ≠ 1)
- Symmetric: Yes (x = 1 or y = 1 implies y = 1 or x = 1)
QUESTION:
a) x = y.
b) xy ≥ 1.
c) x = y + 1 or x = y − 1.
g) x = y2. h) x ≥ y2.
ANSWER:
a) x ≡ y:
- Reflexive: Yes (x ≡ x)
b) xy ≥ 1:
- Corrected Reflexive: No
c) x = y + 1 or x = y - 1:
- Reflexive: No (x ≠ x + 1 and x ≠ x - 1)
d) x ≡ y (mod 7):
e) x is a multiple of y:
- Reflexive: Yes
- Symmetric: Yes
- Antisymmetric: No
- Transitive: Yes
g) x = y^2:
h) x ≥ y^2:
QUESTION:
Show that the relation R = ∅on a nonempty set S is symmetric and transitive, but not
reflexive.
ANSWER:
Symmetric:
Transitive:
Thus, the implication "(x, y) ∈ R and (y, z) ∈ R imply (x, z) ∈ R" is also vacuously true.
Reflexive:
QUESTION:
Show that the relation R = ∅ on the empty set S = ∅ is reflexive, symmetric, and transitive.
ANSWER:
When S = ∅, R = ∅ satisfies:
Reflexive:
Symmetric:
- Reflexive
- Symmetric
- Transitive
QUESTION:
ANSWER:
- Symmetric: (x, y) ∈ R implies (y, x) ∈ R (trivially true since only reflexive pairs exist)
- Antisymmetric: (x, y) ∈ R and (y, x) ∈ R imply x = y (true since only reflexive pairs exist)
This relation is both symmetric and antisymmetric, and it's also reflexive and transitive.
QUESTION:
ANSWER:
QUESTION:
ANSWER:
Here's an example:
Let R be the relation "is a sibling of" on the set of all people.
- "is taller than" (on the set of people with unique heights)
QUESTION:
ANSWER:
Here's an example:
Let R be the relation "is a parent of" on the set of all people.
How many different relations are there from a set with m elements to a set with n
elements?
ANSWER:
The number of different relations from a set with m elements to a set with n elements is:
2^(mn)
To see why:
- Each element of the set with m elements can be related or not related to each element of the set with n
elements.
- There are mn pairs of elements (m choices from the first set, n choices from the second).
QUESTION:
a) R−1.
b) R.
ANSWER:
= {(b, a) | b > a}
R = {(a, b) | a < b}
QUESTION:
Let R be the relation R = {(a, b) | a divides b} on the set of positive integers. Find
a) R^−1.
b) R.
ANSWER:
= {(b, a) | b is a multiple of a}
R = {(a, b) | a divides b}
QUESTION:
Let R be the relation on the set of all states in the United States consisting of pairs (a, b)
where state a borders state b. Find
a) R−1.
b) R
ANSWER:
Given R = {(a, b) | state a borders state b} on the set of all states in the United States:
QUESTION:
relation that equals the graph of f . That is, R = {(a, f (a)) | a ∈ A}. What is the inverse
Suppose that the function f from A to B is a one-toone correspondence. Let R be the
relation R−1?
ANSWER:
R^(-1) = {(f(a), a) | a ∈ A}
R^(-1) is the inverse relation, which is also the graph of the inverse function f^(-1).
Proof:
This shows that R^(-1) is indeed the graph of f^(-1), the inverse function.
QUESTION:
Let R1 = {(1, 2), (2, 3), (3, 4)} and R2 = {(1, 1), (1, 2),(2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3),
(3, 4)} be relations from {1, 2, 3} to {1, 2, 3, 4}. Find
a) R1 ∪ R2.
b) R1 ∩ R2.
c) R1 − R2.
d) R2 − R1.
ANSWER:
a) R1 ∪ R2 (Union):
R1 ∪ R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), (3, 4)}
b) R1 ∩ R2 (Intersection):
R1 ∩ R2 = {(2, 3)}
c) R1 − R2 (Difference):
d) R2 − R1 (Difference):
R2 − R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 1), (3, 2), (3, 3)}
QUESTION:
Let A be the set of students at your school and B the set of books in the school library. Let
R1 and R2 be the relations consisting of all ordered pairs (a, b), where student a is required
to read book b in a course, and where student a has read book b, respectively. Describe the
ordered pairs in each of these relations.
a) R1 ∪ R2
b) R1 ∩ R2
c) R1 ⊕ R2
d) R1 − R2
e) R2 − R1
ANSWER:
a) R1 ∪ R2 (Union):
Ordered pairs (a, b) where student a is either required to read book b or has read book b (or both).
b) R1 ∩ R2 (Intersection):
Ordered pairs (a, b) where student a is required to read book b and has already read book b.
c) R1 ⊕ R2 (Symmetric Difference):
Ordered pairs (a, b) where student a is either required to read book b but hasn't read it yet or has read
book b but wasn't required to.
d) R1 − R2 (Difference):
Ordered pairs (a, b) where student a is required to read book b but hasn't read it yet.
e) R2 − R1 (Difference):
Ordered pairs (a, b) where student a has read book b but wasn't required to.
QUESTION:
Let R be the relation {(1, 2), (1, 3), (2, 3), (2, 4), (3, 1)}, and let S be the relation {(2, 1), (3,
1), (3, 2), (4, 2)}.Find S ◦R.
ANSWER:
To find S ◦ R (composition of relations), we match the second element of R with the first element of S:
R = {(1, 2), (1, 3), (2, 3), (2, 4), (3, 1)}
Matching:
Thus:
QUESTION:
Let R be the relation on the set of people consisting of pairs (a, b), where a is a parent of b.
Let S be the relation on the set of people consisting of pairs (a, b), where a and b are
siblings (brothers or sisters). What are S ◦R and R ◦ S?
ANSWER:
Given:
R = {(a, b) | a is a parent of b}
S ◦ R:
= {(a, c) | a is an aunt/uncle of c}
S ◦ R is the relation "is an aunt/uncle of".
R ◦ S:
R ◦ S includes:
QUESTION:
Q1. Find
a) R1 ∪ R3. b) R1 ∪ R5.
c) R2 ∩ R4. d) R3 ∩ R5.
e) R1 − R2. f ) R2 − R1.
g) R1 ⊕ R3. h) R2 ⊕ R4.
Q2. Find
a) R2 ∪ R4. b) R3 ∪ R6.
c) R3 ∩ R6. d) R4 ∩ R6.
e) R3 − R6. f ) R6 − R3.
g) R2 ⊕ R6. h) R3 ⊕ R5.
Q3 Find
a) R1 ◦ R1. b) R1 ◦ R2.
c) R1 ◦ R3. d) R1 ◦ R4.
e) R1 ◦ R5. f ) R1 ◦ R6.
g) R2 ◦ R3. h) R3 ◦ R3.
Q5 Find
a) R2 ◦ R1. b) R2 ◦ R2.
c) R3 ◦ R5. d) R4 ◦ R1.
e) R5 ◦ R3. f ) R3 ◦ R6.
g) R4 ◦ R6. h) R6 ◦ R6.
ANSWER:
ANS1
ANS2
d) R4 ∩ R6 = {(a, b) | a ≤ b and a ≠ b}
f) R6 − R3 = {(a, b) | a > b}
g) R2 ⊕ R6 = {(a, b) | a = b}
h) R3 ⊕ R5 = R3
ANS3
a) R1 ◦ R1 = R1 (greater than)
b) R1 ◦ R2 = R1
d) R1 ◦ R4 = R1
e) R1 ◦ R5 = R1
ANS4
b) R2 ◦ R2 = R2
c) R3 ◦ R5 = R3
e) R5 ◦ R3 = R3
QUESTION:
Let R1 and R2 be the “divides” and “is a multiple of” relations on the set of all positive
integers, respectively. That is, R1 = {(a, b) | a divides b} and R2 = {(a, b) | a
a) R1 ∪ R2.
b) R1 ∩ R2.
c) R1 − R2.
d) R2 − R1.
e) R1 ⊕ R2.
ANSWER:
a) R1 ∪ R2:
b) R1 ∩ R2:
This relation includes only pairs of identical numbers (e.g., (1, 1), (2, 2), ...).
c) R1 − R2:
{(a, b) | a is a multiple of b but a does not divide b} = {(a, b) | a > b and a is a multiple of b}
e) R1 ⊕ R2:
This relation includes pairs where a divides b or a is a multiple of b, excluding pairs where a = b.
QUESTION:
Let R1 and R2 be the “congruent modulo 3” and the “congruent modulo 4” relations,
respectively, on the set of integers. That is, R1 = {(a, b) | a ≡ b (mod 3)} and
Find
a) R1 ∪ R2.
b) R1 ∩ R2.
c) R1 − R2.
d) R2 − R1.
e) R1 ⊕ R2.
ANSWER:
a) R1 ∪ R2:
This relation includes pairs of integers where a and b have the same remainder when divided by either 3
or 4.
b) R1 ∩ R2:
This relation includes pairs of integers where a and b have the same remainder when divided by both 3
and 4, which implies a ≡ b (mod 12).
c) R1 − R2:
This relation includes pairs of integers where a and b have the same remainder modulo 3 but not modulo
4.
d) R2 − R1:
This relation includes pairs of integers where a and b have the same remainder modulo 4 but not modulo
3.
e) R1 ⊕ R2:
This relation includes pairs of integers where a and b have the same remainder modulo 3 or modulo 4,
excluding pairs where they have the same remainder modulo both.
QUESTION:
ANSWER:
1. ∅ (empty relation)
1. {(0, 1)}
2. {(1, 0)}
3. {(1, 1)}
14. {(0, 0), (0, 1), (1, 0), (1, 1)} (universal relation)
These relations can be classified based on properties like reflexivity, symmetry, transitivity, and
antisymmetry.
QUESTION:
How many of the 16 different relations on {0, 1} contain the pair (0, 1)?
ANSWER:
Eight relations out of the 16 different relations on {0, 1} contain the pair (0, 1):
1. {(0, 1)}
8. {(0, 0), (0, 1), (1, 0), (1, 1)} (universal relation)
QUESTION:
ANSWER:
QUESTION:
How many relations are there on a set with n elements that are
a) symmetric? b) antisymmetric?
c) asymmetric? d) irreflexive?
ANSWER:
a) Symmetric relations:
Each pair can be included or excluded, and diagonal pairs (x, x) can be included or excluded.
b) Antisymmetric relations:
Total antisymmetric relations = 2^n (choose whether each element is related to others)
c) Asymmetric relations:
d) Irreflexive relations:
QUESTION:
How many transitive relations are there on a set with n elements if
a) n = 1?
b) n = 2? c) n = 3?
ANSWER:
a) n = 1:
1. ∅ (empty relation)
b) n = 2:
- Empty relation
c) n = 3:
QUESTION:
Show that the relation R on a set A is symmetric if and only if R = R−1, where R−1 is the
inverse relation.
ANSWER:
To show that R is symmetric if and only if R = R^(-1), we'll prove both directions:
Assume R is symmetric.
Thus, R ⊆ R^(-1).
So, R^(-1) ⊆ R.
Combining: R = R^(-1)
Assume R = R^(-1).
Let (a, b) ∈ R.
R is symmetric.
QUESTION:
ANSWER:
To show that R is antisymmetric if and only if R ∩ R^(-1) ⊆ Δ, we'll prove both directions:
Assume R is antisymmetric.
Hence, R ∩ R^(-1) ⊆ Δ.
Assume R ∩ R^(-1) ⊆ Δ.
Thus, a = b.
Hence, R is antisymmetric.
QUESTION:
Show that the relation R on a set A is reflexive if and only if the inverse relation R−1 is
reflexive.
ANSWER:
To show that R is reflexive if and only if R^(-1) is reflexive, we'll prove both directions:
Assume R is reflexive.
R^(-1) is reflexive.
Thus, ∀a ∈ A, (a, a) ∈ R.
R is reflexive.
QUESTION:
Show that the relation R on a set A is reflexive if and only if the complementary relation R
is irreflexive.
ANSWER:
To show that R is reflexive if and only if R' (complementary relation) is irreflexive, we'll prove both
directions:
Assume R is reflexive.
∀a ∈ A, (a, a) ∈ R.
R' is irreflexive.
∀a ∈ A, (a, a) ∉ R'.
QUESTION:
Let R be a relation that is reflexive and transitive. Prove that Rn = R for all positive
integers n.
ANSWER:
Since R is reflexive and transitive, we'll prove R^n = R for all positive integers n.
Inductive step:
Since R is transitive, R ∘ R ⊆ R.
Since R is reflexive, R ⊆ R ∘ R.
Thus, R ∘ R = R.
Hence, R^(k+1) = R.
QUESTION:
Let R be the relation on the set {1, 2, 3, 4, 5} containing the ordered pairs (1, 1), (1, 2), (1,
3), (2, 3), (2, 4), (3, 1),(3, 4), (3, 5), (4, 2), (4, 5), (5, 1), (5, 2), and (5, 4).Find
a) R2.
b) R3.
c) R4.
d) R5.
ANSWER:
To find R^2, R^3, R^4, and R^5, we'll compute the composition of R with itself:
R^2:
R^3:
R^4:
R^5:
Observation:
R^3 is the universal relation (contains all possible pairs).
QUSTION:
Let R be a reflexive relation on a set A. Show that Rn is reflexive for all positive integers n.
Since R is reflexive, ∀a ∈ A, (a, a) ∈ R.
ANSWER:
R^1 = R is reflexive.
Inductive step:
R^(k+1) = R^k ∘ R
For any a ∈ A:
R^(k+1) is reflexive.
QUESTION:
LetR be a symmetric relation. ShowthatRn is symmetric for all positive integers n. Since R
is symmetric, (a, b) ∈ R → (b, a) ∈ R.
ANSWER:
R^1 = R is symmetric.
Inductive step:
R^(k+1) = R^k ∘ R
R^(k+1) is symmetric.
QUESTION:
List the triples in the relation {(a, b, c) | a, b, and c are integers with 0 < a < b < c < 5}.
ANSWER:
(3, 4, 5)}.
These 10 triples satisfy the conditions:
0<a<b<c<5
QUESTION:
Which 4-tuples are in the relation {(a, b, c, d) | a, b, c, and d are positive integers with abcd
= 6}?
ANSWER:
(6, 1, 1, 1)}
abcd = 6
QUESTION:
The 3-tuples in a 3-ary relation represent the following attributes of a student database:
student ID number, name, phone number.
ANSWER:
Reason: Student ID numbers are typically unique and assigned to each student, making them an ideal
primary key.
Reason: Names are not unique (multiple students can share the same name), making them unsuitable as a
primary key.
Reason:
2. Phone numbers can change over time (e.g., when a student moves or changes carriers).
3. Some students might not have a phone or prefer not to provide their number.
A primary key should be unique, stable, and not nullable, making student ID number the most suitable
choice.
Using student ID number as the primary key ensures data consistency and efficient querying.
QUESTION:
The 4-tuples in a 4-ary relation represent these attributes of published books: title, ISBN,
publication date, number of pages.
ANSWER:
a) ISBN (International Standard Book Number) is a likely primary key for this relation.
2. No two books with the same title are published on the same date.
1. Multiple books can have the same title and page count (e.g., different authors or editions).
2. Page count can change between editions.
QUESTION
be a composite key?
ANSWER:
a) Social Security number (SSN) is the primary key for this relation.
Reason:
- Multiple people can share the same name (e.g., family members).
- Multiple people can live at the same address (e.g., roommates, family members).
c) (Name, street address, city) still wouldn't be a reliable composite key.
Reason:
- Multiple people can share the same name and live at the same address in the same city.
- People with the same name can move to the same address in the same city.
QUESTION:
What do you obtain when you apply the projection P2,3,5 to the 5-tuple (a, b, c, d, e)?
ANSWER:
When you apply the projection P2,3,5 to the 5-tuple (a, b, c, d, e), you obtain:
(b, c, e)
Projection P2,3,5 selects the 2nd, 3rd, and 5th components from the original 5-tuple.
In general, projection Pi,j,k... selects the i-th, j-th, k-th,... components from the original tuple.
QUESTION:
Which projection mapping is used to delete the first, second, and fourth components of a 6-
tuple?
ANSWER:
To delete the first, second, and fourth components of a 6-tuple, you would use the projection mapping:
P3,5,6
This projection selects the 3rd, 5th, and 6th components, effectively deleting the 1st, 2nd, and 4th
components.
(a, b, c, d, e, f)
QUESTION:
How many components are there in the n-tuples in the table obtained by applying the join
operator J3 to two tables with 5-tuples and 8-tuples, respectively?
ANSWER:
5-tuples (a, b, c, d, e)
8-tuples (f, g, h, i, j, k, l, m)
5 + 8 = 13
components.
(a, b, c, d, e, f, g, h, i, j, k, l, m)
Note that J3 typically denotes a natural join or equi-join on the third attribute, but the number of
components in the resulting tuples is determined by the total number of attributes from both tables.
QUESTION:
Let R be the relation on the set {0, 1, 2, 3} containing the ordered pairs (0, 1), (1, 1), (1, 2),
(2, 0), (2, 2), and (3, 0). Find the
a) reflexive closure of R.
b) symmetric closure of R.
ANSWER:
Given relation R:
R = {(0, 1), (1, 1), (1, 2), (2, 0), (2, 2), (3, 0)}
a) Reflexive Closure of R:
The reflexive closure of R, denoted by r(R), adds all missing pairs of the form (a, a) to R.
r(R) = {(0, 1), (1, 1), (1, 2), (2, 0), (2, 2), (3, 0), (0, 0), (3, 3)}
b) Symmetric Closure of R:
The symmetric closure of R, denoted by s(R), adds all missing pairs of the form (b, a) whenever (a, b) ∈
R.
s(R) = {(0, 1), (1, 1), (1, 2), (2, 0), (2, 2), (3, 0), (1, 0), (0, 2), (0, 3)}
QUESTION:
Let R be the relation {(a, b) | a divides b} on the set of integers. What is the symmetric
closure of R?
ANSWER:
R = {(a, b) | a divides b}
The symmetric closure of R, denoted by s(R), adds all missing pairs of the form (b, a) whenever (a, b) ∈
R.
In other words, s(R) is the relation where a and b are integers that divide each other.
QUESTION:
Howcan the directed graph representing the reflexive closure of a relation on a finite set be
constructed from the directed graph of the relation?
ANSWER:
To construct the directed graph representing the reflexive closure of a relation R on a finite set, follow
these steps:
2. For each vertex (node) in the graph, add a self-loop (an edge from the vertex to itself) if it doesn't
already exist.
This ensures that every vertex is related to itself, satisfying the reflexive property.
Example:
Original Relation R:
Vertices: {a, b, c}
Vertices: {a, b, c}
Edges: {(a, b), (b, c), (c, a), (a, a), (b, b), (c, c)}
By adding self-loops to each vertex, we obtain the directed graph representing the reflexive closure r(R).
QUESTION:
How can the directed graph representing the symmetric closure of a relation on a finite set
be constructed from the directed graph for this relation?
ANSWER:
To construct the directed graph representing the symmetric closure of a relation R on a finite set, follow
these steps:
This ensures that every pair of vertices has edges in both directions, satisfying the symmetric property.
Example:
Original Relation R:
Vertices: {a, b, c}
QUESTION:
Suppose that the relation R on the finite set A is represented by the matrix MR. Show that
the matrix that represents the reflexive closure of R is MR ∨ In.
ANSWER:
mij = 1 if (i, j) ∈ R
mij = 0 if (i, j) ∉ R
m'ij = 1 if i = j (self-loops)
= 1 if (i, j) ∈ R or i = j
MR' = MR ∨ In
1 ∨ 1 = 1, 1 ∨ 0 = 1, 0 ∨ 1 = 1, 0 ∨ 0 = 0
QUESTION:
Suppose that the relation R on the finite set A is represented by the matrix MR. Show that
the matrix that represents the symmetric closure of R is MR ∨Mt R.
ANSWER:
mij = 1 if (i, j) ∈ R
mij = 0 if (i, j) ∉ R
= 1 if (i, j) ∈ R or (j, i) ∈ R
MS = MR ∨ MtR
QUESTION:
When is it possible to define the “irreflexive closure” of a relation R, that is, a relation that
contains R, is irreflexive, and is contained in every irreflexive relation that contains R?
ANSWER:
The irreflexive closure of a relation R can be defined if and only if R does not already contain any self-
loops, i.e., (a, a) ∉ R for all a in the domain.
Reason:
QUESTION:
Let R be the relation on the set {1, 2, 3, 4, 5} containing the ordered pairs (1, 3), (2, 4), (3,
1), (3, 5), (4, 3), (5, 1), (5, 2), and (5, 4).
Find
d) R5. e) R6. f ) R∗
ANSWER:
R = {(1, 3), (2, 4), (3, 1), (3, 5), (4, 3), (5, 1), (5, 2), (5, 4)}
R² = {(1, 1), (1, 5), (2, 3), (3, 3), (3, 1), (4, 1), (4, 5), (5, 3), (5, 4), (5, 1)}
b) R³
R³ = {(1, 3), (1, 1), (1, 4), (2, 1), (2, 5), (3, 5), (3, 3), (3, 1), (4, 3), (4, 4), (5, 1), (5, 2), (5, 5)}
c) R⁴
R⁴ = {(1, 1), (1, 3), (1, 5), (2, 3), (2, 1), (2, 4), (3, 1), (3, 3), (3, 5), (4, 1), (4, 3), (4, 5), (5, 3), (5, 1), (5, 4),
(5, 2)}
d) R⁵
R⁵ = {(1, 1), (1, 3), (1, 5), (1, 4), (2, 1), (2, 3), (2, 5), (2, 4), (3, 1), (3, 3), (3, 5), (4, 1), (4, 3), (4, 5), (5, 1),
(5, 2), (5, 3), (5, 4), (5, 5)}
e) R⁶
R⁶ = {(1, 1), (1, 3), (1, 5), (1, 4), (1, 2), (2, 1), (2, 3), (2, 5), (2, 4), (3, 1), (3, 3), (3, 5), (4, 1), (4, 3), (4, 5),
(5, 1), (5, 2), (5, 3), (5, 4), (5, 5)}
f) R* (Transitive closure)
R* = {(1, 1), (1, 3), (1, 5), (1, 4), (1, 2), (2, 1), (2, 3), (2, 5), (2, 4), (3, 1), (3, 3), (3, 5), (4, 1), (4, 3), (4, 5),
(5, 1), (5, 2), (5, 3), (5, 4), (5, 5)}
Note that R⁵ = R⁶ = R*, indicating that the transitive closure is reached at R⁵.
QUESTION:
Let R be the relation that contains the pair (a, b) if a and b are cities such that there is a
direct non-stop airline flight from a to b. When is (a, b) in
a) R2?
b) R3?
c) R∗?
ANSWER:
a) (a, b) ∈ R²:
In other words, you can fly from a to b with one stop (at city c).
b) (a, b) ∈ R³:
In other words, you can fly from a to b with two stops (at cities c and d).
...
n. There is a direct non-stop flight from cₙ to b.
In other words, you can fly from a to b with any number of stops (zero or more).
QUESTION:
Let R be the relation on the set of all students containing the ordered pair (a, b) if a and b
are in at least one common class and a = b. When is (a, b) in
a) R2?
b) R3?
c) R∗?
ANSWER:
a) (a, b) ∈ R²:
In other words, a and b have a common acquaintance (c) through a shared class.
b) (a, b) ∈ R³:
There exists a chain of mutual acquaintances (c₁, c₂, ..., cₙ) such that:
...
In other words, a and b are connected through any number of mutual acquaintances.
R* represents the connectivity of students through shared classes, regardless of the length of the
connection chain.
QUESTION:
ANSWER:
∀a ∈ A, (a, a) ∈ R
∀a ∈ A, (a, a) ∈ R*
...
Thus, R* is reflexive.
QUESTION:
ANSWER:
Case 1: n = 0
Case 2: n > 0
(a, b) ∈ R^n ⇒ ∃c₁, ..., cₙ₋₁, (a, c₁) ∈ R, (c₁, c₂) ∈ R, ..., (cₙ₋₁, b) ∈ R
Since R is symmetric:
Thus, R* is symmetric.
QUESTION:
Counterexample:
R is irreflexive since (a, a), (b, b), and (c, c) are not in R.
However:
R² = {(a, a), (a, c), (b, b), (b, a), (c, b), (c, c)}
R² is not irreflexive since (a, a), (b, b), and (c, c) are in R².
QUESTION:
Which of these relations on {0, 1, 2, 3} are equivalence relations? Determine the properties
of an equivalence relation that the others lack.
b) {(0, 0), (0, 2), (2, 0), (2, 2), (2, 3), (3, 2), (3, 3)}
c) {(0, 0), (1, 1), (1, 2), (2, 1), (2, 2), (3, 3)}
d) {(0, 0), (1, 1), (1, 3), (2, 2), (2, 3), (3, 1), (3, 2),
(3, 3)}
e) {(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0),
ANSWER:
Equivalence relation.
b) {(0, 0), (0, 2), (2, 0), (2, 2), (2, 3), (3, 2), (3, 3)}:
c) {(0, 0), (1, 1), (1, 2), (2, 1), (2, 2), (3, 3)}:
Equivalence relation.
d) {(0, 0), (1, 1), (1, 3), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}:
e) {(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 2), (3, 3)}:
Not transitive ((0, 1) and (1, 2) but no (0, 2) is actually present, however (2, 1) and (1, 0) but no (2, 0) is
actually present).
QUESTION:
Which of these relations on the set of all people are equivalence relations? Determine the
properties of an equivalence relation that the others lack.
Equivalence relation.
Equivalence relation.
Equivalence relation.
Not transitive (a met b, b met c, but a may not have met c).
Equivalence relation.
QUESTION:
Which of these relations on the set of all functions from Z to Z are equivalence relations?
Determine the properties of an equivalence relation that the others lack.
g(x) = C}
ANSWER:
Equivalence relation.
Not transitive (f(0) = g(0), g(1) = h(1) but no f(0) = h(0) and no f(1) = h(1)).
Not reflexive (f(x) - f(x) = 0 ≠ 1), not symmetric (f(x) - g(x) = 1 but g(x) - f(x) = -1).
Equivalence relation.
Not reflexive (f(0) ≠ f(1) usually), not symmetric (f(0) = g(1) and f(1) = g(0) but g(0) ≠ f(1) and g(1) ≠
f(0)).
QUESTION:
Show that the relation R consisting of all pairs (x, y) such that x and y are bit strings of
length three or more that agree except perhaps in their first three bits is an equivalence
relation on the set of all bit strings of length three or more.
ANSWER:
To show that R is an equivalence relation, we must prove that R satisfies three properties:
1. Reflexivity
2. Symmetry
3. Transitivity
Reflexivity:
For any bit string x of length three or more, x agrees with itself except perhaps in its first three bits (since
they are the same). Therefore, (x, x) ∈ R.
Symmetry:
Suppose (x, y) ∈ R. Then x and y agree except perhaps in their first three bits. This implies that y and x
agree except perhaps in their first three bits. Hence, (y, x) ∈ R.
Transitivity:
From these, we can conclude that x and z agree except perhaps in their first three bits (since y's first three
bits may differ from x's and z's, but x and z will still agree beyond the first three bits). Therefore, (x, z) ∈
R.
Thus, R satisfies reflexivity, symmetry, and transitivity, making R an equivalence relation on the set of all
bit strings of length three or more.
QUESTION:
Let R be the relation on the set of ordered pairs of positive integers such that ((a, b), (c, d))
∈ R if and only if a + d = b + c. Show that R is an equivalence relation.
ANSWER:
To show that R is an equivalence relation, we must prove that R satisfies three properties:
1. Reflexivity
2. Symmetry
3. Transitivity
Reflexivity:
a+b=b+a
Symmetry:
a+d=b+c
Rearranging, we get:
c+b=d+a
Transitivity:
Suppose ((a, b), (c, d)) ∈ R and ((c, d), (e, f)) ∈ R. Then:
a+d=b+c
c+f=d+e
Adding these equations and canceling d, we get:
a+f=b+e
QUESTION:
b) {(0, 0), (1, 1), (2, 0), (2, 2), (2, 3), (3, 2), (3, 3)}
c) {(0, 0), (1, 1), (1, 2), (2, 2), (3, 3)}
d) {(0, 0), (1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)}
e) {(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0),
ANSWER:
b) {(0, 0), (1, 1), (2, 0), (2, 2), (2, 3), (3, 2), (3, 3)}
Not antisymmetric: (2, 3) and (3, 2) but 2 ≠ 3.
c) {(0, 0), (1, 1), (1, 2), (2, 2), (3, 3)}
Partial ordering.
d) {(0, 0), (1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)}
Partial ordering.
e) {(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 2), (3, 3)}
QUESTION:
Which of these relations on {0, 1, 2, 3} are partial orderings? Determine the properties of a
partial ordering that the others lack.
b) {(0, 0), (1, 1), (2, 0), (2, 2), (2, 3), (3, 3)}
c) {(0, 0), (1, 1), (1, 2), (2, 2), (3, 1), (3, 3)}
d) {(0, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 2), (2, 3), (3, 0), (3, 3)}
e) {(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2),(1, 3), (2, 0), (2, 2), (3, 3)}
ANSWER:
b) {(0, 0), (1, 1), (2, 0), (2, 2), (2, 3), (3, 3)}
c) {(0, 0), (1, 1), (1, 2), (2, 2), (3, 1), (3, 3)}
d) {(0, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 2), (2, 3), (3, 0), (3, 3)}
e) {(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 2), (3, 3)}
QUESTION:
Is (S,R) a poset if S is the set of all people in the world and (a, b) ∈ R, where a and b are
people, if
a) a is taller than b?
c) a = b or a is an ancestor of b?
ANSWER:
a) a is taller than b
Not symmetric: (a, b) ∈ R ⇒ (b, a) ∉ R (if a is taller than b, b is not taller than a)
Transitive: (a, b) ∈ R and (b, c) ∈ R ⇒ (a, c) ∈ R (if a is taller than b and b is taller than c, a is taller than
c)
Not a poset.
Not antisymmetric: (a, b) ∈ R and (b, a) ∈ R but a ≠ b (a and b can have the same height)
Transitive: (a, b) ∈ R and (b, c) ∈ R ⇒ (a, c) ∈ R (if a is not taller than b and b is not taller than c, a is not
taller than c)
Not a poset.
c) a = b or a is an ancestor of b
Reflexive: (a, a) ∈ R (a = a)
Poset.
Not antisymmetric: (a, b) ∈ R and (b, a) ∈ R but a ≠ b (having a common friend is symmetric)
Not transitive: (a, b) ∈ R and (b, c) ∈ R ¬⇒ (a, c) ∈ R (a and b have a common friend, b and c have a
common friend, but a and c may not)
Not a poset.
QUESTION:
Is (S,R) a poset if S is the set of all people in the world and (a, b) ∈ R, where a and b are
people, if
a) a is no shorter than b?
c) a = b or a is a descendant of b?
ANSWER:
a) a is no shorter than b
Antisymmetric: (a, b) ∈ R and (b, a) ∈ R ⇒ a = b (if a is no shorter than b and b is no shorter than a, a
and b are the same height)
Transitive: (a, b) ∈ R and (b, c) ∈ R ⇒ (a, c) ∈ R (if a is no shorter than b and b is no shorter than c, a is
no shorter than c)
Poset.
Not symmetric: (a, b) ∈ R ⇒ (b, a) ∉ R (if a weighs more than b, b does not weigh more than a)
Transitive: (a, b) ∈ R and (b, c) ∈ R ⇒ (a, c) ∈ R (if a weighs more than b and b weighs more than c, a
weighs more than c)
c) a = b or a is a descendant of b
Reflexive: (a, a) ∈ R (a = a)
Poset.
Not antisymmetric: (a, b) ∈ R and (b, a) ∈ R but a ≠ b (not having a common friend is symmetric)
Not transitive: (a, b) ∈ R and (b, c) ∈ R ¬⇒ (a, c) ∈ R (a and b have no common friend, b and c have no
common friend, but a and c may have a common friend)
Not a poset.
(b) and (d) are not posets due to lack of reflexivity and/or antisymmetry and/or transitivity.
QUESTION:
a) (Z,=) b)
b) (Z, =)
c) (Z,≥)
d) (Z, | )
ANSWER:
a) (Z, =)
Reflexive: Yes (a = a)
Poset.
b) (Z, ≡) (assuming ≡ means congruence modulo some fixed integer)
Reflexive: Yes (a ≡ a)
c) (Z, ≥)
Reflexive: Yes (a ≥ a)
Poset.
Reflexive: Yes (a | a)
QUESTION:
ANSWER:
Here are the results:
a) (R, =)
Reflexive: Yes (a = a)
Poset.
b) (R, <)
c) (R, ≤)
Reflexive: Yes (a ≤ a)
Poset.
Not a poset.