I'm doing math exercises from a Computer Science book and I am confused as to how the following result (from the solutions manual) is obtained:
Given the function f={(a,b), (a,c), (c,d), (a,a), (b,a)}
The composition of f with itself: f(f(x)) = {(a,a), (a,b), (a,c), (a,d), (b,a), (b,b), (b,c)} .
By matching the y-values of the first function with the x-values of the second function, I managed to get all the pairs in the above answer accept for (b, b) and (b, c). Does anyone know what I've done wrong? Thanks for the help.
As this relation's defined, we see that $(a,b)\in f$ and $(b,a)\in f$ so $f(\color{red}a)=b$ and $f(b)=\color{red}a$ respectively. So $f(f(b))=f(\color{red}a)=b$. This means that $(b,b)\in f$.