Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

H(30, 34) — combinations with repetition at r = 34
759510004936100355
multisets of 34 chosen from 30 distinct items
r Combinations with repetition H(n, r)
0 1
1 30
2 465
3 4960
4 40920
5 278256
6 1623160
7 8347680
8 38608020
9 163011640
10 635745396
11 2311801440
12 7898654920
13 25518731280
14 78378960360
15 229911617056
16 646626422970
17 1749695026860
18 4568648125690
19 11541847896480
20 28277527346376
21 67327446062800
22 156077261327400
23 352870329957600
24 779255311989700
25 1683191473897752
26 3560597348629860
27 7384942649010080
28 15033633249770520
29 30067266499541040
30 59132290782430712
31 114449595062769120
32 218169540588403635
33 409894288378212890
34 759510004936100355

What this calculator does

This tool builds a table of combinations with repetition, also called multiset coefficients. Given n distinct item types, it computes how many unordered selections of size r you can make when each item may be chosen any number of times — for every integer r from a start value to an end value. The function is written \(H(n, r)\) and equals the binomial coefficient \(C(n + r - 1, r)\).

How to use it

Enter the number of distinct items n (at least 1), then a starting value and ending value of r. The calculator returns one row per r, each showing the exact count \(H(n, r)\). Because these numbers grow extremely fast, the engine uses exact big-integer arithmetic, so even large tables stay precise.

The formula explained

The classic "stars and bars" argument shows that choosing r items from n types with repetition is the same as placing r identical stars into n bins separated by n − 1 bars. The number of arrangements of these n + r − 1 symbols is \(C(n + r - 1, r)\). Two special cases matter: \(H(n, 0) = 1\) (the empty selection) and \(H(1, r) = 1\) (only one multiset of r copies of the single item).

$$\overline{C}(n, r) = \binom{\text{Items }(n) + r - 1}{r} = \frac{\left(\text{Items} + r - 1\right)!}{r!\,\left(\text{Items} - 1\right)!}$$
Advertisement
Stars and bars diagram with bars separating stars into bins to represent combinations with repetition
The stars-and-bars model: r stars and n-1 bars give C(n+r-1, r) arrangements.
Diagram showing selecting multisets of 2 from 3 distinct items a, b, c with repetition allowed
Choosing r items from n distinct types where the same type can be picked more than once.

Worked example

Take n = 5 and r from 0 to 4. \(H(5,0) = C(4,0) = 1\), \(H(5,1) = C(5,1) = 5\), \(H(5,2) = C(6,2) = 15\), \(H(5,3) = C(7,3) = 35\), and \(H(5,4) = C(8,4) = 70\). So the table reads 1, 5, 15, 35, 70. As a second check,

$$H(30,4) = C(33,4) = \frac{33 \cdot 32 \cdot 31 \cdot 30}{24} = 40920.$$

FAQ

How is this different from ordinary combinations? Ordinary combinations \(C(n, r)\) forbid repeats; here each item type can be picked multiple times, which is why the index becomes \(n + r - 1\).

Does order matter? No. {A, A, B} is the same selection as {B, A, A}. If order mattered you would use permutations with repetition (\(n^r\)) instead.

Why can the counts get so large? The multiset coefficient grows roughly like a polynomial of degree \(n - 1\) in r, so big n or big r produces astronomically large integers — handled here with exact arithmetic.

Last updated: