in reply to Algorithm to convert combinations to bitstring
You can find ranking/unranking algorithms for combinations in this node: Re: Sampling from Combination Space. It's just an implementation of algorithms I found in a textbook (source given in that node). I believe the ranking is with respect to lexicographic ordering, but I don't remember for sure. (In that thread, the ordering of the combinations was irrelevant) Also the textbook probably has implementation details (like running time complexity). It may not be online anymore, but if you want I can send you a copy of my PDF.
Hopefully this does what you need, or at least gives you a place to start. You'll certainly have to adapt it to use alphabet A..Z instead of 1..26, and get the off-by-one things the way you need.
blokhead
|
|---|