in reply to Re: Multiple Combinatorics in thread Multiple Combinatorics
If '07' has less number of picks compared to '16', then we will have no solution at all. But, it is possible that ('07','16') has (3,2) picks or even (2,2) picks respectively. In the first case there will be exactly 1 selection from 0 and 7 in any solution. In the 2nd case, 0 and 7 will not be selected in any solution.
Re^3: Multiple Combinatorics
by BrowserUk (Pope) on Apr 15, 2012 at 17:54 UTC

Care to clarify that? Maybe add some examples? Cos like JavaFan, I don't get it.
As soon as you pick any two values from group 2 (1..6), you've also already picked two values from group 1 (0..7), so there is no way to comply with your "every resulting row should satisfy the initial condition" requirement.
You would either a) a pick two from both groups and therefore have 4 from the larger group; or b) pick nothing from the larger group, in which case you have nothing from the larger group.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks  Silence betokens consent  Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
 [reply] 

Yes:
if Group B (1..6) is subset of Group A(0..7) and Pick(B)=2 is equal to Pick(A)=2 then we apply 'b): pick nothing from larger group';
In this case, we still have picked 2 values from larger group automatically, which holds the initial condition. Only thing that '0' and '7' won't be picked at all in any resultset. ( from the given data).
 [reply] 

The only way to deal with this efficiently is to reduce the input sets to nonoverlapping sets prior to permuting them.
To do that, you need to lay out the rules for overlapping sets. You'd need to define how to deal with:
 One set completely overlaps another;
 the overlap is less than the number to be picked from the smaller group.
 The overlap is less than the number to be picked from the larger group.
 The overlap is equal to the number to picked from the smaller group.
 ...
 There is only a partial overlap between the groups:
 The overlap is smaller than the number to be picked ....
 ...
Whence you've defined how all the possibilities should be resolved into distinct groups, the rest should be relatively easy.
I'm still bugged by your lack of explanation of what the purpose of this is?
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks  Silence betokens consent  Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
 [reply] 
