Calculates the number of ways to choose r items from n kinds with repetition allowed, nHr = (n + r − 1)Cr. This counts, for example, picking 2 scoops from 3 flavours where the same flavour twice is allowed.
Combinations with repetition count the ways of choosing items from kinds when the same kind may be picked more than once.
This differs from an ordinary combination, where each item can be taken at most once.
Buy 2 scoops of ice cream from 3 flavours (vanilla, chocolate, matcha). Two scoops of the same flavour are allowed.
Listing them: two vanilla, two chocolate, two matcha, vanilla with chocolate, vanilla with matcha, chocolate with matcha — six in all.
Think of stars and bars. Write each scoop as a star and each boundary between flavours as a bar, so that "star bar star bar" means one vanilla and one chocolate, and "star star bar bar" means two vanillas.
With 3 flavours you need 2 bars. Together the 2 stars and 2 bars fill 4 positions, and you simply choose which 2 hold stars: . In general you arrange stars and bars, which gives .