1

Im being asked to define a bijection from the set of natural numbers including zero of non negative integers to the set of natural numbers. Then prove that the function is surjective and injective. So far I tried creating a piece wise equation where:

$$f(n) = \begin{cases}2n, &\text{if }n >= 0\\ -2n-1,& \text{if } n < 0 \end{cases}$$ I'm not sure if thats what they want but I think its correct.

Original question

If possible I would appreciate getting insight on how to do B as well because I genuinely have no clue.

Wolgwang
  • 1,563

1 Answers1

3

As $n < 0$ never happens (because your domain is $\{0,1,2,3,4,5,.....\}$) that functions is just $f(n) = 2n$ and so $f(n) = odd$ never occurs.

Look, you just need to map $\{0,1,2,3,4,......\}$ to $\{1,2,3,4,5,.....\}$ that's one to one and onto. Think of a way to do that. And don't assume it will be hard.

(It will be easy...... really easy.)


Oh, also the reason your function, which maps $\mathbb Z\to \mathbb N$, works so well, is that by moving all the positives to the even positions, it makes room for all the negatives.

But in this case you don't have an infinite number of negatives. The only extra element is... $0$.... so you have to make room to fit one element in.

I hope I have given you enough hints.

fleablood
  • 124,253