Let f = {(3, 1), (9, 3), (12, 4)} and g = {(1, 3), (3, 3) (4, 9) (5, 9)}. Show that gof and fog are both defined. Also, find fog and gof.
f = {(3, 1), (9, 3), (12, 4)} and g = {(1, 3), (3, 3) (4, 9) (5, 9)}
f : {3, 9, 12} → {1, 3,4} and g : {1, 3, 4, 5} → {3, 9}
Co-domain of $f$ is a subset of the domain of $g$.
So, gof exists and gof : $\{3,9,12\} \rightarrow\{3,9\}$
$(g \circ f)(3)=g(f(3))=g(1)=3$
$(g \circ f)(9)=g(f(9))=g(3)=3$
$(g \circ f)(12)=g(f(12))=g(4)=9$
$\Rightarrow g o f=\{(3,3),(9,3),(12,9)\}$
Co-domain of g is a subset of the domain of f.
So, fog exists and fog : {1, 3, 4, 5} → {3, 9, 12}
$(f o g)(1)=f(g(1))=f(3)=1$
$(f o g)(3)=f(g(3))=f(3)=1$
$(f o g)(4)=f(g(4))=f(9)=3$
$(f o g)(5)=f(g(5))=f(9)=3$
$\Rightarrow f o g=\{(1,1),(3,1),(4,3),(5,3)\}$