Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • This was the exact approach I tried initially, but with linq instead of bit masking. The problem is, as you approach the end of the set of sixes, you're generating repeat combination sets in the 4 sets of 5. That duplication is what I am trying to avoid. Commented Apr 22, 2016 at 21:01
  • No, I don't think they are repeated; they are necessary. The first set of 5 generates from 20 elements. The 2nd set of five will generate from 15 elements, and the 3rd set of size 5 from 10 elements. The last set of 5 is simply given. They are each fundamentally different elaborations, when you take mapping into account. It is true that for each set of 6 similar sets of 5 are generated, but not if you take mapping into account. Besides this combo generator is rather efficient, you'd be better of regenerating them than storing them, for example, because of the memory expansion. Commented Apr 22, 2016 at 21:06
  • Ok, I'm trying to hear what you're saying, but I don't think this will generate any repeats in the overall match, unless I misunderstood the definition of duplicate. (Naturally there will be some repeats within sub-portions of the match, but you want those, because the whole match is different, right?) Commented Apr 22, 2016 at 21:24
  • Here is why I think there will be duplicates. Given the first three outer loops have generated the following values: [ a b c d e f ] [ g h i j k ] [ l m n o p ]. The 4th loop can now generate combos of 5 from the remaining 10 letters (qrstuvwxyz), each time the 5th loop will be made up of whatever letters are left. Commented Apr 23, 2016 at 5:49
  • The first time 4th loop will generate [ q r s t u ] and the 5th will be [ v w x y z ]. The last time the 4th loop runs, it will generate [ v w x y z ] and the 5th loop will generate [ q r s t u ], which is a duplicate (since the first 3 loops haven't changed at all). The edges are not the only place this will happen, and it will happen for all levels of loops (except the first, which is made up of six). Does that make sense? Commented Apr 23, 2016 at 5:49