## Bijection from (Z_n)^3 to (Z_n)^2

**Moderators:** gmalivuk, Moderators General, Prelates

### Bijection from (Z_n)^3 to (Z_n)^2

I'm looking for a nice bijection from {1,...,n}^3 to {1,...,n}^2. I'm hoping to use it for a hack with an unfortunate statistical modeling program that doesn't handle vectors very well beyond two dimensions.

- The Sleeping Tyrant
**Posts:**533**Joined:**Tue Jan 23, 2007 2:49 am UTC**Location:**Ont., Canada-
**Contact:**

### Re: Bijection from (Z_n)^3 to (Z_n)^2

I'm afraid that whenever n is bigger than 1 there isn't any bijection between them, since the first contains n^3 elements while the second has only n^2 elements.

### Re: Bijection from (Z_n)^3 to (Z_n)^2

The Sleeping Tyrant wrote:I'm afraid that whenever n is bigger than 1 there isn't any bijection between them, since the first contains n^3 elements while the second has only n^2 elements.

Yes, of course. I feel dumb having asked the question. What about from {1,...,n}^3->{1,...n}x{1,...,n^2}?

- jestingrabbit
- Factoids are just Datas that haven't grown up yet
**Posts:**5967**Joined:**Tue Nov 28, 2006 9:50 pm UTC**Location:**Sydney

### Re: Bijection from (Z_n)^3 to (Z_n)^2

There's always the natural bijection, (a,b,c) -> (a, (b,c)). There are also a myriad other maps. What sort of thing are you looking for?

edit: misread the problem, saw the ^2 as outside the }. Gmal's is right.

edit: misread the problem, saw the ^2 as outside the }. Gmal's is right.

Last edited by jestingrabbit on Sun May 29, 2011 7:39 pm UTC, edited 1 time in total.

ameretrifle wrote:Magic space feudalism is therefore a viable idea.

### Re: Bijection from (Z_n)^3 to (Z_n)^2

jestingrabbit wrote:There's always the natural bijection, (a,b,c) -> (a, (b,c)). There are also a myriad other maps. What sort of thing are you looking for?

A simple easily computable and invertible function that takes a three-tuple of integers and returns a two-tuple of integers.

- gmalivuk
- GNU Terry Pratchett
**Posts:**26820**Joined:**Wed Feb 28, 2007 6:02 pm UTC**Location:**Here and There-
**Contact:**

### Re: Bijection from (Z_n)^3 to (Z_n)^2

(a, b, c) -> (a, (b-1)n + c)Dynotec wrote:What about from {1,...,n}^3->{1,...n}x{1,...,n^2}?

### Who is online

Users browsing this forum: No registered users and 10 guests