Please, give me an example #f:NNxxNN\toNN# #f# is a bijection ?

2 Answers
Jun 30, 2018

Please see below

Explanation:

Here , #f :NNxxNNtoNN#

We take ,

#f(x,x)=(x+x)/2=x ,x inNN#

#f(1,1)=(1+1)/2=1#

#f(2,2)=(2+2)/2=2#

#f(3,3)=(3+3)/2=3#

#f(4,4)=(4+4)/2=4#
#color(white)(..)vdots# #vdotscolor(white)(...)vdotscolor(white)(....)vdotscolor(white)(.)vdots#

#f(n,n)=(n+n)/2=n# , where , #n in NN#

#color(white)(..)vdots# #vdotscolor(white)(...)vdotscolor(white)(....)vdotscolor(white)(.)vdots#

Co-domain of #color(blue)(f=D_f=NN#

#.#Range of #color(blue)(f=R_f=NN#

#i.e. D_f=R_f=>f# is onto function.

Jul 1, 2018

#f(m,n) = 1/2(m^2+n^2+2mn+m+3n)#

Explanation:

I will assume that #NN = NN_0 = {0,1,2,3,...}# - i.e. that you count #0# as a natural number.

Consider the triangular numbers:

#T_0 = 0#

#T_1 = 1#

#T_2 = 1+2 = 3#

#T_3 = 1+2+3 = 6#
...
#T_n = sum_(k=1)^n k = 1/2n(n+1)#

We can define:

#f(m, n) = T_(m+n)+n = 1/2(m+n)(m+n+1)+n#

#color(white)(f(m, n)) = 1/2(m^2+n^2+2mn+m+3n)#

This tells you the #0#-based index of the pair #(m, n)# in the sequence:

#(0, 0), (1, 0), (0, 1), (2, 0), (1, 1), (0, 2), (3, 0), (2, 1), (1, 2), (0, 3),...#

which enumerates the points of #NN xx NN# diagonally.

Footnote

If you want a bijection from #NN_1 xx NN_1 -> NN_1# then you can define:

#g(m, n) = f(m-1, n-1)+1#

and simplify.