Permutation and Combination
Compute nPr and nCr for whole numbers, with r not greater than n.
About this tool
nPr is the number of ordered selections. nCr is the number of unordered selections. Both are computed from factorials of whole numbers.
A case with r greater than n is rejected because those selections do not exist.
How to use it
- Enter n and r as whole numbers.
- Calculate.
- Read nPr and nCr. r cannot be greater than n.
Limitations
- n and r are whole numbers, and r must be from 0 through n.
- The factorials use bigint arithmetic. A value that is not a whole number is rejected.
Ordered selections and unordered ones
Two formulas, both exact integers
n and r are whole numbers, with r between 0 and n inclusive. The permutation P(n, r) multiplies n × (n − 1) × … for exactly r factors, stopping before it reaches a full factorial when r is smaller than n. The combination C(n, r) divides that product by r!. When r is larger than n − r, the combination first swaps to C(n, n − r) so the factorial in the denominator stays the smaller one. Both results are arbitrary-precision integers, not binary floats.
Five choose two, ordered and not
P(5, 2) = 5 × 4 = 20. C(5, 2) = 20 / 2 = 10. The panel prints both lines, P(5, 2) = 20 and C(5, 2) = 10. The 20 counts arrangements where order matters, such as gold and silver from five finalists. The 10 counts committees where order does not. P(5, 0) and C(5, 0) are both 1, because an empty product is 1 and 0! is 1 in this implementation. P(5, 5) is 120 and C(5, 5) is 1.
Refusals and the size of the integers
If r exceeds n, or if either input is negative, the page refuses. Decimals are refused. There is no separate factorial box, but P(n, n) is n!. The integers stay exact far past the range where a floating-point factorial would round. The practical limit is how large a result you are willing to read, not a silent conversion to scientific notation. This page does not multiply by probabilities. If you need the chance of a combination under equally likely outcomes, divide the combination by the size of the sample space on the probability calculator, which expects those two counts as favorable and total.
Reading both lines together
The permutation line is never smaller than the combination line for the same legal pair, because the combination divides by r! and r! is at least 1. For r = 1 they match: P(8, 1) = 8 and C(8, 1) = 8. For r = 2 the combination is half the permutation. The panel always emits both, so a problem that asked only for committees still shows the ordered count above it. Ignore the line you do not need. Do not add them.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

