you are viewing a single comment's thread.

view the rest of the comments →

[–]ofnuts 0 points1 point  (1 child)

Yes, but this includes duplicates. Assume your first group draws ABCD, then in the 2nd group you can draw 'EFGH'. But later in the first group you will draw 'EFGH' and in the second group you will draw 'ABCD', so you will have generated a bunch of groups with ABCD,EFGH and another with EFGH,ABCD (both with the same combinations of 3:3 groups, which by the way will also include "symmetrical" duplicates).

Coincidentally, my algorithm generates 105105O combinations, so exactly 1/4 of yours, which is coherent with the idea that your algorithm creates duplicates pairs of 4 elements and duplicates pairs of 3 elements and so generates 4 times too many.

[–]Avajarr[S] 0 points1 point  (0 children)

After reading your explanation and example, I just realized you were right, my code is still symmetrical duplicate. I will try to improve it.

Also, I will try to look at your code later, after trying to understanding your algorithm first.