# How do you find out what the function $g(f(2))$ and $f(g(2))$ is?

I'm trying to find what the *g*$(f(2))$ and the f $(g(2))$ is.

Here are the functions for f and g:

Let A - $\{$1, 2, 3, 4$\}$ and B - $\{$a, b, c, d$\}$

• Let f : A $\rightarrow$ B be defined so that f - $\{$$\lt1, b\gt,\lt2, c\gt, \lt3, d\gt, \lt4, a\gt$$\}$
• Let g : B $\rightarrow$ A be defined so that g - $\{$$\lta, 1\gt,\ltb, 2\gt, \ltc, 4\gt, \ltd, 4\gt$$\}$

This is what I've done so far, but i'm not sure if it's done correctly, please feel free to correct me.

$g(f(2))$ - We have $f(2)$ in g which is $f(2) = c$ and $g(c)$ which is $g(c) = 4$.

Is this done correctly or I'm I missing something out on this?

I'm not sure how i can solve the f $(g(2))$ would appreciate some help.

Thanks a lot

• You did g(f(2)) correctly. You can't do f(g(2)) because g(2) isn't defined (2 isn't in the domain of g) – Tyler Oct 4 '13 at 18:49
• ah great! thought I was doing it wrong. Alright yeah, that's what i was struggling with. Thanks for your answer! – Dabbish Oct 4 '13 at 18:50
• I'll just add that as an answer then :) – Tyler Oct 4 '13 at 18:51

## 1 Answer

You did $g(f(2))$ correctly. You can't do $f(g(2))$ because $g(2)$ isn't defined since $2$ isn't in the domain of $g$.