Let's choose 9 out of 12 chips

In how many ways can nine chips be selected from a bag that contains three red chips, three blue chips, three white chips, and three yellow chips? (Assume that the order of selection is irrelevant and that the chips are identical except for their color.)


The answer is 20.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Mark Hennings
May 9, 2019

The required number is the same as the number of ways of choosing 3 3 from the 12 12 chips (we can choose the 3 3 that are left behind instead of the 9 9 we are taking). The colours of these three coins could be

  • XXX (all the same). There are 4 4 ways this can happen.
  • XXY (two colours). There are 4 × 3 = 12 4 \times3 = 12 ways this can happen.
  • XYZ (three colours). There are 4 4 ways this can happen, one for each colour that is not chosen.

Thus there are 4 + 12 + 4 = 20 4+12+4=\boxed{20} ways in which the 9 9 chips can be chosen.

Yep, same way. Nicely written up. Seems tricky to extend to a more general problem, though. Any ideas?

Chris Lewis - 2 years, 1 month ago

Log in to reply

It can be generalised...

Suppose that we have a total of N K NK chips, with N N chips of each of K K different colours. The number A M A_M of ways of choosing M M chips is the coefficient of x M x^M in the polynomial F ( X ) = ( 1 + X + X 2 + + X N ) K F(X) \; = \; (1 + X + X^2 + \cdots + X^N)^K (the combination of a 1 a_1 of colour 1 1 , a 2 a_2 of colour 2 2 , and so in corresponds to selecting X a 1 X^{a_1} from the first bracket, X a 2 X^{a_2} from the second bracket, and so on). We note that F ( X ) = ( 1 X N + 1 1 X ) K = ( a = 0 K ( 1 ) a ( K a ) X a ( N + 1 ) ) ( b = 0 ( b + K 1 K 1 ) X b ) F(X) \; = \; \left(\frac{1 - X^{N+1}}{1-X}\right)^K \; = \; \left(\sum_{a=0}^K (-1)^a\binom{K}{a}X^{a(N+1)}\right)\left(\sum_{b=0}^\infty \binom{b+K-1}{K-1}X^b\right) It is particularly easy to determine A M A_M provided that M N M \le N , for then we only need the a = 0 a=0 term from the first bracket, and A M = ( M + K 1 K 1 ) A_M \; = \; \binom{M+K-1}{K-1} The formula for M > N M > N gets more complicated. For example A N + 1 = ( K + N K 1 ) K A 2 N = ( 2 N + K 1 K 1 ) K ( N + K 2 K 1 ) A_{N+1} \; = \; \binom{K+N}{K-1} - K \hspace{2cm} A_{2N} \; = \; \binom{2N+K-1}{K-1} - K\binom{N+K-2}{K-1} For this particular problem we have M = N = 3 M=N=3 and K = 4 K=4 , so that A 3 = ( 6 3 ) = 20 A_3 = \binom{6}{3} = 20

It is interesting to note that F ( X ) F(X) is a polynomial of degree K N KN , but we have expressed it as an infinite power series. This means that we have automatically proved a variety of combinatorial identities from the fact that A M = 0 A_{M} = 0 for all M > N K M > NK . For example a = 0 K ( 1 ) a ( K a ) ( ( K a ) ( N + 1 ) + K 1 K 1 ) = A K ( N + 1 ) = 0 \sum_{a=0}^K (-1)^a \binom{K}{a} \binom{(K-a)(N+1)+K-1}{K-1} \; = \; A_{K(N+1)} \; = \; 0

Mark Hennings - 2 years ago
Atvthe King
Jun 5, 2020

Use the generating function ( 1 x 4 ) 4 ( 1 x ) 4 \frac{(1-x^4)^4}{(1-x)^4} . The rest is just calculation.

Brute force of what is not selected:

Length [ Union [ Table [ Sort [ p ] , { p , Permutations [ { r , r , r , b , b , b , w , w , w , y , y , y } , { 3 } ] } ] ] ] 20 \text{Length}[\text{Union}[\text{Table}[\text{Sort}[p],\{p,\text{Permutations}[\{\text{r},\text{r},\text{r},\text{b},\text{b},\text{b},\text{w},\text{w},\text{w},\text{y},\text{y},\text{y}\},\{3\}]\}]]]\Rightarrow 20

By the way, the same brute force method applied to the selected chips gives the same answer.

Translation: generate all size 3 permutations of 3 r's, 3 b's,3 w's and 3 y's, sort the selections alphabetically (in this case), and reduce the set to a list by removing the duplicates and report the size of the resulting set.

In some sense, this duplicates Mark Hennings solution.

This method seems to generalize well. Of course, it works faster on the smaller side of the problem.

Length [ Union [ ParallelTable [ Sort [ p ] , { p , Permutations [ Flatten [ Join [ Table [ ConstantArray@@ s , { s , ( r 1 w 2 b 3 y 4 g 5 ) } ] ] ] , { 12 } ] } ] ] ] 29 \text{Length}\left[\text{Union}\left[\text{ParallelTable}\left[\text{Sort}[p],\left\{p,\text{Permutations}\left[ \\ \text{Flatten}\left[\text{Join}\left[\text{Table}\left[\text{ConstantArray}\text{@@}s,\left\{s,\left( \begin{array}{cc} \text{r} & 1 \\ \text{w} & 2 \\ \text{b} & 3 \\ \text{y} & 4 \\ \text{g} & 5 \\ \end{array} \right)\right\}\right]\right]\right], \\ \{12\}\right]\right\}\right]\right]\right] \Rightarrow 29 .

Flatten [ Join [ Table [ ConstantArray@@ s , { s , ( r 1 w 2 b 3 y 4 g 5 ) } ] ] ] { r , w , w , b , b , b , y , y , y , y , g , g , g , g , g } \text{Flatten}\left[\text{Join}\left[\text{Table}\left[\text{ConstantArray}\text{@@}s,\left\{s,\left( \begin{array}{cc} \text{r} & 1 \\ \text{w} & 2 \\ \text{b} & 3 \\ \text{y} & 4 \\ \text{g} & 5 \\ \end{array} \right)\right\}\right]\right]\right] \Rightarrow \{\text{r},\text{w},\text{w},\text{b},\text{b},\text{b},\text{y},\text{y},\text{y},\text{y},\text{g},\text{g},\text{g},\text{g},\text{g}\} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...