Letter combinations

In how many ways can a selection of 5 letters be made out of five A's, four B's, three C's, two D's and one E?


The answer is 71.

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

Abhishek Sharma
Nov 25, 2014

A l l a l i k e 1 C 1 1 4 a l i k e , 1 d i f f 2 C 1 × 4 C 1 8 3 a l i k e , 2 a l i k e 3 C 1 × 3 C 1 9 3 a l i k e , 2 d i f f 3 C 1 × 4 C 2 18 2 a l i k e , 2 a l i k e , 1 d i f f 4 C 2 × 3 C 1 18 2 a l i k e , 3 d i f f 4 C 1 × 4 C 3 16 A l l d i f f 5 C 5 1 71 \begin{matrix} All\quad alike & ^{ 1 }{ { C }_{ 1 } } & 1 \\ 4\quad alike,\quad 1diff & ^{ 2 }{ { C }_{ 1 } }\times ^{ 4 }{ { C }_{ 1 } } & 8 \\ 3\quad alike,\quad 2\quad alike & ^{ 3 }{ { C }_{ 1 } }\times ^{ 3 }{ { C }_{ 1 } } & 9 \\ 3\quad alike,\quad 2\quad diff & ^{ 3 }{ { C }_{ 1 } }\times ^{ 4 }{ { C }_{ 2 } } & 18 \\ 2\quad alike,\quad 2alike,\quad 1diff & ^{ 4 }{ { C }_{ 2 } }\times ^{ 3 }{ { C }_{ 1 } } & 18 \\ 2\quad alike,\quad 3\quad diff & ^{ 4 }{ { C }_{ 1 } }\times ^{ 4 }{ { C }_{ 3 } } & 16 \\ All\quad diff & ^{ 5 }{ { C }_{ 5 } } & 1 \\ \quad & \quad & 71 \end{matrix}

Pratik Shastri
Nov 25, 2014

If casework isn't your strongest area, here is a generating functions approach. Let x i , i = 1 to 5 , x_i, \ i=1 \ \text{to} \ 5, be the number of A's, B's, C's, D's and E's selected respectively.

Now, note that i = 1 5 x i = 5 \displaystyle\sum_{i=1}^{5} x_i=5 . Also note that 0 x i 6 i 0 \leq x_i \leq 6-i .

Therefore the required number of ways

= Coefficient of x 5 in q = 1 5 p = 0 q x p Coefficient of x 5 in ( 1 x 6 ) ( 1 x 5 ) ( 1 x 4 ) ( 1 x 3 ) ( 1 x 2 ) ( 1 x ) 5 Coefficient of x 5 in ( 1 x 4 x 5 ) ( 1 x 2 x 3 + x 5 ) ( 1 x ) 5 Coefficient of x 5 in ( 1 x 2 x 3 x 4 ) ( 1 x ) 5 = ( 9 5 ) ( 7 3 ) ( 6 2 ) ( 5 1 ) = 71 \begin{aligned} &= \text{Coefficient of} \ x^5 \ \text{in} \ \ \prod_{q=1}^{5} \sum_{p=0}^{q} x^p\\ &\equiv \text{Coefficient of} \ x^5 \ \text{in} \ \ (1-x^6)(1-x^5)(1-x^4)(1-x^3)(1-x^2)(1-x)^{-5}\\ &\equiv \text{Coefficient of} \ x^5 \ \text{in} \ \ (1-x^4-x^5)(1-x^2-x^3+x^5)(1-x)^{-5}\\ &\equiv \text{Coefficient of} \ x^5 \ \text{in} \ \ (1-x^2-x^3-x^4)(1-x)^{-5}\\ &=\binom{9}{5}-\binom{7}{3}-\binom{6}{2}-\binom{5}{1}=\boxed{71} \end{aligned}

Note 1 : I have neglect terms with powers of x > 5 x>5 .

Note 2 : ( 1 x ) 5 = r = 0 ( 4 + r r ) x r (1-x)^{-5}=\displaystyle\sum_{r=0}^{\infty} \binom{4+r}{r} x^r

You should mention that ( 1 x ) 5 = ( n + 4 n ) x n = 1 + 5 x + 15 x 2 + 35 x 3 + 70 x 4 + 126 x 5 + (1-x)^ { -5 } = \sum { n + 4 \choose n } x ^n = 1 + 5 x + 15x^2 + 35x^3 + 70 x^4 + 126 x ^ 5 + \ldots

Calvin Lin Staff - 6 years, 6 months ago

Log in to reply

Edited the solution.

Pratik Shastri - 6 years, 6 months ago
Jakub Šafin
Nov 25, 2014

Dynamic programming (on paper): let P [ i ] [ j ] P[i][j] be the number of ways to take j j letters out of the first i i . Clearly, for j < 0 j < 0 , P [ i ] [ j ] = 0 P[i][j]=0 , and for i = 0 i=0 , P [ 0 ] [ 0 ] = 1 P[0][0]=1 and all other P [ 0 ] [ j ] = 0 P[0][j]=0 .

Then, if you have D [ i ] D[i] letters of type i i , you can calculate P [ i ] [ j ] = k = j D [ i ] j P [ i 1 ] [ k ] P[i][j]=\sum_{k=j-D[i]}^j{P[i-1][k]} on paper for all j 5 j \le 5 ; the answer is P [ 5 ] [ 5 ] P[5][5] .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...