# Math Help - More mapping questions

1. ## More mapping questions

1. Given that f and g are both mappings of one set of integers to another set of integers, where $f:x \to x^2$ and $g:x \to \bigg [\begin{array}{lcr} 0 (\text {when x is an even number}) \\
1 (\text {when x is an odd number})\end{array}$
, determine each of the following mappings.

(1) $f \circ g$

[Sol] $f \circ g:x \to \bigg [\begin{array}{lcr} 0 (\text {when x is an even number}) \\
1 (\text {when x is an odd number})\end{array}$

(2) $g \circ f$

[Sol] $f \circ g:x \to \bigg [\begin{array}{lcr} 0 (\text {when x is an even number}) \\
1 (\text {when x is an odd number})\end{array}$

They are the same.

4. Given that f and g are both mappings of one set of integers to another set of integers, where $f:x \to x^2$ and $g:x \to \bigg [\begin{array}{lcr} -1 (\text {when x is an even number}) \\
1 (\text {when x is an odd number})\end{array}$
, determine each of the following mappings.

(1) $f \circ g$

[Sol] $f \circ g:x \to 1$

(2) $g \to f:x$

$g \circ f:x \to \bigg [\begin{array}{lcr} -1 (\text {when x is an even number}) \\
1 (\text {when x is an odd number})\end{array}$

I'm not too sure of how that works. My understanding is that composite mapping of $f \circ g$ is you substitute whatever g is into f as its x. I don't understand this case. Any help would be appreciated.

BTW, how do I get the symbol { into latex? I understand this is used as a function in symbols, but if I actually want this symbol to appear as latex text, what do I type?

2. $$g \circ f(n) = \left\{ \begin{gathered} - 1,\text{ n is even } \hfill \\ + 1, \text{ n is odd } \hfill \\ \end{gathered} \right.$$ gives $g \circ f(n) = \left\{ \begin{gathered} -1,\text{ n is even } \hfill \\ +1, \text{ n is odd } \hfill \\ \end{gathered} \right.$

Any even integer squared is even. Any odd integer squared is odd.
So $g \circ f$ acts exactly as $g$.

3. $f\circ g=f(g(x))$

I am not too sure I understand the question, all those solutions are correct? Are they not your answers and you are looking for an explanation or what?

you just look at what g does first , then see what f does to that one.

So in the last example you noticed that squaring preserves parity. that is an even squared is even, and an odd squared is odd. Since the second function only depends on whether it is even or odd, the first function might as well just be the identity function and so you are just going to get g again.

On the second to last one, you do them in the opposite order, so for the evens you get -1 and for odds you get 1, but when you square either of these you just get 1, so this composition just always gives you 1.

Hope this helps, but I feel that you are probably asking something else entirely.

4. Originally Posted by Gamma
$f\circ g=f(g(x))$

I am not too sure I understand the question, all those solutions are correct? Are they not your answers and you are looking for an explanation or what?

you just look at what g does first , then see what f does to that one.

So in the last example you noticed that squaring preserves parity. that is an even squared is even, and an odd squared is odd. Since the second function only depends on whether it is even or odd, the first function might as well just be the identity function and so you are just going to get g again.

On the second to last one, you do them in the opposite order, so for the evens you get -1 and for odds you get 1, but when you square either of these you just get 1, so this composition just always gives you 1.

Hope this helps, but I feel that you are probably asking something else entirely.

Your response has definitely helped me understand this. I just still don't understand 2. (2). Do you mind clarifying why you get that answer?

5. Originally Posted by chengbin
(2). Do you mind clarifying why you get that answer?
$x^2$ does absolutely nothing when it is applied before a function that only depends on whether the number is even or odd. That is why the second part of both questions is precisely g(x).