Re: Multi-dimensional Array

From: Ed Prochak <edprochak_at_adelphia.net>
Date: Mon, 24 Mar 2003 16:01:08 GMT
Message-ID: <3E7F2F96.6020201_at_adelphia.net>


M wrote:
> Thanks. But I do have a problem in using this because:
> (1) I need to have a multi-dimensional array up to 12 parameters; and
> (2) It's not easy to proof that the mapping function is 1-to-1.
>
> Thanks.
>

If the dimensions are integers, then the mapping is one-to-one.

The two dimensional mapping I did comes from number theory. It is part of a proof that the number of integers is the same order of infinity as the number of integer points on a plane. It is easy to convince yourself, just draw two dimensions and plot the function. It is a set of lines that intersect every 2D point in the quadrant. the lines have negative slope.

I'm not sure if this will make it clearer: \
4.
\ \
3. .
\ \ \
2. . .
\ \ \ \
1. . . .
  1\2\3\4\

Building the mapping for 12 dimensions could be hard. In fact I haven't tried this for 3dimensions yet. Hey something for me to do in my spare time 8^)

Any mathmeticians among us able to do the mapping for 12 dmiensions? or is recursive calls to the 2D function sufficient?

lets see with 4 parameters
a,b,c,d

index2d(index2d(index2d(a,b),c),d)

I think that works. make a new function to do all 12 for you so it doesn't look so much like LISP.

-- 
Ed Prochak
running: http://www.faqs.org/faqs/running-faq/
family:  http://web.magicinterface.com/~collins
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Mon Mar 24 2003 - 17:01:08 CET

Original text of this message