C(n+k−1, k) · choice with repetition

Combinations with repetition — when we choose k items from n types, items may repeat, and order does not matter (e.g. how many sets of 3 balls from 4 colours). Formula: C(n+k−1, k).
Combinations with repetition count the ways of choosing items from types when items may repeat and order does not matter:
Example: how many different sets of 3 balls can be chosen from 4 colours (colours may repeat)? Answer: .
This is a variant of ordinary combinations — for comparison the calculator also gives the number of combinations without repetition . Typical uses: distributing identical objects, selecting from an assortment, “stars and bars”.
When you choose items from a repeatable assortment and order does not matter — e.g. buying several scoops of ice cream from the available flavours (flavours may repeat).
From the “stars and bars” method: k choices (stars) and n−1 dividers between types are placed in n+k−1 positions, choosing k spots for the stars.
Teaching? Embed this calculator on your site.
Free widget — paste it on your school site, blog or notes. It links to the full version.