How can we randomly sample a set $S$ of $k$ integers from the range $[1, n]$ such that:
The set satisfies $\max(S) - \min(S) \leq w$.
Each integer in $[1, n]$ has an equal chance of being in the set. If this is not possible, it should be as close as possible (minimizing the variance of probability).
1 and 2 permitting, the method is as uniformly random as possible. That is, the maximum entropy distribution under constraints 1 and 2.
We have $k < w$.
Are there any efficient methods? Methods that have some bias but get close?