Lexicographic ordering, ranking and unranking of combinations
M. C. Er · International Journal of Computer Mathematics · 1985
A simple way of representing combinations as binary strings is discussed. The bijective mapping between the set of combinations and the set of corresponding binary codewords is shown to be isotone, in lexicographic order. A recursive algorithm for enumerating all combinations in lexicographic order is presented. Simple ranking and unranking algorithms for coding and decoding position indices of combinations in a lexicographic listing are also described.