# Lesson 31 Solutions

Exercise 1) Let $f:\{1, 2, 3, 4\}\rightarrow \{a, b, c\}$ be the function defined as $f(1)=b, f(2)=b, f(3)=c, f(4)=a$ and let $g:\{a,b,c\}\rightarrow \{apple, Kobe, Donkey, fruitcake\}$ be the function defined as $g(a)=Kobe, g(b)=fruitcake, g(c)=Donkey$.  Write down (or say out loud, or figure out in your head) the value of $g\circ f: \{1, 2, 3, 4\}\rightarrow \{apple, Kobe, Donkey, fruitcake\}$ for each element in $\{1, 2, 3, 4\}$.  In other words, calculate $g(f(a))$ for all $a\in A$.

Solution:  All we have to do here is “trace through” the various definitions of the functions.  Namely, for figuring out what $g(f(a))$ is for some $a\in \{1, 2, 3, 4\}$, we simply need to follow the element $a$ through the two functions.  So here we go.  Let’s start with $1\in \{1, 2, 3, 4\}$.  We have $f(1)=b$, and $g(b)=fruitcake,$ so $g\circ f(1)= g(f(1))=fruitcake$.  Simple as that!

Similarly, we have $f(2)=b$ and again we have $g(b)=fruitcake$ so we have $g\circ f(2)=g(f(2))=fruitcake$.  Next, we have $f(3)=c$ and $g(c)=Donkey,$ so $g\circ f(3)=Donkey$.  Finally we have $f(4)=a$ and $g(a)=Kobe,$ so $g\circ f(4)=Kobe$.  To recap, then, we have that the composition $g\circ f: \{1, 2, 3, 4\}\rightarrow \{apple, Kobe, Donkey, fruitcake\}$ of $f$ and $g$ is defined by

$g\circ f(1)=fruitcake$

$g\circ f(2)=fruitcake$

$g\circ f(3)=Donkey$

$g\circ f(4)=Kobe$.

And we’re done!

Exercise 2)  Recall that $\mathbb{Z}$ is the set of integers: $\mathbb{Z}=\{..., -3, -2, -1, 0, 1, 2, 3, ...\}$.  Let $\mathbb{E}$ denote the set of even integers: $\mathbb{E}=\{..., -6, -4, -2, 0, 2, 4, 6, ...\}$.  Let $\mathbb{T}$ denote the set of multiples of 3: $\mathbb{T}=\{..., -9, -6, -3, 0, 3, 6, 12, ...\}$.  Let $f:\mathbb{Z}\rightarrow \mathbb{E}$ be the function that takes each integer to 4 times that integer, so that $f(a)=4\times a$ and for example $f(-5)=-20\in \mathbb{E}$ (note that $f$ is most certainly not surjective).  Now let $g:\mathbb{E}\rightarrow \mathbb{T}$ be the function that sends each element in $\mathbb{E}$ to 3 times itself, so that $g(a)=3\times a$ and for example $g(6)=18$.  Let $g\circ f:\mathbb{Z}\rightarrow \mathbb{T}$ be the composition of $f$ and $g$.  Calculate

i) $g\circ f(-3)$

ii) $g\circ f(5)$

iii) $g\circ f(10)$.

Solution:  Again, for each of the three things that we need to calculate, we just need to “follow through” the definitions of the functions.  So, for i), we have that $f(-3)=-12$ since $f$ sends each integer to 4 times itself.  Then $g(-12)=-36$ since $g$ sends each element in its domain to 3 times itself.  Thus $g\circ f(-3)=g(f(-3))=-36$.  However, we notice that we can do this much faster.  For let’s choose some arbitrary integer $n\in \mathbb{Z}$.  Then $f(n)=4n$ by definition of $f$.  Additionally, by definition of $g$, $g(4n)=3\times 4n=12n$.  So effectively what we’re doing by first applying $f$ and then applying $g$ is just multiplying the input integer by 12.  Thus, calculating the three cases that we’re asked to is easy.  Namely,

$g\circ f(-3)=-36(=12\times -3)$

$g\circ f(5)=60(=12\times 5)$

$g\circ f(10)=120(=12\times 10)$.

And we’re done!

Back to Lesson 31

On to Lesson 32
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 66, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9726756811141968, "perplexity": 363.7096485727536}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-34/segments/1534221210040.24/warc/CC-MAIN-20180815083101-20180815103101-00130.warc.gz"}