Permutations and Combinations Calculator
Enter n items and a selection of r and get the number of permutations (order matters) and combinations (order does not matter), with and without repetition
Try your own numbers
Estimate only. Not engineering or safety advice. Check the result against the applicable standard and the equipment data, and have a competent engineer review it before it is relied on. Terms of use.
Open in the calculator with these values
About this calculator
This page calculates n!, permutations nPr, order matters, no repeats, combinations nCr, order does not matter, no repeats and 2 more results from number of items to choose from and number chosen. Change any value or its unit and the result updates. The steps below show the working for the default values, so you can check each line against your own method.
Limits of this calculator
Use this to count how many test sequences, switching orders or ways of selecting spare units there are, or how many keypad or breaker-label codes exist. For the chance of an outcome use the probability calculator, and for the chance of exactly k failures in n units use the binomial distribution calculator.
Cross-check: 32 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review.
Verification status: Engineering reference
Engineering reference. Formula and method documented and tested against separately coded reference calculations. Not yet Verified: the evidence listed on this page is still needed.
What this calculator checks
- The arithmetic of the published formula for the values you entered, in the units shown.
What remains unverified
- That the inputs suit your application. Take ratings, resistances and constants from the manufacturer data sheet or project specification.
Verification register entry
| Calculation author | Rahul Sharma (author) |
|---|---|
| Technical review | No independent technical review has been carried out |
| Individual professional approval | Not recorded |
| Formula reference | not recorded |
| Standard and edition | Not applicable: Pure mathematics or statistics; no electrical standard governs the method |
| Standard review state | Not applicable |
| Scope-screening note | not recorded |
| Cross-check test cases | 32 reference vectors (tests/reference_vectors.json) |
| Review date | not recorded |
| Next review date | not recorded |
| Status | Engineering reference |
Needed before this calculator can be marked Verified: reviewer name, qualification and review date; exact formula reference; formula source (textbook or standard); next review date.
Formula
Worked example
| Input | Value |
|---|---|
| Number of items to choose from (n) | 10 |
| Number chosen (r) | 3 |
- n! = 10! = 3628800
- nPr = n! / (n − r)! = 720 nCr = n! / (r! (n − r)!) = 120
- With repetition: nʳ = 1000 C(n + r − 1, r) = 220
Assumptions
- n and r are whole numbers; n is from 1 to 100 so that every result fits in a number (100! is about 9.3e157)
- Permutations count different orders as different (ABC and CBA are two); combinations count them as one
- Without repetition each item can be used once, so r above n gives 0 permutations and 0 combinations
- With repetition an item may be chosen again; r may then be larger than n
- Results are counted exactly with whole-number arithmetic and shown to 10 significant figures; the steps show every digit up to 40 digits
- 0! is 1, and choosing 0 items can be done in exactly one way
Use this to count how many test sequences, switching orders or ways of selecting spare units there are, or how many keypad or breaker-label codes exist. For the chance of an outcome use the probability calculator, and for the chance of exactly k failures in n units use the binomial distribution calculator.
Inputs and results
| Input | Unit | Allowed or shown | Note |
|---|---|---|---|
| Number of items to choose from (n) | (number) | 1 or more, up to 100 | A whole number from 1 to 100. |
| Number chosen (r) | (number) | 0 or more, up to 100 | A whole number from 0 to 100. Without repetition r above n gives 0 ways, because you cannot pick more distinct items than there are. |
| Result | Unit | Allowed or shown | Note |
|---|---|---|---|
| n! (n factorial) | (number) | Shown to 10 decimal places | |
| Permutations nPr, order matters, no repeats | (number) | Shown to 10 decimal places | |
| Combinations nCr, order does not matter, no repeats | (number) | Shown to 10 decimal places | |
| Permutations with repetition (nʳ) | (number) | Shown to 10 decimal places | |
| Combinations with repetition, C(n + r − 1, r) | (number) | Shown to 10 decimal places |
How it is calculated
Each input is converted to the base unit of its quantity, the formula above is applied in the order shown in the worked example, and each result is shown in the unit you choose. Results are held at full precision and rounded only for display, except where a step selects a standard size, as the worked example shows. A value outside its allowed range is refused with a message instead of giving a result.
How the result changes with number of items to choose from (n)
| Number of items to choose from (n) | n! | Permutations nPr, order matters, no repeats | Combinations nCr, order does not matter, no repeats |
|---|---|---|---|
| 1 | 1 | 0 | 0 |
| 5 | 120 | 60 | 10 |
| 10 | 3,628,800 | 720 | 120 |
| 20 | 2.433e18 | 6,840 | 1,140 |
| 40 | 8.159e47 | 59,280 | 9,880 |
| 100 | 9.333e157 | 970,200 | 161,700 |
Other inputs are the same as in the worked example above.
Standards and further reading
Complex numbers, rectangular and polar form and angle conversion are standard mathematics, not the subject of a standard. Standards apply when the result feeds an electrical design, and they set the method there.
Frequently asked questions
What do I need to enter?
Enter number of items to choose from (n) and number chosen (r). Change the unit of a value with its selector and the result stays the same.
What does this calculator assume?
n and r are whole numbers; n is from 1 to 100 so that every result fits in a number (100! is about 9.3e157). Permutations count different orders as different (ABC and CBA are two); combinations count them as one. Without repetition each item can be used once, so r above n gives 0 permutations and 0 combinations. With repetition an item may be chosen again; r may then be larger than n. Results are counted exactly with whole-number arithmetic and shown to 10 significant figures; the steps show every digit up to 40 digits. 0! is 1, and choosing 0 items can be done in exactly one way.
Which calculators should I use next?
Common next steps are Binomial Distribution Calculator (Exactly k, At Most, At Least), Probability Calculator (Two Events, A and B, and Repeated Trials), Mean, Median and Mode and Fraction Calculator. The related links at the bottom of this page open them.
How accurate are the results?
Every figure comes from the same tested engine as the Elecmetric calculators and is meant for estimating. 32 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review. Check design values against the standard and the equipment data you work to.
Formula guides and reference
Longer explanations with worked examples and tables, written for the same topic.
- Probability, Combinations and Binomial Formulas: Probability formulas for reliability and test work: two events, repeated trials, permutations
- Mean and Standard Deviation Formulas: Statistics formulas for test readings: mean, median, mode, range, standard deviation, variance and standard error
- Percentage, Ratio and Rounding Formulas: Formulas for percentage, percentage change, ratios, proportions, decimal places and significant figures
More Engineering Mathematics calculatorsAll engineering calculatorsPermutations and Combinations Calculator (nPr, nCr) in Elecmetric