Show $A\cup B$ is denumerable by constructing a bijection

28 Views Asked by At

I just need some clarifications in the solution to the problem my teacher gave me below:

Suppose A and B are disjoint denumerable sets. Show that $A\cup B$ is denumerable by constructing a bijection.

proof: Since A and B are denumerable, then f:N->A and g:N->B are bijective.

h:N->$A\cup B$ is defined by :

h(n)= { $f(\frac{n+1}2)$ if n is odd and $g(\frac{n}2)$ if n is even)

From what I know, to now show bijection, I would have to prove surjectivity and injectivity. But my question here is why h(n) was defined like this. Why is my teacher saying h(n)= { $f(\frac{n+1}2)$ if n is odd and $g(\frac{n}2)$ if n is even). I was just wondering if the g and f could be switched. Like h(n)= { $g(\frac{n+1}2)$ if n is odd and $f(\frac{n}2)$ if n is even).