[Math] Total possible combinations of variables

combinationspermutations

I have 4 factors, each containing a different number of entry.

For example:

enter image description here

I would like to list and compute the number of possible combinations. So each combination consist of 1 fruit, 1 drink, 1 burger, 1 location.

The first combination is -> orange, coffee, cheese, bar
The last combination is -> banana, rootbeer, ham, kitchen

The order does not matter. Is there any general equation that can compute the number of all possible combinations?

UPDATE ON QUESTION:

Currently, the multiplication rule is used to form combinations that take in all factors.

What if I would like to find, the total number of combinations that uses all factors, 3 factors and a minimum of 2 factors?

All factors = Fruit, Drink, Burger, Location
3 factors = e.g. Fruit, drink, burger ; Fruit Burger location; etc.
2 factors = e.g. Fruit, drink; Burger, location; etc.

How could I compute this?

Best Answer

The Multiplication Principle states that if there are $m$ ways of performing a task and a second task can be performed independently of the first in $n$ ways, then the number of ways of performing both tasks is $mn$.

For each of the four ways a fruit can be selected, a drink can be selected in six ways. Thus, there are $4 \cdot 6 = 24$ ways of selecting a fruit and a drink as you can check by drawing a tree diagram.

For each of the $24$ ways a fruit and a drink can be selected, a burger can be selected in five ways. Hence, there are $24 \cdot 5 = 120$ ways of selecting a fruit, drink, and burger.

For each of the $120$ ways of selecting a fruit, drink, and burger, the location can be selected in seven ways, yielding $120 \cdot 7 = 840$ ways of selecting a fruit, drink, burger, and location.

Notice, as JMoravitz pointed out in the comments, that the number of ways of performing all four tasks is $4 \cdot 6 \cdot 5 \cdot 7 = 840$.

Related Question