View Single Post
  #5  
Old 12-01-2005, 07:07 PM
Guest
 
Posts: n/a
Default Re: Enumerating Groups - Algorithm

To go backwards, i.e. to figure out which group of 3 corresponds to n in your enumeration, find x such that (x choose 3) >= n > (x-1 choose 3), and put a 1 in digit x (counting from the right). Then find y such that (y choose 2) >= n-(x-1 choose 3) > (y-1 choose 2), and put a 1 in digit y. Find z similarly.

For n=13, (6 choose 3) >= 13 > (5 choose 3), so we put a 1 in the 6th digit from the right, i.e., we include A. (3 choose 2) = 13-(5 choose 3) > (2 choose 2), so we put a 1 in the 3rd digit from the right. (2 choose 1)= 13-(5 choose 3)-(2 choose 2)> (1 choose 1), so we put a 1 in the 2nd digit from the right, giving us the element 100110, or ADE.
Reply With Quote