Creating a bijective function from $\mathbb{N}$ to the even integers

1.3k Views Asked by At

I am unsure about how to solve this problem with a natural numbers domain.

The question is: Give an example of a function $f:\mathbb{N} \rightarrow \{x\in \mathbb{Z} :x\text{ is even} \}$ that is bijective.

This question is obvious to me with integers domain, but with natural numbers, I'm unsure how to include zero (an integer) as well as all negative integers while maintaining a positive domain. How should I approach this?

P.S. Natural numbers do not include zero here.

Thanks!

3

There are 3 best solutions below

0
On

I'm unsure how to include zero (an integer) as well as all negative integers while maintaining a positive domain.

Hint: Use a piecewise function.

Partition the domain (non-zero naturals) into two parts, such as odd and even numbers, bijectively mapping one part onto the non-negative even integers and the other part onto the negative even itegers.

$$f(x)=\begin{cases}\Box &:& x\in 2\Bbb N\\\Box &:& x\in 2\Bbb N-1\\ \textsf{undef}&:& x\notin\Bbb N\end{cases} \\ f(2\Bbb N)=2\Bbb Z^+{\cup\{0\}}\\ f(2\Bbb N-1)=-2\Bbb Z^-$$

0
On

$0=0$

$0-1=-1$

$0-1+2=1$

$0-1+2-3=-2$

$0-1+2-3+4=2$

$0-1+2-3+4-5=-3$

$0-1+2-3+4-5+6=3$

$x_n=\sum_{k=0}^n (-1)^k \cdot k$

$x_{m}= \sum_{k=0}^{4(m-1)} (-1)^k \cdot k$

$x_1=0. $

$x_2=0-1+2-3+4=2.$

$x_3= 0-1+2-3+4-5+6-7+8=4.$

It's surjective since it maps to every even integer $f(m)=2(m-1)$. Injective since $f(m_1)=f(m_2) \implies 2(m_1-1)=2(m_2-1)\implies m_1-1=m_2-1\implies m_1=m_1$. Thus we have a bijection.

Note however this method can be used to provide a bijection from the naturals to every integer.

0
On

First, to get the unsigned sequence $0,2,2,4,4,6,6,\dots$, we solve the nonhomogeneous linear recurrence $a_n=a_{n-2}+2$ with initial values $a_0=a_1=0$. The solution is $$a_n=\frac{2n-1+(-1)^n}2$$ which we multiply by the alternating sign factor $(-1)^n$: $$n\mapsto(-1)^na_n=\frac{(-1)^n(2n-1)+1}2$$