This problem is a variation of the following problem:
For some reason, I misread "longest" into "shortest", which made the problem much harder.
My version of this problem:
Given n points (a1,0), (a2,0), ..., (an,0). Pick k points from n points and calculate the shortest distance d between two points in those k points. Calculate the expected value of d.
An easier version of this problem:
n points are (1,0), (2,0), ..., (n,0).
Is this problem solvable in O(n3), O(n2), O(nk) or even O(nlogn)? Thank you.