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}\)?

Step by step with comments, a check and common mistakes.

Step-by-step solution

  1. A bijection from \(\displaystyle \mathbb{N}\) onto \(\displaystyle \mathbb{Z}\) must reach all integers, including negatives, without repeating values.

    \[\displaystyle f:\mathbb{N}\to\mathbb{Z}\text{ inyectiva y sobreyectiva}\]
  2. 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\).

    \[\displaystyle 0,\,-1,\,1,\,-2,\,2\]
  3. The values alternate between negatives and positives with increasing absolute value, so they cover \(\displaystyle \mathbb{Z}\) without repeating.

    \[\displaystyle f(n)=(-1)^n\left\lceil \tfrac{n}{2}\right\rceil\]
  4. The other functions fail: \(\displaystyle n-1\) never takes \(\displaystyle -2\), \(\displaystyle n\) takes no negatives, and \(\displaystyle n^2\) takes none either.

    \[\displaystyle n-1\ge -1,\quad n\ge 0,\quad n^2\ge 0\]
  5. 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\]

Answer

\(\displaystyle f(n)=(-1)^n\lceil n/2\rceil\)

🎯 Build my path to this exercise