When you pick several items from a few kinds and a kind may be picked again, a selection is fixed by how many of each kind you take. Write it as stars for the items and bars between the kinds, and count the ways to place the bars.
| Step | On 4 donuts from 3 kinds | |
|---|---|---|
| 1 | Check that kinds repeat and order does not matter. Two glazed, one jam and one plain is one box, however you list it. | unordered, repetition allowed |
| 2 | Read the number of kinds and the number of picks. counts the kinds, counts the items you take. | kinds, donuts |
| 3 | Write each choice as stars and bars. Put stars in a row and split them into the kinds with bars: means . | stars, bars, symbols |
| 4 | Choose the places of the stars. Every choice of places among the symbols gives exactly one box. |