Let $R$ be the following relation from $\{1, 2, 3\}$ to $\{a, b, c, d\}$: $R = \{(1, a), (1, d), (2, c), (3, a), (3, d)\}.$ Let $S$ be the following relation from $\{a, b, c, d\}$ to $\{1, 2, 3\}$: $S = \{(a, 3), (b, 3), (c, 1), (c, 2), (d, 1)\}.$ Then $R \circ S = \{(1, 3), (1, 1), (2, 1), (2, 2), (3, 3), (3, 1)\},$ $S \circ R = \{(a, a), (a, d), (b, a), (b, d), (c, a), (c, d), (c, c), (d, a), (d, d)\}.$
What I don't understand is why isn't $(1,2)$ in $R \circ S$. Also why isn't $(a,c)$, $(b,c)$, $(c,a)$, $(d,c)$ in $S \circ R$.