In: Computer Science
Consider f,g:ℤ→ℤ given by:
Which of the following statements are true? Select all that apply
(a) |
f is an injection |
(b) |
g is an injection |
(c) |
f∘g is an injection |
(d) |
g∘f is an injection |
(e) |
f is a surjection |
(f) |
g is a surjection |
(g) |
f∘g is a surjection |
(h) |
g∘f is a surjection |
So we have f(n)=2n and f:Z -> Z
but for 1 as output n must be 1/2 (not an integer) which is outside the domain, so it is not surjective but injective.
for g(n)= n div 2 and f: Z -> Z
and g is not even a function: g(1)=1/2 out of the range. (so neither surjective nor injective)
fog = 2 (n/2)= n hence is surjective.
gof = 2n / 2 = n again surjective.
so the right options are (a), (g) and (h).