Is there an effective method for sampling a random n-choose-k combination (with a uniform probability, for example)?
I've read this question but it requires generations of all combinations, not random combinations.
In general, I am aware of the rejection sampling, but it is very inefficient.
I also came across a reservoir sampling, but this seems to be mostly focused on the very large n unknowns. I am more interested in big but n finishes (certainly not big enough to not fit in the memory.) Well, a size n chart will hold itself in memory but the state space any combination of n-choose-k might not).
Is there an investigation / review on this topic? Does Knuth cover n-choose-k random sampling in its TAOCP texts?
Thank you in advance.
edit: To be a little more specific, a space of 5-Choose-3 on the string & # 39; ABCDE & # 39; would look like this:
[‘ABC’, ‘ABD’, ‘ABE’, ‘ACD’, ‘ACE’, ‘ADE’, ‘BCD’, ‘BCE’, ‘BDE’, ‘CDE’]
(Note: this is a combination without replacement). And I want to be able to sample from this space with a uniform distribution, using a general algorithm (an algorithm that works with n and arbitrary k).