4

Having $k$ numbers $N_i\in\mathbb{N}$, I'm looking for a bijective mapping

$f:\mathbb{N}\times\ldots\times\mathbb{N}\rightarrow\mathbb{N}$

So that $f^{-1}\left(N_0\right)=\left(N_1,\ldots,N_k\right)$.

Any ideas?

2 Answers2

6

There is a nice bijection that works like this (here for $k = 3$):

$$ \color{red}{42},\color{blue}{2013},\color{green}{789}, \to \color{blue}{2}\, \color{red}{0}\, \color{green}{7}\, \color{blue}{0}\, \color{red}{0}\, \color{green}{8}\, \color{blue}{1}\, \color{red}{4}\, \color{green}{9}\, \color{blue}{3}\, \color{red}{2}\,,$$

this is an easy extension of this $\mathbb{N}^2 \to \mathbb{N}$ bijection.

Another approach is to use any $f: \mathbb{N}^2 \to \mathbb{N}$ bijection and compose it with itself, e.g.

$$f_k (a_1,a_2,\ldots,a_k) = f(a_1, f(a_2, \ldots f(a_{k-1},a_k)\ldots)).$$

I hope this helps $\ddot\smile$

dtldarek
  • 37,969
2

To give a bijection $A\leftrightarrow\Bbb N$ amounts to define a sequence $a_1,a_2,a_3,...$ which includes all elements of $A$.

When $A=\Bbb N^k$ a standard way to do this is to write $$ \Bbb N^k=\bigcup_{r=0}^\infty A_r,\qquad A_r=\{(n_1,...,n_k)\in\Bbb N^k\,|\,\sum_{j=1}^kn_j=r\} $$ and since every $A_r$ is finite we can list all elements of $A_1$, followed by all elements of $A_2$, followed by all elements of $A_3$, and so on.

This certainly works although it may not be easy to say what is the $n$-th $k$-ple ofthe sequence excplicitly.

P.S.: the above is written under the conventional assumption that $0\in\Bbb N$. If, so to speak, $\Bbb N$ starts with 1 the above works in the same way with the observation that the first non-empty subset $A_r$ is $A_k$.

Andrea Mori
  • 28,458