Composition relation $R\circ S$

244 Views Asked by At

On the set $A = \{1, 2, 3\}$ we consider the relations $R = \{(1, 1), (1, 2), (2, 3)\}$ and $S = \{(1, 2), (2, 1), (3, 2)\}$. How many elements are there in the relation $R\circ S$?

Sorry my bad english ! My answer is $3$, precisely $\{(1,2),(2,1),(2,2)\}$ but this question answer is $4$. I don't know why, please help me . Thank you!

3

There are 3 best solutions below

1
On

The answer is indeed $4$, since$$R\circ S=\bigl\{(1,3),(2,1),(2,2),(3,3)\bigr\}.$$For instance, $(2,1)\in R\circ S$, since $(2,1)\in S$ and $(1,1)\in R$.

1
On

Note: Your title says $S\circ R$, your question text says $R\circ S$. I'm assuming the latter here.

Let's make a table, with the elements of $R$ on the left column and the elements of $S$ on the top row: \begin{array}{c|ccc} & (1,2) & (2,1) & (3,2) \\ \hline (1,1) \\ (1,2) \\ (2,3) \end{array} Now pairs of the resulting relation are generated for those pairs where the second element of a pair of $S$ matches the first element of a pair of $R$. This is a bit counter-intuitive, but it was made that way so you get the usual function composition in case the relations actually are functions. So let's mark the elements that need to match, and write in the table where we get matches: \begin{array}{c|ccc} & (1,\color{green}2) & (2,\color{green}1) & (3,\color{green}2) \\ \hline (\color{green}1,1) & \color{red}{\unicode{10008}} & \color{green}\checkmark & \color{red}{\unicode{10008}}\\ (\color{green}1,2) & \color{red}{\unicode{10008}} & \color{green}\checkmark & \color{red}{\unicode{10008}}\\ (\color{green}2,3) & \color{green}\checkmark & \color{red}{\unicode{10008}} & \color{green}\checkmark \end{array} As you can see, we have four matches. However, it still could be that several matches produce the same pair, therefore let's look at the pairs those matches generate. The first element of the pair is taken from $S$, the second element of the pair is taken from $R$: \begin{array}{c|ccc} & (\color{blue}1,2) & (\color{blue}2,1) & (\color{blue}3,2) \\ \hline (1,\color{brown}1) & \color{red}{\unicode{10008}} & (\color{blue}2,\color{brown}1) & \color{red}{\unicode{10008}}\\ (1,\color{brown}2) & \color{red}{\unicode{10008}} & (\color{blue}2,\color{brown}2) & \color{red}{\unicode{10008}}\\ (2,\color{brown}3) & (\color{blue}1,\color{brown}3) & \color{red}{\unicode{10008}} & (\color{blue}3,\color{brown}3) \end{array} Now we see that the four pairs are indeed all different, and thus $R\circ S=\{(2,1),(2,2),(1,3),(3,3)\}$ has indeed $4$ elements.

If you calculate $S\circ R$ instead, you get the relation stated in your question, with only $3$ elements. Therefore your error likely was that you simply took the relations in the wrong order.

1
On

Just be careful of the order of the composition.   The notation is somewhat counterintuitive.

$\mathcal R = \{\langle1, 1\rangle, \langle1, 2\rangle, \langle2, 3\rangle\}$ and $\mathcal S = \{\langle1, 2\rangle, \langle2, 1\rangle, \langle3, 2\rangle\}$.

$$\begin{align}\mathcal {S\circ R} ~&=~\{\langle u, v\rangle: \exists w~(\langle u,w\rangle\in\mathcal R\land \langle w, v\rangle\in\mathcal S)\} \\[1ex]~&=~\{\overset{\color{silver}1}{\langle 1,2\rangle},\overset{\color{silver}2}{\langle 1, 1\rangle}, \overset{\color{silver}3}{\langle 2,2 \rangle}\}\\[4ex]\mathcal {R\circ S} ~&=~\{\langle u, v\rangle: \exists w~(\langle u,w\rangle\in\mathcal S\land \langle w, v\rangle\in\mathcal R)\} \\[1ex]~&=~\{\overset{\color{silver}2}{\langle 1,3\rangle},\overset{\color{silver}1}{\langle 2, 1\rangle}, \overset{\color{silver}1}{\langle 2,2 \rangle},\overset{\color{silver}2}{\langle 3, 3\rangle}\}\end{align}$$


NB: the overset number merely notes the bridging element, eg: we wrote $\overset {\color{silver}3}{\langle 2,2\rangle}$ in $\mathcal{S\circ R}$ to note that: because $\langle 2, 3\rangle\in\mathcal R$ and $\langle 3,2\rangle\in \mathcal S$, therefore $\langle 2,2\rangle\in \mathcal{S\circ R}$, and so forth.