2

I am trying to answer the following question from a past exam paper:

Let $A = $ {$1,2,3$}, $B = $ {$2,3,4$}, and $C = $ {$1,2,3,4$}, consider the following functions:


$f: A \to B$

$f(x) = x + 1$


$g: A \to C$

$g(x) = x$


$h: C \to A$

$h(1) = 2$, $h(2) = 3$, $h(3) = 2$, $h(4) = 1$


The question is: which of the following are / are not defined. If they are defined, find their domain, codomain and range. If they are not defined, state why.

$f \circ g$

$f \circ h$

$h \circ f$

$g \circ h$

I am struggling to understand functions, and wondered if someone might be willing to go through the process of answering one of the above so I can understand how it is done. I have tried searching, but can not find an example that I can understand. Thank you!

Shannon
  • 111
  • 1
    First thing to check is if the domain and range sets are aligned. For example, as $f:A\to B$ and $g:A\to C$ we can't compose $f\circ g$ as $g$ takes us to $C$ but $f$ is not defined on $C$. – lulu Jan 04 '18 at 20:51

1 Answers1

1

I am going to answer two of them (one for defined, one for not defined) and leave rest to you:

For example if we take $f \circ g$, notice that in the first place since $f$ is defined on $A$, not $C$, $f \circ g$ is not defined (Also notice that in order for $f \circ g$ to be defined, $g$ must have range on $A$, which is not the case; it has range on $C$).

But for example if we take $f \circ h$, since there is no such problem as in the previous example, we can simply say that $f(h(1)) = f(2) = 3$, $f(h(2)) = f(3) = 4$, $f(h(3)) = f(2) = 3$ and $f(h(4)) = f(1) = 2$, which are all in $B$, therefore it is defined and we can write $f \circ h: C \to B$ where $C$ is the domain of $f \circ h$ and $B$ is the range, and also codomain of $f \circ h$.

ArsenBerk
  • 13,211
  • So would I be correct in stating that $h \circ f$ is not defined because the domain of $h$ != $B$. And that $g \circ h$ is defined because $C \to C$? – Shannon Jan 04 '18 at 21:28
  • Yes, and what you have found in the case $g \circ h: C \to C$ is a permutation on set $C$, indeed. It sends $1 \to 2$, $2 \to 3$, $3 \to 2$, $4 \to 1$. And your answer and reasoning for the case of $h \circ f$ is correct as well. – ArsenBerk Jan 04 '18 at 21:33
  • Great, thank you. I think I now understand how to determine if a function is defined or not, however, can I just confirm I understand what must be done in order to find the domain and range: Using $g \circ h$ as the example, would {1,2,3,4} ($C$) be the domain and {1,2,3} ($A$) be the range? I am completely lost as to how you determine the co-domain however. – Shannon Jan 04 '18 at 21:46
  • When a function $f$ is defined as $f:X \to Y$, we call $X$ the domain and $Y$ the codomain. Range $Z$ is a subset of codomain $Y$ where $f(X) = Z$. Here is a better illustration for these definitions: https://www.mathsisfun.com/sets/images/domain-range-codomain.svg – ArsenBerk Jan 04 '18 at 21:52
  • After that, can you tell me what is the domain, codomain and range for the case of $g \circ h$ again? – ArsenBerk Jan 04 '18 at 21:58
  • From following that, I believe the domain and codomain are both $C$, and the range is $A$? – Shannon Jan 04 '18 at 22:06
  • Because I worked out all the values of $g(h(x))$, so $g(h(1)) = g(2) = 2$, $g(h(2)) = g(3) = 3$, $g(h(3)) = g(2) = 2$, $g(h(4)) = g(1) = 1$. Then putting those output values into a set gives {$2,3,2,1$} = {$1,2,3$} = $A$. I don't see where $g \circ h$ sends $1 \to 4$, just the other way around. – Shannon Jan 04 '18 at 22:52
  • Oh, yes you are absolutely right, I've made a mistake there. But in any case, expressing it as ${1,2,3}$ is more appropriate than saying $A$ because one may rename the elements such that there is no mutual elements for $A$ and $C$. But your approach is totally fine, I think you got that :) I apologize for my mistake. – ArsenBerk Jan 04 '18 at 22:57
  • Awesome, thank you so much for your help once again! – Shannon Jan 04 '18 at 22:58
  • You're welcome. I thank you too for your correction. – ArsenBerk Jan 04 '18 at 22:59