Raul -

I opened this as a "parallel thread" to not interfere (mess) with your original one ...

Using the 'brute force' approach you mentioned (took me a while, but I'm now with you, after I looked up 'Under" (&.:) again)

Random Generator arguments:

[1] pair of points, two points: 2
[2] no of coordinates, dimension: 2, 3, 4, ...
[3] consider myriad point pairs, like: 1e6
[4] stay within unit square, cube, tesseract, etc: $ 0

So, moving up through dimensions, only that value [2nd parameter] needs to change ...

* Unit Square (average distance)
   (+/ % #) +/ &.: *: -/ ? 2 2 1e6 $ 0
0.521956
* Unit Cube
   (+/ % #) +/ &.: *: -/ ? 2 3 1e6 $ 0
0.661962
* Unit Tesseract
   (+/ % #) +/ &.: *: -/ ? 2 4 1e6 $ 0
0.777293
* Unit body (5th dimension) what's its name
   (+/ % #) +/ &.: *: -/ ? 2 5 1e6 $ 0
0.878806

I'm definitely not an expert in probability, so I'm not sure whether this makes any sense:
* Unit Line
   (+/ % #) +/ &.: *: -/ ? 2 1 1e6 $ 0
0.333411

What I do know from experience is, that gut feeling and probability don't go together (most of the time). That said, I did some "plausibility checks" comparing avarage distance with the unit "body" diagonal:

*Unit Line
   0.33 % %: 1
0.33
* Unit Square
   0.52 % %: 2
0.367696
* Unit Cube
   0.66 % %: 3
0.381051
* Unit Tesseract
   0.78 % %: 4
0.39

That looks somehow reasonable to me, means the equation probably degrades gracefully in the case Dimension 1 (Line).

Furthermore, when going from Unit Square to Unit Cube, then from Unit Cube to Unit Tesseract, I'd expect the average to increase according to the increase of proportion of diagonals, i.e.

* Square -> Cube
   0.52 * %: 3r2
0.636867
* Cube -> Tesseract
   0.66 * %: 4r3
0.762102

which seems to approximately check with the distance average for three, resp four dimensions.

Just a thought ...
-M

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to