Combination/ Permutations Help

MD13

New member
Joined
Sep 26, 2022
Messages
4
Hi,
Just wondering if anyone could help me confirm the number of permutations possible in this problem.

There are 7 subject groups and a person can just pick 3 subjects in total (but only one subject from a group).

Group 1 (Maths, Chinese, English), Group 2 (Applied Maths, History, Ancient History), Group 3 (Art, Maths, Graphics, French, craft), Group 4.... etc

The end result is that a person can pick only 1 subject from any group but they can only have 3 subjects in total.

Lets say the total subjects in each group are as follows - Group 1 (3 subjects), Group 2 (3 Subjects), Group 3 (4 Subjects), Group 4 (5 Subjects), Groups 5 to 7 have 3 subjects each -> a total of 24 subjects

So, i want a list of the total subject combinations -> 3 subjects -> a subject can be repeated but the combinations must be unique.

I reckon this is a combinations question and not a permutation question because the order of subject does not matter?

Any help really appreciated, thanks.
 
Last edited:
Hi,
Just wondering if anyone could help me confirm the number of permutations possible in this problem.

There are 7 subject groups and a person can just pick 3 subjects in total (but only one subject from a group).

Group 1 (Maths, Chinese, English), Group 2 (Applied Maths, History, Ancient History), Group 3 (Art, Maths, Graphics, French, craft), Group 4.... etc

The end result is that a person can pick only 1 subject from any group but they can only have 3 subjects in total.

Lets say the total subjects in each group are as follows - Group 1 (3 subjects), Group 2 (3 Subjects), Group 3 (4 Subjects), Group 4 (5 Subjects), Groups 5 to 7 have 3 subjects each -> a total of 24 subjects

So, i want a list of the total subject combinations -> 3 subjects -> a subject can be repeated but the combinations must be unique.

I reckon this is a combinations question and not a permutation question because the order of subject does not matter?

Any help really appreciated, thanks.
Please show us what you have tried and exactly where you are stuck.

Please follow the rules of posting in this forum, as enunciated at:


Please share your work/thoughts about this problem
 
Please show us what you have tried and exactly where you are stuck.

Please follow the rules of posting in this forum, as enunciated at:


Please share your work/thoughts about this problem
ok, i am just wondering if i follow this formula 24 C 3 = 24!/3! - however, due to just being allowed to pick one subject from any group - it puts a further restriction in the combinations and that is where i am stuck?
 
Hi,
Just wondering if anyone could help me confirm the number of permutations possible in this problem.

There are 7 subject groups and a person can just pick 3 subjects in total (but only one subject from a group).

Group 1 (Maths, Chinese, English), Group 2 (Applied Maths, History, Ancient History), Group 3 (Art, Maths, Graphics, French, craft), Group 4.... etc

The end result is that a person can pick only 1 subject from any group but they can only have 3 subjects in total.

Lets say the total subjects in each group are as follows - Group 1 (3 subjects), Group 2 (3 Subjects), Group 3 (4 Subjects), Group 4 (5 Subjects), Groups 5 to 7 have 3 subjects each -> a total of 24 subjects

So, i want a list of the total subject combinations -> 3 subjects -> a subject can be repeated but the combinations must be unique.

I reckon this is a combinations question and not a permutation question because the order of subject does not matter?

Any help really appreciated, thanks.
I wouldn't think of it as either combinations or permutations. And given that the number of subjects per group varies, I would expect an algorithm, rather than a formula, would be needed.

Furthermore, as you imply the same subject can be found in more than one group, it seems like that the only way to do this would be to write a program to list all possible choices, eliminating duplicates.
 
I wouldn't think of it as either combinations or permutations. And given that the number of subjects per group varies, I would expect an algorithm, rather than a formula, would be needed.

Furthermore, as you imply the same subject can be found in more than one group, it seems like that the only way to do this would be to write a program to list all possible choices, eliminating duplicates.
Hi
Sorry, I made a mistake. The same subject cannot be found in more than one group.
 
a subject can be repeated
Are you saying that the following is a valid (and counted) combination?
Group 1 Maths, Group 3 Maths, Group 2 History
...here "Maths" is chosen twice

but the combinations must be unique.
Would the following be considered as the same (and therefore the two rows are only counted once)...
Group 1 Maths, Group 2 History, Group 3 Art
Group 3 Maths, Group 2 History, Group 5 Art
...here the subjects are the same but the groups differ
 
No, each group will have different subject choices. So Group 1 will be Math, English, History, Group 2 will be French, German, Spanish, Group 3 - another different set of subject and so forth.
GroupsNo. of Subjects
Group 1
3​
Group 2
5​
Group 3
6​
Group 4
2​
Group 5
3​
Group 6
2​
Group 7
3​
 
Furthermore, as you imply the same subject can be found in more than one group, it seems like that the only way to do this would be to write a program to list all possible choices, eliminating duplicates.

Even with non-intersecting groups writing a program makes more sense since even the formula for the total number of choices does not look particularly useful:

For [imath]K[/imath] groups with sizes [imath]S_k[/imath] the total number [imath]N[/imath] of choices can be computed as:
[math]N = \sum_{1\leq i < j < k \leq K} S_i S_j S_k[/math]
 
I think this is a real world problem therefore here's some Python code that will give the answer. It fairly closely follows the logic in post#8.

Python:
group_num_subjects = [3, 5, 6, 2, 3, 2, 3]

m=len(group_num_subjects)
n=0
for i in range(0, m):
    for j in range(i+1, m):
        for k in range(j+1, m):
            n += group_num_subjects[i] * group_num_subjects[j] * group_num_subjects[k]
print(n)
There are several websites that will run Python code online (so that you don't have to install Python). Cut, paste, run, and then post the result back here (if you like)!

This looks more cryptic, but it can be expanded from 3 to "n" subjects very easily...
Python:
import itertools
import numpy

group_num_subjects = [3, 5, 6, 2, 3, 2, 3]

s=0
for i in itertools.combinations(group_num_subjects, 3):
    s += numpy.prod(i)
print(s)
 
Top