In a practise exam, the examinator asks: "Give example of a surjection $g: \mathbb R\rightarrow \mathbb R\times \mathbb R$".
The answer key suggests finding a surjection from $\mathbb R\rightarrow [0,\infty)^2$ which can be done by defining the decimal expansion of $x$ as $x=\pm a_0a_1...a_n,b_0b_1...$ then letting $(u,w)$ $$ \begin{cases} u=a_0a_2...a_n,b_0b_2b_4b_6....\\ w=a_1a_3...a_{n-1},b_1b_3b_5... \end{cases} $$ if $n$ is even and \begin{cases} u=a_0a_2...a_{n-1},b_0b_2b_4b_6....\\ w=a_1a_3...a_{n},b_1b_3b_5... \end{cases} if $n$ is odd.
Call this $q(x)$.
Then we simply define $f:[0,\infty)^2\rightarrow \mathbb R \times \mathbb R$ where $f(u,w)=(\ln u, \ln w)$ and defining $ln(0)=1$.
The surjection is then given by $g=q\circ f$
I do not understand why we do have to split into cases if $n$ is odd and even and I do not understand why we can skip every other number in the inputs. Can I get some help about that?