How to use it
- Enter the number of objects or types in Objects or types n, and how many you choose in Number chosen k.
- Choose the Kind of count: combinations or permutations, with or without repetition.
- Read the Number of ways, the Formula and How it is worked out for that case.
The four counts
The NIST Digital Library of Mathematical Functions gives the four counts together in its twelvefold way, Table 26.17.1. The binomial coefficient is defined in section 26.3, equation 26.3.1, and the falling product (n − k + 1)_k is the Pochhammer symbol of section 5.2, equation 5.2.4. This page writes the counts with n and k as follows.
Combinations: C(n, k) = n! / (k! × (n − k)!), 0 ≤ k ≤ n
Combinations with repetition: C(n + k − 1, k), any k
Permutations: P(n, k) = n! / (n − k)!, 0 ≤ k ≤ n
Permutations with repetition: n^k, any k
Order, repetition and the edge cases
- Order: in a combination A then B is the same selection as B then A, so it counts once. In a permutation the order matters, so the two count as two.
- Repetition: without repetition each object is picked at most once, so k cannot be larger than n. With repetition the same object can be picked again, and k can be any size.
- Symmetry: C(n, k) = C(n, n − k). The working uses the smaller of k and n − k, which keeps the products short.
- Conventions: 0^0 = 1, counting the single empty sequence. With no types to repeat from, only the empty selection counts.
Worked example: n = 5, k = 2 in the four cases
Take five objects and choose two. Combinations give C(5, 2) = 10 ways. Combinations with repetition, where an object may be picked twice, give C(5 + 2 − 1, 2) = C(6, 2) = 15. Permutations give P(5, 2) = 5! / 3! = 5 × 4 = 20 ordered pairs, and permutations with repetition give 5^2 = 25.
| Case | Formula | Count for n = 5, k = 2 |
|---|---|---|
| Combinations | C(5, 2) | 10 |
| Combinations with repetition | C(6, 2) | 15 |
| Permutations | P(5, 2) | 20 |
| Permutations with repetition | 5^2 | 25 |
Frequently asked questions
What is the difference between combinations and permutations?
In a combination the order does not matter, so choosing A then B counts once. In a permutation the order matters, so A then B and B then A count as two. Choose the case that matches your question.
What does repetition mean here?
Repetition means the same object may be picked again. With two letters A and B and two picks, the combinations with repetition are AA, AB and BB, which is C(2 + 2 − 1, 2) = 3.
Why can k be larger than n with repetition?
Without repetition you cannot pick more objects than there are. With repetition the same object can be picked again, so k can be larger than n, and the page gives the exact count.
What do nCr and nPr mean?
nCr is the calculator key for C(n, r), the combinations, and nPr is the key for P(n, r), the permutations. This page calls the two numbers n and k.
Why is 0^0 equal to 1 here?
It is the usual convention for counting: there is exactly one empty sequence, so the number of sequences of length zero from any set is 1.
How large can the numbers get?
The page computes exact whole numbers for n up to 1,000, without rounding. For large numbers of factors the working is not written out, but the count itself is exact.
Is my input stored?
No. The calculation runs in your browser and nothing you type is sent to us.
Sources
- NIST Digital Library of Mathematical Functions, section 26.17: The Twelvefold Way, Table 26.17.1
- NIST Digital Library of Mathematical Functions, section 26.3: binomial coefficients (equation 26.3.1)
- NIST Digital Library of Mathematical Functions, section 5.2: Pochhammer symbol (equation 5.2.4)
Figures and text last checked on Tuesday, November 10, 2026.