Skip to content
EN
  • Español
  • English
Advertisement

Permutation and combination calculator

Work out combinations and permutations with and without repetition and the odds of a match; from the number of groups, find how many elements you need.

Fill in 2 of the 3 fields and the missing one is calculated. You can type in any of them.

—
—
Type them instead of n to find how many elements you need.
—
Combinations with that n—
Permutations of k (order, no repeats)—
Combinations with repetition—
Permutations with repetition (nᵏ)—
Permutations of all n (n!)—
Probability of hitting one combination—

Use this calculator for reference only, as we cannot guarantee that the results are free of errors.

Disclaimer

https://dyaii.es/en/permutation-combination-calculator/

Advertisement

Combinatorics counts how many ways a group of things can be chosen or ordered without writing them all out. It tells you how many codes a lock accepts, how many tickets a lottery has, how many pairs of tests are needed between several teams or how many different codes fit in a format. It all comes down to two questions: does the order matter? And can an element be repeated?

The four formulas

Without repetitionWith repetition
Order matters (permutations of k)P = n! / (n − k)!nk
Order does not matter (combinations)C = n! / (k! (n − k)!)(n + k − 1)! / (k! (n − 1)!)

n is the number of elements to choose from and k how many each group has. When k = n without repetition you get the permutations of all n: n! ways to order them. 5! = 120 ways to place 5 parts in 5 slots.

Combinations: when order does not matter

C(n, k) = n! / (k! · (n − k)!)

This is the binomial coefficient, "n choose k". Example: a 6-from-49 lottery has C(49, 6) = 13,983,816 different tickets, so a single ticket has a 1 in almost 14 million chance. Choosing 3 people from a team of 10 for a shift gives C(10, 3) = 120 groups.

C(n, k) = C(n, n − k): choosing the 3 who stay is the same as choosing the 7 who leave. That is why the chart is symmetrical with its peak at k = n/2.

Advertisement

Permutations of k: when order counts

P(n, k) = n · (n − 1) · … · (n − k + 1) = C(n, k) · k!

There are n candidates for first place, n − 1 for second, and so on up to k. A podium of 3 among 10 runners: 10 · 9 · 8 = 720. With repetition every place has n options again: a 4-digit PIN has 104 = 10,000 possibilities.

Combinations with repetition

Crep(n, k) = C(n + k − 1, k)

Choosing k things from n types, repeats allowed and order irrelevant: 3 scoops of ice cream from 5 flavours give C(7, 3) = 35 different cups. In industry: how many ways k identical parts can be spread over n boxes.

How many elements are needed

The other way round: if you know how many groups you want, type k and the combinations (leave n empty) and the calculator finds the smallest n that reaches it. To have at least 1000 different pairs (k = 2) you need 46 elements, which give 1035; 45 only give 990.

How to use the calculator

Type n and k to get the combinations, permutations of k (with and without repetition), the permutations of all n and the probability of hitting one given group at random. Huge numbers are shown in scientific notation. You can also drag the sliders in the drawing.

Advertisement

Frequently asked questions

What is the difference between combinations and permutations?

In combinations order does not matter: {1, 2, 3} and {3, 2, 1} are the same group. In permutations it does: a gold-silver-bronze podium is different if the places change. That is why there are k! permutations for each combination: P = C · k!.

How many combinations does a 6-from-49 lottery have?

C(49, 6) = 49! / (6! · 43!) = 13,983,816. The chance of matching all six with one ticket is 1 in almost 14 million: 0.0000072 %.

When is "with repetition" used?

When an element can come up more than once. A lock with 4 wheels of 10 digits has 10⁴ = 10,000 codes (permutations with repetition). Choosing 3 scoops from 5 flavours, repeats allowed, gives C(5 + 3 − 1, 3) = 35 combinations with repetition.

How do I find n if I know how many groups I want?

Type k and the number of combinations in its box, without n: you get the smallest n giving at least that many groups. To have 1000 different pairs (k = 2) you need 46 elements, which give 1035.

Related calculators

Share

WhatsApp X LinkedIn Telegram Email
Advertisement

Install Diseño y automatización de instalaciones industriales on your phone

All the calculators one tap away, full screen, like an app. It takes no space and is always up to date.