View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default permutations/combinations

Does order matter? Because if it does, you could really have:

1, 2, 3, 4
1, 2, 4, 3
1, 3, 2, 4
1, 3, 4, 2
1, 4, 2, 3
1, 4, 3, 2
2, 1, 3, 4
2, 1, 4, 3
2, 3, 1, 4
2, 3, 4, 1
2, 4, 1, 3
2, 4, 3, 1
3, 1, 2, 4
3, 1, 4, 2
3, 2, 1, 4
3, 2, 4, 1
3, 4, 1, 2
3, 4, 2, 1
4, 1, 2, 3
4, 1, 3, 2
4, 2, 1, 3
4, 2, 3, 1
4, 3, 1, 2
4, 3, 2, 1



Or does only grouping (1st half/2nd half) matter? In which case:

1, 2, 3, 4
1, 3, 2, 4
1, 4, 2, 3
2, 1, 3, 4
2, 3, 1, 4
2, 4, 1, 3
3, 1, 2, 4
3, 2, 1, 4
3, 4, 1, 2
4, 1, 2, 3
4, 2, 1, 3
4, 3, 1, 2

Or does only pairing and order matter? In which case:

1, 2, 3, 4
1, 3, 2, 4
1, 4, 2, 3
3, 4, 1, 2
2, 4, 1, 3
2, 3, 1, 4

Or does only pairing matter? In which case:

1, 2, 3, 4
1, 3, 2, 4
1, 4, 2, 3

Bernie
MS Excel MVP


"Niels" wrote in message ...
Bernie,

Thanks for the tip, so it seems that I have to set the upper limit to 999 combinations. But, the
below mentioned formula just gives the number of posible combinations, but I also need the file
described below. It is used in modeling software which uses the first 50% for model building and
the second 50% for testing. Once I have all combinations written out I use lookup functions to
fill the values. So for the 4 points you describe below it would look like this:

1 1
1 2
1 3
1 4
2 1
2 3
2 2
2 4
3 1
3 4
3 2
3 3

Can I easily produce such file with a threshold of max 999 combinations? Regards,

Niels

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Niels,

=COMBIN(#,#/2)/2

So, for 4 points, there are 3 unique splits:

1 2 3 4
1 3 2 4
1 4 2 3

unless order is important, then use

=COMBIN(#,#/2)

But note that there are
2.36x10^152
unique ways to split 512 points, so doubt you'll be able to deal with all possible combinations.

HTH,
Bernie
MS Excel MVP


"Niels" wrote in message
...
For modeling purposes in need all posible combination to split 8-512 points in half (50%
training, 50% testing). So for instance 10 points, how many times can I make unique combinations
of 5 by 5. The result file should have in the fist column the number of the combination, and in
the second the order e.g.

1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
2 10
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
3
.
etc. till max. 999

Any help is appreciated, regards,

Niels