Page 189 - HOW TO PROVE IT: A Structured Approach, Second Edition
P. 189
P1: PIG/ P2: OYK/
0521861241c04 CB996/Velleman October 20, 2005 2:54 0 521 86124 1 Char Count= 0
Relations 175
Solutions
1. E −1 ={(c, s) ∈ C × S | (s, c) ∈ E}={(c, s) ∈ C × S | the student s is en-
rolled in the course c}. For example, if Joe Smith is enrolled in Biology 12,
then (Joe Smith, Biology 12) ∈ E and (Biology 12, Joe Smith) ∈ E −1 .
2. Because L −1 is a relation from R to S and E is a relation from S to C, E ◦ L −1
will be the relation from R to C defined as follows.
E ◦ L −1 ={(r, c) ∈ R × C |∃s ∈ S((r, s) ∈ L −1 and (s, c) ∈ E)}
={(r, c) ∈ R × C |∃s ∈ S((s,r) ∈ L and (s, c) ∈ E)}
={(r, c) ∈ R × C |∃s ∈ S(the student s lives in the dorm
room r and is enrolled in the course c)}
={(r, c) ∈ R × C | some student who lives in the room r
is enrolled in the course c}.
Returning to our favorite student Joe Smith, who is enrolled in Biology 12
and lives in room 213 Davis Hall, we have (213 Davis Hall, Joe Smith)
∈ L −1 and (Joe Smith, Biology 12) ∈ E, and therefore (213 Davis Hall,
Biology 12) ∈ E ◦ L −1 .
3. Because E is a relation from S to C and E −1 is a relation from C to S,
E −1 ◦ E is the relation from S to S defined as follows.
−1 −1
E ◦ E ={(s, t) ∈ S × S |∃c ∈ C((s, c) ∈ E and (c, t) ∈ E )}
={(s, t) ∈ S × S |∃c ∈ C(the student s is enrolled in the
course c, and so is the student t)}
={(s, t) ∈ S × S | there is some course that the students s
and t are both enrolled in}.
(Note that an arbitrary element of S × S is written (s, t), not (s, s), because
we don’t want to assume that the two coordinates are equal.)
4. This is not the same as the last example! Because E −1 is a relation from
C to S and E is a relation from S to C, E ◦ E −1 is a relation from C to C.It
is defined as follows.
E ◦ E −1 ={(c, d) ∈ C × C |∃s ∈ S((c, s) ∈ E −1 and (s, d) ∈ E)}
={(c, d) ∈ C × C |∃s ∈ S(the student s is enrolled in the
course c, and he is also enrolled in the course d)}
={(c, d) ∈ C × C | there is some student who is enrolled in
both of the courses c and d}.

