You have $n$ samples, each chosen independently from integers $0, 1, \ldots, n-1$ with equal probability (so although there are $n$ samples and $n$ values to choose from, it is not a permutation).
You then sort those samples into increasing order. Call these sorted samples $x_0, x_1, \ldots , x_{n-1}$. In other words, $x_0 \le x_1 \le \cdots \text{etc.}\cdots \le x_{n-1} $
I am interested in the probability distribution of $x_m$, and in particular the confidence limits on that distribution. That is, for a given confidence level $c$ (equal to, say, $0.05$ or $0.95$), the value of $a$ (an integer) such that $p(x_m \ge a) \approx c$.
It seems to me similar to a binomial distribution, in that $p(x_m \ge a)$ would be the probability that no more than $m$ sample values (out of the total $n$) should be $< a$, which for any individual sample has probability $a/n$, hence this looks like the cumulative density function of the binomial distribution $F(m; n, a/n)$ (based on the $F(k; n, p)$ notation used here). But then I start to get confused, because the confidence levels of that distribution (e.g. the "percent point function" that I could compute in SciPy using scipy.stats.binom.ppf) would be the values of $k$ such that $F(k; n, p) = c$ for a given $n$ and $p$, but here it is a different functional dependence, because $m$ and $n$ are given and we want $a$, which also makes me suspicious over whether this cumulative density function is based on the correct conditional probabilities.
Any assistance appreciated, both regarding the correct analytical expression and also any info about library functions to compute this in Python. Many thanks.