Combination Calculator

Enter n and r to count the ways to choose r items from n when order does not matter.

Repetition

Whether the same item may be chosen more than once.

A whole number from 0 to 1000.

A whole number from 0 to 1000.

Try

Result

You entered(5+3−13)\binom{5+3-1}{3}

(5+3−13)=35\displaystyle \binom{5+3-1}{3} = 35

Permutations (order matters)

125\displaystyle 125
Show the work
  1. Combinations with repetition (stars and bars)

    Choosing rr items from nn kinds with repeats allowed is the same as placing rr stars among n−1n - 1 dividers, which is a choice of rr positions from n+r−1n + r - 1. Here n=5n = 5 and r=3r = 3.

    Using (n+r−1r)=(n+r−1)!r! (n−1)!\binom{n+r-1}{r} = \frac{(n+r-1)!}{r!\,(n-1)!}

    (5+3−13)=(73)=7!3! (7−3)!=7!3! 4!=7×6×53×2×1=2106=35\begin{aligned} \binom{5+3-1}{3} &= \binom{7}{3} \\ &= \frac{7!}{3!\,(7-3)!} \\ &= \frac{7!}{3!\,4!} \\ &= \frac{7 \times 6 \times 5}{3 \times 2 \times 1} \\ &= \frac{210}{6} \\ &= 35 \end{aligned}
  2. Result

    So there are 3535 ways to choose 33 items from 55 kinds when repeats are allowed.

Worked examples