Combinatorics Problem

axiosless

New member
Joined
Aug 11, 2021
Messages
2
I have 4 groups: g1, g2, g3, g4
Each group has 8 sections:
g1s1, g1s2, g1s3, g1s4, g1s5, g1s6, g1s7, g1s8
...
g4s1, g4s2, g4s3, g4s4, g4s5, g4s6, g4s7, g4s8

I need to find all unique combinations of groups and sections, where there are 2 sections from each group and no overlap.
e.g., [[g1s1, g1s2, g2s3, g2s4, g3s5, g3s6, g4s7, g4s8], ..., [g1s5, g1s7, g2s2, g2s8, g3s1, g3s4, g4s3, g4s6]]

This is fairly straightforward with a single section, but with 2 unique sections, I'm lost.
?(?,?)=?(32,4)=35960


Brute forcing the problem with some code has lead me to believe there are 1,440 combinations.

Can someone help me with the math, or offer some vocabulary that would help me google this.

Thanks.
 
I have 4 groups: g1, g2, g3, g4
Each group has 8 sections: g1s1, g1s2, g1s3, g1s4, g1s5, g1s6, g1s7, g1s8...g4s1, g4s2, g4s3, g4s4, g4s5, g4s6, g4s7, g4s8
This is fairly straightforward with a single section, but with 2 unique sections, I'm lost.
?(?,?)=?(32,4)=35960
Brute forcing the problem with some code has lead me to believe there are 1,440 combinations.
First, your post is very confusing. What does it mean to say there is no overlap?
Are these groups of people? Are the sections each non-empty?
If yes then here is a new notation: [imath]S=\left\{(k,j) : 1\le k\le 4~\&~1\le j\le 8\right\}[/imath].
So [imath]S[/imath] is the set of sections of the four groups. There are thirty-two such sections.
Now we can pick two sections from each group in [imath]4\cdot\dbinom{8}{2}=112[/imath] ways. SEE HERE.
 
I have 4 groups: g1, g2, g3, g4
Each group has 8 sections:
g1s1, g1s2, g1s3, g1s4, g1s5, g1s6, g1s7, g1s8
...
g4s1, g4s2, g4s3, g4s4, g4s5, g4s6, g4s7, g4s8

I need to find all unique combinations of groups and sections, where there are 2 sections from each group and no overlap.
e.g., [[g1s1, g1s2, g2s3, g2s4, g3s5, g3s6, g4s7, g4s8], ..., [g1s5, g1s7, g2s2, g2s8, g3s1, g3s4, g4s3, g4s6]]

This is fairly straightforward with a single section, but with 2 unique sections, I'm lost.
?(?,?)=?(32,4)=35960


Brute forcing the problem with some code has lead me to believe there are 1,440 combinations.

Can someone help me with the math, or offer some vocabulary that would help me google this.

Thanks.
Along the same lines as pka, I visualize this as an array with 4 columns (the groups) and 8 rows (the sections). You want to pick two from each column, and I suspect that what you mean by "no overlap" may be that you are picking only one from each row.

A cleaner way to name things would be groups A, B, C, D and sections 1, 2, 3, 4, 5, 6, 7, 8. So one valid combination would be {A4, A6, B3, B7, C1, C8, D2, D5}.

If I'm right, I would think in terms of first choosing 2 sections of the 8 for A, then choosing 2 sections of the remaining 6 for B, and so on.

Does that do what you want?
 
@pka Correct, the post could be perceived as confusing.
@Dr.Peterson Your output, {A4, A6, B3, B7, C1, C8, D2, D5} is exactly what I'm looking for.

I will give that some thought and see if I can take it from here, thanks for the input.
 
Top