We are given $X,X\_1,\ldots,X\_N$ independent and identically distributed $k$-dimensional vectors. For a given query point $X\_q\in\mathbb{R}^k$ assume without loss of generality that $X\_1,\ldots,X\_m$ are its $m$ nearest neighbors from the $N$ points. Define $$S\_m(X\_q):=\{X\mid D(X,X\_q)\leq D(X\_m,X\_q)\}$$
the sphere containing the $m$ nearest neighbors to $X\_q$ and let $v\_m(X\_q)$ be the volume of this region as
$$v\_m(X\_q)=\int\_{S\_m(X\_q)}1\:dX.$$
The probability content of this region, i.e. the probability of $X$ falling into $S\_m(X\_q)$ is given by
$$u\_m(X\_q)=\int\_{S\_m(X\_q)}p(X)\:dX,$$
where $p(X)$ is the distribution of $X$ and the $X\_i$.
Now both [this](https://dl.acm.org/doi/10.1145/355744.355745) and [this](https://ieeexplore.ieee.org/document/1055003) paper claim that $u\_m(X\_q)$ follows a beta distribution that is independent of the chosen distance $D(X,Y)$ and the given distribution $p(X)$.
However, neither gives of proof of this, is there any easy way to see this?



Volume of randomly changing sphere follows beta distribution
Fix the query point $X\_q$, and take random variable $\xi=D(X,X\_q)$ for $X$ being distributed w.r.t. your law, and let $F\_{\xi}$ be its distribution function. Then, you are taking a sample of size $N$ of $\xi$, order them by increasing (obtaining $\xi\_{(1)}<\dots<\xi\_{(N)}$) and you evaluate $F(\xi\_{(m)})$. 


But for any continuous distribution of $\xi$, the random variable $F(\xi)$ follows a uniform distribution on $[0,1]$. In the same way -- as here the only things you are using are the order and the distribution function, -- the result here does not change if you make an increasing change of variable, passing to $\xi'=g(\xi)$ (as the distribution function then becomes pre-composed with $g^{-1}$). In particular, the result here will be exactly the same as if you take $\xi$ to be uniformly distributed on $[0,1]$ (this corresponds to taking $g=F\_{\xi}$). 


And then you are asking for the law of $\xi\_{(m)}$ for $\xi\sim R([0,1])$, which is exactly the beta distribution.


