Combinations and permutations calculator
Combinations and permutations, with or without repetition.
Fill in the fields and the result will appear here automatically.
Count selections in four models: unordered combinations or ordered selections, each with or without repetition. n and k are integers from 0 to 1000; without repetition, k cannot exceed n. An empty selection k = 0 has one arrangement in every mode, even when n = 0. With n = 0 and k > 0, repetition yields zero possibilities. The primary answer is an exact BigInt integer with every digit; the additional scientific notation is only a compact approximation.
How it works
Formula and logic
Without repetition: C(n,k) = n!/[k!(n−k)!] and P(n,k) = n!/(n−k)!. With repetition and n ≥ 1: C(n+k−1,k) and nᵏ. For k = 0 the empty choice counts once; for n = 0 and k > 0 with repetition the count is zero. Integer arithmetic stays exact without converting the result to Number.
Example
Choosing 5 cards from 52 gives C(52, 5) = 2 598 960 possible hands.
Fields and units
- What to count — list option
- Allow repetition — No / Yes
- Set size n — unitless
- Sample size k — unitless
How to use
- — Choose combinations or permutations.
- — Say whether repetition is allowed.
- — Enter the set size and the sample size.
Method and limitations
- Calculation method
- Formula and logic
- Data or methodology source
- OpenStax: combinations and ordered selections without repetition
- Limitation
- n and k are integers from 0 to 1000; without repetition, k cannot exceed n. The primary answer is an exact BigInt integer with every digit; the additional scientific notation is only a compact approximation.
FAQ
What is the difference between combinations and permutations?
Order. Combinations treat AB and BA as the same selection; permutations count them separately.
When can the sample exceed the set?
Only with repetition allowed. Drawing 5 items from 3 kinds makes sense if each kind can be taken more than once.
Why is the result computed in exact integers?
BigInt preserves all integer digits. Beyond 9007199254740991, Number has no general exactness guarantee, although individual values can still be exact. C(60,30) = 118264581564861424 is representable, but C(61,30) = 232714176627630544 is not.
Why is there an upper limit?
The limits n, k ≤ 1000 bound loops and output length on this page. They are not mathematical limits: C(n,0) = 1 also for larger n. Binomial coefficients use successive exact multiplications and divisions.