Functions That Enumerate Pairs
Functions That Enumerate Pairs
A function that enumerates pairs is a bijective mapping of the set of non-negative integers to the set of all ordered pairs of non-negative integers. Thus there are three functions , , that satisfy the relations , , , with =i. One such triple is defined by ; , where is the largest integer for which .
f
i
k
l
i(k(z),l(z))=z
k(i(x,y))=x
l(i(x,y))=y
-1
f
i(x,y)=(x+y)(x+y+1)/2+x
k(z)=z-u(u+1)/2
u
u(u+1)/2≤z;l(z)=u-k(z)