Countable set · Exercise-COUNTABLE-SET-006
Step-by-step solved exercise: Cardinals
Which of these functions is a bijection from \(\displaystyle \mathbb{N}\) onto \(\displaystyle \mathbb{Z}\)?
Countable set · Exercise-COUNTABLE-SET-006
Which of these functions is a bijection from \(\displaystyle \mathbb{N}\) onto \(\displaystyle \mathbb{Z}\)?
A bijection from \(\displaystyle \mathbb{N}\) onto \(\displaystyle \mathbb{Z}\) must reach all integers, including negatives, without repeating values.
For the first function we evaluate the first terms: \(\displaystyle f(0)=0\), \(\displaystyle f(1)=-1\), \(\displaystyle f(2)=1\), \(\displaystyle f(3)=-2\), \(\displaystyle f(4)=2\).
The values alternate between negatives and positives with increasing absolute value, so they cover \(\displaystyle \mathbb{Z}\) without repeating.
The other functions fail: \(\displaystyle n-1\) never takes \(\displaystyle -2\), \(\displaystyle n\) takes no negatives, and \(\displaystyle n^2\) takes none either.
Therefore, \(\displaystyle (-1)^n\lceil n/2\rceil\) is the sought bijection from \(\displaystyle \mathbb{N}\) onto \(\displaystyle \mathbb{Z}\).
\(\displaystyle f(n)=(-1)^n\lceil n/2\rceil\)