Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am looking for a integer-valued one-to-one function that maps coordinates $(x,y,z)$ in space $\mathbb{Z^+}$ to intergers in $\mathbb{Z^+}$?

share|improve this question
    
The set of positive integers . Changed it to Z. –  adi Oct 10 '12 at 9:56

1 Answer 1

up vote 1 down vote accepted

Let $\{x_i\}_0^\infty$ the decimal representation of $x$, that is $$ x = \sum_0^\infty x_i\cdot 10^i $$ Now to obtain an injective function $f$, you can take as image of $(x, y, z)$ the number whose decimal representation is $$ (x_0, y_0, z_0, x_1, y_1, z_1,x_2, y_2, z_2,\dots) $$ Finally, if you want a function which is also onto, you can use the following one $$ (x, y, z) \to f(x - 1, y - 1, z - 1) + 1 $$

share|improve this answer
    
I was also wondering , if I have $n$ such tuples ${(x,y,z)}$ , is it possible to come up with a mapping that maps these to ${1..n}$ ? –  adi Oct 10 '12 at 10:30
    
Of course. You can arbitrarily link each one of those $n$ tuples, $(x, y, z)$, to one number in $\{1,\dots, n\}$, so there are $n!$ different such maps. –  AlbertH Oct 10 '12 at 10:41
    
Note however, AlbertH's solution provides a unique integer for every unique tuple. To ensure the same for a function mapping to integers in the range of one to n requires knowledge of all tuples that are yet to be mapped. –  Marcks Thomas Oct 10 '12 at 10:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.