CS103
HO#15
SlidesClosures, Functions
4/13/11
1
Composition of Relations
R
A
B
Suppose
R
is a relation on
A
x
B
Composition of Relations
S
R
A
B
C
Suppose
R
is a relation on
A
x
B
and
S
is a relation on
B
x
C
.
Composition of Relations
S
R
A
B
C
Suppose
R
is a relation on
A
x
B
and
S
is a relation on
B
x
C
.
The
composition of
R
and
S
, denoted
S o R
, is a relation on
A
x
C
given by:
S
o
R
= {(
a
,
c
)
A
x
C

b
B
((
a,
b
)
R
(
b
, c
)
S)
}
c
a
b
Composition of Relations
S
R
A
B
C
Suppose
R
is a relation on
A
x
B
and
S
is a relation on
B
x
C
.
The
composition of
R
and
S
, denoted
S o R
, is a relation on
A
x
C
given by:
S
o
R
= {(
a
,
c
)
A
x
C

b
B
((
a,
b
)
R
(
b
, c
)
S)
}
c
a
b
Composition of Relations
S
R
A
B
C
A
C
S o R
Suppose
R
is a relation on
A
x
B
and
S
is a relation on
B
x
C
.
The
composition of
R
and
S
, denoted
S o R
, is a relation on
A
x
C
given by:
S
o
R
= {(
a
,
c
)
A
x
C

b
B
((
a, b
)
R
(b, c
)
S)
}
Cronus
Zeus
Poseidon
Apollo
Asclepius
Zeus
Poseidon
Cronus
Apollo
Asclepius
R
R
Composition of a Relation with Itself
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
CS103
HO#15
SlidesClosures, Functions
4/13/11
2
Composition of a Relation with Itself
Cronus
Zeus
Poseidon
Apollo
Asclepius
Zeus
Poseidon
Cronus
Apollo
Asclepius
R
R
R o R
R
2
Composition of a Relation with Itself
Cronus
Zeus
Poseidon
Apollo
Asclepius
Zeus
Poseidon
Cronus
Apollo
Asclepius
R
R
R o R
R
2
Composition of a Relation with Itself
Cronus
Zeus
Poseidon
Apollo
Asclepius
Zeus
Poseidon
Cronus
Apollo
Asclepius
R
R
R o R
R
2
R o R
2
R
3
R o ( R o R )
Composition of a Relation with Itself
Cronus
Zeus
Poseidon
Apollo
Asclepius
Zeus
Poseidon
Cronus
Apollo
Asclepius
R
R
R o R
R
2
R o R
2
R
3
R o ( R o R )
Composition of a Relation with Itself
Cronus
Zeus
Poseidon
Apollo
Asclepius
Zeus
Poseidon
Cronus
Apollo
Asclepius
R
R
R o R
R
2
Father
Grandfather
GreatGrandfather
R o R
2
R
3
R o ( R o R )
Composition of a Relation with Itself
Cronus
Zeus
Poseidon
Apollo
Asclepius
5
4
3
1
2
0 0 0 1 0
0 0 0 0 0
0 0 0 0 0
0 1 0 0 0
1 0 1 0 0
0 0 0 1 0
0 0 0 0 0
0 0 0 0 0
0 1 0 0 0
1 0 1 0 0
Boolean Matrix Multiplication
"and" instead of multiplication
"or"
instead of addition
0
   
    
    
    
    
=