Compute combinations with repetition C(n+r-1, r) from type and pick counts.
输入类型数 n 与选取数 r,求可重复组合数。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Combinations with repetition | Choosing r items from n types with repetition gives C(n + r - 1, r) | Feller W., An Introduction to Probability Theory and Its Applications, Vol. 1, Wiley |
| Stars and bars | Equivalent to placing r identical balls into n boxes, giving C(n + r - 1, r) | Feller W., An Introduction to Probability Theory and Its Applications, Vol. 1 |
| Versus combinations without repetition | Without repetition the count is C(n, r), and C(n, r) <= C(n + r - 1, r) | Brualdi RA, Introductory Combinatorics (5th ed.) |
| Typical use | Used for recipes, allocations and multiset counting where items may repeat | Feller W., An Introduction to Probability Theory and Its Applications, Vol. 1 |