This preview shows page 1. Sign up to view the full content.
Unformatted text preview: * 9? NO, because the two bars are identical; it doesnt matter which bar is insert rst. So, how do we count? Here is another trick: when the bars are inserted, we have 8 + 2 = 10 objects (balls + bars). Where are the bars? The bars occupy two of the 10 positions. The problem becomes clear now: we need to choose two of the 10 positions for the bars. As we learned, there are ( 10 2 ) ways to do this. Generally, if we have n balls and k bins, then we need to insert k1 bars. There are n + k1 objects (balls + bars). We need to choose k1 positions for the bars. Then answer is n + k1 k1 . P.S. An explicit expression for S ( n, k ), Stirling number of the second kind: S ( n, k ) = 1 k ! k X j =1 (1) kj k j j n 1...
View
Full
Document
This note was uploaded on 12/03/2009 for the course CSE 21 taught by Professor Graham during the Spring '07 term at UCSD.
 Spring '07
 Graham
 Algorithms

Click to edit the document details