Choosing when the same type can be picked again
Combinations with repetition answer a question the plain C(n, r) cannot: how many ways to choose r items from n types when types may repeat and order does not matter? Ten scoops from four ice-cream flavours. Six donuts from a case of five kinds. Identical candies shared among children. The count is C(n + r − 1, r), which looks like a misprint the first time you meet it; the stars and bars argument below shows why the n − 1 is doing real work.
Ten scoops, four flavours: line up 10 stars (the scoops) and split them into 4 flavour bins with 3 bars. Every outcome is one arrangement of 13 symbols, of which 10 are stars: C(13, 10) = 286 possible orders at the counter. Without repetition the same shop could offer only C(4, 10) = impossible; you cannot pick 10 distinct items from 4 types at all, which is the plainest sign that repetition changes the problem, not just the count.
Recognising the setup
The trigger words are types, kinds, flavours, denominations: the chooser picks from categories, not from distinct objects, and categories do not run out. Six donuts from five kinds gives C(10, 6) = 210. Sharing problems fit the same picture with the roles relabelled: 10 identical candies distributed among 4 children, children as the bins and candies as the stars, is C(13, 3) = 286 distributions. Reading which quantity is r and which is n is the only genuinely hard step; the calculator handles the factorials.
Reaching for C(n, r) when repetition is allowed, or for nr when it is not. n^r counts sequences (order matters, repetition allowed). If the order of scoops in the tub does not matter, n^r overcounts wildly: it would price the ice-cream problem at 410 = 1,048,576 instead of 286.
Frequently asked questions
What is the difference between combinations with and without repetition?
Without repetition, each item is used at most once: C(n, r). With repetition, types can repeat: C(n + r - 1, r), which also stays defined when r exceeds n.
Why is it called stars and bars?
The picture that proves the formula: r stars for the items, n - 1 bars separating the n type bins. Every selection is one symbol arrangement.
When does order matter make this the wrong tool?
Sequences, codes and rankings want permutations instead (n^r with repetition). This page is for multisets: collections where only the counts per type matter.