# Average length of a line in a box

This topic is 3153 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm trying to come up with a statistical test for judging the quality of a prng. It involves randomly plotting 2 n-dimensional points in a n-dimensional box with sides of length 1, and finding the average distance between two points. I know the average squared distance should be dimensions/6, but I'm looking to find the unsquared distance. For 1 dimension I've calculated the average distance to be 1/3, but for dimensions 2 and higher I haven't been able to integrate the equations. For 2 dimensions the data looks like the average distance should be pi/6. Does anyone know how I could calculate these values?

##### Share on other sites
This is a difficult problem. Wolfram has pages for n=2, n=3 and the general case.

##### Share on other sites
The 8 they have should be good enough for me, since this prng test wouldn't be testing a very high number of dimensions anyway. Thanks for the links!

1. 1
2. 2
Rutin
25
3. 3
4. 4
5. 5

• 11
• 10
• 13
• 20
• 14
• ### Forum Statistics

• Total Topics
632950
• Total Posts
3009378
• ### Who's Online (See full list)

There are no registered users currently online

×