Number of combinations possible for 2 out of 3 product options on 5 machines.

combinationscombinatorics

I don't know how that problem would be called, feel free to change the title accordingly.

I have five machines that each can produce three different kind of products, A, B and C. How many combinations are there

  • in total?

  • to produce exactly two different kinds?

My guess:

$3^5 = 243$ possible combinations in total.

$3$ possible combinations of two kinds (AB, AC, BC) , each with $2^5$ possibilities. We need to substract the $3$ combinations of all machines producing the same product.

$3\cdot2^5-3=93$ possible combinations of exactly two kinds

Here's where my textbook says otherwise: It says the solution is

$3(2^5-2)=90$

This would mean for each AB, AC and BC, there are two combinations of just one product being manufactured. But in my understanding, when I look at AB, the combination [A,A,A,A,A] and [B,B,B,B,B] gets substracted, obviously. But why would, for example, the same combination [A,A,A,A,A] be substracted another time in the case of AC?

If I would write all $243$ possible combinations down, there are only three cases in which only one product would be produced: either all A, B or C.

Is my textbook wrong, or am I?

Thanks for your help, sorry if the question is a bit trivial for this site.

Best Answer

You seem to have all the right ideas. Let's try to understand the textbook's answer first:

There are $3(2^5-2)$ combinations:

Let's pick $AB$ as one of our three pair of products to produce. Then as you have put it, there are $2^5$ ways the machine can produce a combination of $A$'s or $B$'s. In particular, there is one way all machines can produce $A's$, and one way all machines can produce $B$'s, so we need to subtract $2$ from our answer, that is $2^5-2$. We do this for each possible pair $AB$, $BC$ or $CA$, to obtain $3(2^5-2)$. We need to check that any combination we get from $AB$, say, is not the same as any combination we get from $BA$, and so on. i.e we don't want to overcount any combination we are interested in. This should be straightforward.

Let's understand why your solution was wrong.

You suggest that in total there are $3\cdot 2^5$ ways to produce a combination of either $AB$, $BC$ or $CA$, but then we need to subtract the cases where we produce $[A, A, A, A, A]$ or $[B, B, B, B, B]$ or $[C, C, C, C, C]$. Up to here I completely agree with your method. But how many times did we count $[A, A, A, A, A]$? When we looked at the $AB$ case, we counted $[A, A, A, A, A]$ once. When we looked at $CA$, we counted it once more. So we actually counted $[A, A, A, A, A]$ twice! i.e we need to subtract $2$ from $3 \cdot 2^5$. Similarly, we subtract $2$ for each $[B, B, B, B, B]$ and $[C, C, C, C, C]$, so we get $3\cdot 2^5 -6=3\cdot(2^5-2)$.

If you're worried about overcounting any other combination (e.g have we counted $[A, B, B, B, B]$ too many times?), you can check (as before) that no other combination is counted too many times.

Related Question