Give a function $g : \mathbb{N} \times \mathbb{N} \to \mathbb{N}$
such that $g$ is one-to-one and onto function.
the onto part I could easily solve but every function I think of, is not one-to-one.
Give a function $g : \mathbb{N} \times \mathbb{N} \to \mathbb{N}$
such that $g$ is one-to-one and onto function.
the onto part I could easily solve but every function I think of, is not one-to-one.
There are two standard examples: $$(x,y)\mapsto y+\frac{(x+y)(x+y+1)}{2},$$ it is technical to prove it is a bijection and not too interesting.
The other one is given by: $$(x,y)\mapsto 2^x(2y+1)-1,$$ it is bijective essentially from the fundamental theorem of arithmetic.