You are on page 1of 5

DTG Workshop 1

Exercise 1.1:

A relation is a set of ordered pairs of elements from a given set, typically denoted by R.

We know from the assignment that “This introduces a relation S on the set of users given by (a, b) ∈ S if
person a follows person b.”, which describes the

S= ( Bob , Bob ) , ( Kim, Kim ) , ( Kim ,Gus ) , ( Gus ,Gus ) , ( Gus, Tom ) , (Gus , Liv ) , ( Noa , Noa ) , ( Noa, Tom )

( Liv , Liv ) , ( Liv , Noa ) , ( Liv , Tom ) , ( Mia , Mia ) , ( Mia, Liv ) , ( Mia, Bob ) ,( Tom, Tom)

Exercise 1.2:
Definition 4: Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative integer,
we say that S is a finite set and that n is the cardinality of S is denoted by |S|.

|S|=15

Exercise 1.3:
This refers to

Definition 9: The Cartesian product of the sets A1 , A 2 ,… , An , denoted by A1 × A2 ×… × A n, is the set of


ordered n-tuples (a 1 , a2 , … , an ), where a i belongs to Ai for i=1 , 2 ,… , n. In other words,

A1 × A2 ×… × A n={ ( a1 , a2 , … , an )∨ai ∈ A i for i=1 , 2 ,… , n }

A={Tom , Mia, Bob, Liv , Kim, Noa, Gus }

A1 × A2= {( a 1 , a2 ) ∨ai ∈ Ai for i=1 ,2 }=72 =49

A × A= A2 ⊇S

if | A1|=m and | A2|=n , then

| A1 × A 2|=m·n

49=| A |⊇ S
2
Exercise 1.4:
A relation S on a set A is reflexive if (a, a) ∈ S for all a ∈ A. In this case, the relation S is reflexive because
for all users a in A, (a, a) ∈ S, for example, (Tom, Tom) ∈ S. A relation S on a set A is symmetric if (a, b) ∈ S
implies (b, a) ∈ S for all a, b ∈ A.

In this case, the relation S is not symmetric because not all pairs (a, b) ∈ S have corresponding pairs (b, a)
∈ S. For example, (Kim, Gus) ∈ S, but (Gus, Kim) is not in the relation. A relation S on a set A is
antisymmetric if (a, b) ∈ S and (b, a) ∈ S implies a = b for all a, b ∈

A. In this case, the relation S is not antisymmetric because there are some pairs (a, b) ∈ S, (b, a) ∈ S, but a
is not equal to b. For example, (Gus, Tom) ∈ S, (Tom, Gus) ∈ S, but Gus is not equal to Tom.

A relation S on a set A is transitive if (a, b) ∈ S and (b, c) ∈ S implies (a, c) ∈ S for all a, b, c ∈ A. In this
case, the relation S is not transitive because there are some (a, b) ∈ S, (b, c) ∈ S, but (a, c) is not in the
relation. For example, (Kim, Gus) ∈ S, (Gus, Tom) ∈ S, but (Kim, Tom) is not in the relation.

In summary, this relation is reflexive but not symmetric, antisymmetric or transitive.

Definition 3: A relation R on a set A is called reflexive, if (a , a)∈ R for every element a ∈ A .

Simplified: if it has (a , a) (( 1,1 ) , ( 2,2 ) ,(3 , 3) is reflexive because it’s the same)

Because it is A × A .

Exercise 2.1
The first option is that content retweets with immediate follows, which mean that, if x n shares a post then
x n−1 sees it.

R ∈ {( a ,b )|a=b }

The other option is with a chain reaction, which states that, if x n shares a post, then x n−1sees the post and
shares it, so x n−2 also sees it till no one follows the last person. This option follows the translative closure
operation.

R ∈ {( a ,b )|a=b ∧b=c → a=b }


Exercise 2.2
Definition 3: Let R be a relation on a set A . The connectivity relation R⋆ consists of the pairs (a , b) such
that there is a path of length at least one from a to b in R .
⋆ n
R =¿ n=1¿ ∞ R
Theorem 2: The translative closure of a relation R equals the connectivity relation R⋆ .

