Is my answer for the composite relation correct and not the textbook's?

2.9k Views Asked by At

Note: This example is from Discrete Mathematics and Its Applications [7th ed, example 5 pg 593]

enter image description here

Here is how my textbook's way of representing a relation with a matrix enter image description here

And the definition of a composite relation enter image description here

My work and Answer:
evaluating s comp r, i first took a look at all of the 1s or members of the relation S. Here is the list I came up with {(1,2), (2,3), (3,1), (3,3)}. Evaluating these individually
(1,2), 2 matches (2,1), (2,2) in R so we will have (1,1), (1,2) in composite relation
(2,3), 3 matches nothing in R row-wise
(3,1), 1 matches (1,1), (1,3) in R so we will have (3,1), and (3,3) in the composite relation
(3,3), 3 matches nothing in R row-wise
Everything else should be 0(no match) So representing the composite relation in matrix form, we have
$\quad$1 $\quad$ 1 $\quad$ 0
$\quad$0 $\quad$ 0 $\quad$0
$\quad$1 $\quad$ 0 $\quad$ 1
which doesn't match the rubbish in the textbook. Is my answer correct? Are there any mistakes I made in the algorithm to do calculate this? The textbook didn't give any explanation for their solution