I'm definitely not a math man (quite negate for maths..), but I need to know one thing: I've got to calculate how many combinations there can be from n groups of options. I mean, example:
g1 = [a,b]
g2 = [d,e]
by 'combination' I mean a list of items where every item of that list belongs to a different group. So in this case: [a,e], [a,d], [b,d], [b,e].
what if I want to calculate the total number of combinations for example of 4 groups of variable number of items each?
g1 = [a,b,c]
g2 = [d,e]
g3 = [g,h,i]
g4 = [j,k,l,z]
I mean, every combination will be formed of 4 items where every item comes from a different group. [a,d,g,j], [b,d,g,j], etc...
:( Is there a simple formula I can apply?
[EDIT 1]
Both of the answers below (from @Ray and @tylerc0816) are accepted. Both gives details, one by providing a wikipedia link and the other by expliciting the formula. So THANK YOU to both! For future readers: I'm a programmer and this question was made to help me program a product (I mean: commercial item) combination system for an e-commerce. It's a really common path to give the administrator the possibility of automating the generation of all the possible product-options combinations, each with it's id, price, sku, image and so on. I needed a way to predict the total combinations for each product, and this simple formula gives me that.