Choose the kth choice of choosing n things out of m Say I have a list, L, of m things.

I want to pick n things out of the total of m things in the list.

Suppose there are W ways of doing this. I want to choose the kth way where k is in the range 1..W.

i.e. my function is this:

ChooseKthChoiceOf(L,n,k){
   ....
}


Any good algorithms for this?
This is called unranking.  The combinatorial number system provides a clean solution to this particular problem.

See also https://computationalcombinatorics.wordpress.com/2012/09/10/ranking-and-unranking-of-combinations-and-permutations/ for further reading.