0

I was searching into lots of site and generators but couldn't find exactly what I need. Maybe I wasn't also able to accurately search it correctly as I'm not familiar with the needed terms.

What I need is to find all the combinations, combining 1 element at a time from each set, from 4 uneven sets. Sets are:

A1, A2, A3, A4

B1, B2, B3

C1, C2

D1, D2

So for example A1 B1 C1 D1 or A2 B1 C2 D2 etc. Every combination can only have one of each set. Can anyone help on this or at least help me pointing to a site/generator that can produce these combinations?

Thousand thanks :)

  • How many ways to choose an element from the first set with $4$ elements? How many ways to choose an element from each of them? – Math Lover Oct 13 '21 at 15:06
  • What do you mean? Can you give an example? If I get what you mean correctly though, order doesn't matter. for example combination A1 B3 C1 D1 is the same as combinations C1 A1 B3 D1 or D1 C1 A1 B3. They won't be counting as separate ones. All it matters is that each combination has only one element from each of the 4 sets. Order that they appear in the combination doesn't matter – Friday13 Oct 13 '21 at 15:13
  • 2
    There are $4\times 3\times 2\times 2$ such combinations. This is a basic application of the Rule of Product. If you are wanting the list of such things... this can be easily accomplished with your favorite programming language with nested for loops. Alternatively, the search term you are interested in is cartesian product. – JMoravitz Oct 13 '21 at 15:14
  • 1
    Not sure if you can find a generator online, but here is a python script that does what you want for an arbitrary number of sets: https://www.online-python.com/9XyxZkHuos – EuxhenH Oct 13 '21 at 15:17
  • @EuxhenH Yes. I think this is what I need. Thanks for the help. I had no idea of programming or what about loops. The only way I could have got it is from some online calculator. So, thanks for the online python script/way. I just run it :) – Friday13 Oct 13 '21 at 15:19
  • Plus, I learned today about Rule of Product and Cartesian product so I call it a win. haha Thanks everyone! As you probably guesses my background has not to do with advanced maths/stats or programming so all this help means a lot. :) – Friday13 Oct 13 '21 at 15:22

0 Answers0