View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.programming
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default List all combinations of 6/36 with unique 4 numbers

"Peter T" wrote:
"joeu2004" wrote in message
"Peter T" wrote:
I knocked something up to get a feel, pretty crude
and slow but it churned out 1,947,792 combinations
of 6 numbers of which 16,431 fitted your '4 out of 6' criteria.


I would like to understand why you and I got very different results.

[....]
16,431, after spotting a small error now only 16,430 It's small enough to
post here


Well, that implementation does not seem to work at all.

Of the 16,430 combinations, only 153 fit Martin's requirement, namely:
every quad subset of the 6 numbers in each combination is unique (there are
15 such quad subsets). That is, they do not appear together in any other
combination.

If you are intereted, see "peterT combo.xls" at
https://www.box.com/s/409aee79b7b3949970f1. See the explanation in the
worksheet "README FIRST".

For example, in the "data" worksheet, combination/row #12 shows:

A C:H I J:O
1 2 4 5 6 7 1 2 4 5 6 7 #1 1 2 3 4 5 6

Note that 1 2 4 5 in C:H appeared first in row #1, shown in J:O for
convenience. I believe that violates Martin's requirements.

There really is no need for me to try to identify the flaw(s) in your
implementation. I had already pointed to my implementation, which seems to
truly work (and it is m-u-c-h faster). It produces 2240 combinations with
unique quad subsets.

If you are interested, see "uniq 4 from 6 of 36.xls" at
https://www.box.com/s/2a361ad6de78e8f4865e.