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?
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.
If casework isn't your strongest area, here is a generating functions approach. Let x i , i = 1 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 . Also note that 0 ≤ x i ≤ 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 = ( 5 9 ) − ( 3 7 ) − ( 2 6 ) − ( 1 5 ) = 7 1
Note 1 : I have neglect terms with powers of x > 5 .
Note 2 : ( 1 − x ) − 5 = r = 0 ∑ ∞ ( r 4 + r ) x r
Dynamic programming (on paper): let P [ i ] [ j ] be the number of ways to take j letters out of the first i . Clearly, for j < 0 , P [ i ] [ j ] = 0 , and for i = 0 , P [ 0 ] [ 0 ] = 1 and all other P [ 0 ] [ j ] = 0 .
Then, if you have D [ i ] letters of type i , you can calculate P [ i ] [ j ] = k = j − D [ i ] ∑ j P [ i − 1 ] [ k ] on paper for all j ≤ 5 ; the answer is P [ 5 ] [ 5 ] .
Problem Loading...
Note Loading...
Set Loading...
A l l a l i k e 4 a l i k e , 1 d i f f 3 a l i k e , 2 a l i k e 3 a l i k e , 2 d i f f 2 a l i k e , 2 a l i k e , 1 d i f f 2 a l i k e , 3 d i f f A l l d i f f 1 C 1 2 C 1 × 4 C 1 3 C 1 × 3 C 1 3 C 1 × 4 C 2 4 C 2 × 3 C 1 4 C 1 × 4 C 3 5 C 5 1 8 9 1 8 1 8 1 6 1 7 1