In cartesian plane, $N$ points are randomly generated within a unit square defined by points $(0,0) (0,1) (1,1) (1,0)$, with uniform distribution. What is the mathematical expectation of the average distance of all distances between all points (distances between the point and the same point (which are obviously $0$) are excluded from the calculation of the average).
There are actually two versions of this question:
- Distance is defined as Euclidian.
- Distance is defined as Manhattan.
The context of this question is some performance benchmarking in computer science, which are of practical nature and far from pure mathemathics, so I am not going the bother the reader with these details.