next next up down toc toc mail

5.2.  Some Operations on Relations

Definition 5.6 (Inverse Relation)

If R: X [double Y is a relation, then the inverse realtion

R~: Y [double X is defined as { (y,x) | (x,y) [isin] R }.

Consequently, xRy [equiv] yR~x

Definition 5.7 (Composition of R and S)

Let R: X [double Y and S: Y [double Z be two relations. The composition of R and S denoted by R O S contains the pairs (x,z) if and only if there is an intermediate object y such that (x,y) [isin] R and and (y,z) [isin] S.


x(R O S)z [equiv] it exists y with xRy and yRz


Let R be the relation x has a friend y and let S be the relation y owns a motorbike.

Find the relation R O S. R: x has a friend y


R:	{ (x,y) | x has a friend y } and x,y [isin]  { A, B, C, D, E } =

{ (A,B), (A,D), (B,C), (C,E) }
S: { (x,m) | y owns a motorbike } and x [isin] { A, B, C, D } and m [isin] { Speedy and Slow } =
{ (C, Speedy), (E, Slow) }

So we know: R O S = { (B, Speedy), (C, Slow) }

A graphically representation of the composition [larr] board

If x has a friend y means also y has a friend x. Calculate: R O S

Definition 5.8 (Associative Operations)

If R, S, and P are three Relations, then the following holds:

( R O S ) O P = R ( S O P )


R = { (x1, y3,), (x2,y1), (x3, y4)}
S = { (y1, z4,), (y2,z3), (y4, z1)}
R O S = { (x2, z4), (x3, z1) }

back next up down toc toc mail

Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1998).

Last modified: 27/July/98 (12:14)