S⋆ =( Bob, Bob ) , ( Kim , Kim ) , ( Kim , Gus ) , ( Kim ,Tom ) , ( Kim, Liv ) , ( Kim , Noa ) , ( Gus ,Gus ) , ( Gus ,Tom ) , ( Gus, Liv ) , ( G
( Liv , Liv ) , ( Liv , Noa ) , ( Liv , Tom ) , ( Mia , Mia ) , ( Mia, Liv ) , ( Mia, Noa ) , ( Mia ,Tom ) , ( Mia , Bob ) ,(Tom ,Tom)

Exercise 3.1:
Definition 2: let A and B be sets. The intersection of the sets A and B, denoted by A ∩ B, is the set
containing those elements in both A and B.

Simplified: A ∩ B= { x∨x ∈ A ∧ x ∈ B }

The sets F Tom and F Noa describe the set of people who follow Tom and Noa, respectively, in the relation S*.
The elements in the set F Tom are Kim, Gus, Mia, Noa, Tom and Liv. The elements in the set F Noa are Kim,
Gus, Mia, Noa and Liv. The intersection of the two sets, F Tom ∩ F Noa, is the set of people who follow both
Tom and Noa. In this case, is Kim, Gus, Mia, Noa and Liv.

Exercise 3.2:
To show that G Tom ⊆ FTom , we need to prove that every element in the set GTom is also in the set F Tom.

Given that G Tom ={b ∈ B∨(b ,Tom)∈ S }, this means that G Tom is the set of all elements in B for which the
relation (b , Tom) exists in the set S.

Given that F Tom={a ∈ A∨(a ,Tom)∈ S∗} , this means that F Tom is the set of all elements in A for which
the relation (a , Tom) exists in the set S*.

Since B⊆ A , any element in B is also an element in A. Therefore, if an element b in B satisfies the condition
of being in GTom, it also satisfies the condition of being in F Tom.

In other words, if (b , Tom)∈ S , then ( b , Tom ) ∈ S∗¿, and thus b ∈GTom implies b ∈ F Tom.

Therefore, G Tom ⊆ FTom .

Exercise 4.1:
The directed graph that represents the relation R = {(w, w), (w, x), (x, y), (z, y)} on A = {w, x, y, z} would look
like this:
The directed graph that represents the relation R = {(w, w), (w, x), (x, y), (z, y)} on A = {w, x, y, z} is made up
of four vertices, one for each element in the set A.

Each vertex is represented by a circle and labeled with the corresponding element. The graph has three
directed edges, each represented by an arrow.

The edges are labeled with the pairs in the relation R.

The first edge is a self-loop on vertex 'w' with the label (w,w) which means that relation R has a pair where
the element w is related to itself.

The second edge is a directed edge from vertex 'w' to vertex 'x' with the label (w, x) which means that
relation R has a pair where 'w' is related to 'x'.

The third edge is a directed edge from vertex 'x' to vertex 'y' with the label (x,y) which means that relation R
has a pair where 'x' is related to 'y'.

The fourth edge is a directed edge from vertex 'z' to vertex 'y' with the label (z, y) which means that relation
R has a pair where 'z' is related to 'y'.

This directed graph represents the relation R on the set A, showing the relationships between the elements
in the set.

The matrix representation of a relation R on a set A is a matrix M whose rows and columns are indexed by
the elements of A, and whose entries are 0 or 1 depending on whether the corresponding pair of elements
is in R or not.

The entry in the i-th row and j-th column of the matrix is 1 if (i , j)∈ R and 0 if (i , j) ∉ R .

Exercise 4.2:
Reflexive closure is equal to R ∪ Δ, where Δ= {( a , a )|a ∈ A } is the diagonal relation on A .
The reflexive closure of a relation R on a set A is the smallest reflexive relation R that contains R. A relation
R on a set A is reflexive if for every element a in A, the pair (a, a) is in R. The reflexive closure of R can be
obtained by adding a self-loop (a, a) for every element a in A that is not already related to itself in R.

Given R = {(w, w),(w, x),(x, y),(z, y)}, the reflexive closure R~ is the smallest reflexive relation that contains R.
The reflexive closure of R can be obtained by adding a self-loop (a, a) for every element a in A that is not
already related to itself in R.

In this case, the reflexive closure R~ of R is {(w,w), (w, x), (x, y), (z, y), (x, x), (y, y), (z, z) }

Exercise 4.3:

You might also like