nPr and nCr
Last reviewed: April 2026
A permutation and combination calculator computes both arrangements (order matters) and selections (order does not matter) from a single interface. It helps students and professionals quickly distinguish between and solve these two fundamental counting problems.
The fundamental question in counting problems is: does order matter? If rearranging the same items creates a different outcome, use permutations (P). If not, use combinations (C). The relationship is P(n,r) = C(n,r) × r!, because each combination can be arranged in r! ways.[1] For any given n and r, permutations always produce a larger number than combinations because they count every possible ordering. Choosing 3 people from 10 for a committee gives C(10,3) = 120, while assigning them to president, VP, and secretary gives P(10,3) = 720 — six times more because each group of 3 has 3! = 6 possible role assignments.[2] Lottery odds use combinations (order of numbers drawn does not matter), while horse racing exactas use permutations (the finishing order matters).[3] Use the Probability Calculator for probability computations using these counting methods.
Lottery odds use combinations — C(49,6) = 13,983,816 possible 6-number selections from 49 numbers (1 in ~14 million chance). Password security uses permutations — an 8-character password from 62 possible characters (a–z, A–Z, 0–9) has 62⁸ ≈ 218 trillion arrangements (with repetition allowed). Sports brackets, tournament seedings, DNA codon arrangements, and cryptography all rely on combinatorial math. Permutations with repetition (like license plates where letters can repeat) use nʳ, while permutations without repetition use n!/(n−r)!. Calculate the probability of specific outcomes with our Probability Calculator.
| Scenario | Order Matters? | Formula | Answer (n=10, r=3) |
|---|---|---|---|
| Picking a team of 3 | No | C(10,3) | 120 |
| Ranking top 3 | Yes | P(10,3) | 720 |
| 3-digit code (no repeat) | Yes | P(10,3) | 720 |
| 3-digit code (repeat OK) | Yes | 10³ | 1,000 |
The fundamental distinction in combinatorics is whether order matters. A permutation counts the number of ways to arrange items where the sequence is significant — a password "ABC" is different from "CBA." A combination counts selections where sequence is irrelevant — a committee of Alice, Bob, and Charlie is the same committee regardless of the order they are listed. This single distinction determines which formula to apply and can change answers by orders of magnitude. For choosing 3 items from 10: the number of permutations is P(10,3) = 720, while the number of combinations is C(10,3) = 120 — exactly 6 times fewer (because 3! = 6 represents the number of ways to rearrange 3 items).
The permutation formula P(n,r) = n! / (n-r)! counts ordered arrangements of r items chosen from n distinct items. The combination formula C(n,r) = n! / (r!(n-r)!) is the permutation formula divided by r!, which removes the duplicate arrangements that differ only in order. The relationship P(n,r) = C(n,r) × r! makes this connection explicit — every combination of r items can be arranged in r! different orders, and each arrangement is a distinct permutation. Understanding this relationship helps you verify which formula applies: if rearranging your selection creates a meaningfully different outcome (codes, rankings, sequences), use permutations; if rearranging creates the same outcome (teams, groups, hands), use combinations.
Permutations apply whenever order matters. Phone numbers, PIN codes, and passwords are permutations because the sequence of digits or characters determines the code — 1234 is different from 4321. A 4-digit PIN using digits 0-9 (with repetition allowed) has 10⁴ = 10,000 permutations, which is why financial institutions consider 4-digit PINs minimally secure. An 8-character alphanumeric password using lowercase letters and digits (36 characters) has 36⁸ ≈ 2.82 trillion permutations, making brute-force attacks impractical.
In horse racing, trifecta bets require predicting the top three finishers in exact order. In a 12-horse race, there are P(12,3) = 1,320 possible trifecta outcomes, explaining why trifecta payouts are typically much larger than win bets. Tournament seedings, batting orders in baseball, and priority rankings are all permutation problems. DNA sequencing involves permutations of four nucleotide bases — the number of possible sequences of length n is 4ⁿ, which for a typical human gene of 1,000 base pairs yields 4¹⁰⁰⁰ possible sequences, a number vastly larger than the number of atoms in the observable universe.
Combinations apply whenever order does not matter. Lottery drawings are the quintessential combination problem — the numbers 3, 17, 24, 35, 42 form the same winning combination regardless of the order drawn. For a 6/49 lottery, C(49,6) = 13,983,816 possible tickets. Card games use combinations extensively — the number of possible 5-card poker hands from a 52-card deck is C(52,5) = 2,598,960. Team selection, jury composition, committee formation, and sampling for quality control are all combination problems.
In genetics, the number of possible offspring genotypes from two parents with n independently assorting gene loci is related to combinations. In investing, choosing 10 stocks from a universe of 500 to create a portfolio involves C(500,10) ≈ 2.63 × 10²⁰ possible portfolios. Software testing uses combinatorial testing to verify behavior across multiple variables — testing all combinations of 4 browsers, 3 operating systems, and 5 screen resolutions requires C(4,1)×C(3,1)×C(5,1) = 60 test cases rather than testing every permutation of settings. Our Combination Calculator and Binomial Probability Calculator handle specific aspects of these calculations.
Many real problems involve constraints that modify the basic formulas. Permutations with repetition allow items to be reused — the number of possible r-length sequences from n items is nʳ (license plates, phone numbers). Combinations with repetition use the formula C(n+r-1, r) for choosing r items from n types when repeats are allowed (choosing 5 scoops from 10 ice cream flavors). Circular permutations — arrangements around a circle where rotations are equivalent — reduce the count by a factor of n: (n-1)! instead of n! (seating arrangements at a round table).
Permutations of items with duplicates divide by the factorials of each group of identical items. The number of distinct arrangements of the letters in "MISSISSIPPI" is 11! / (4! × 4! × 2! × 1!) = 34,650, accounting for the four S's, four I's, two P's, and one M. Conditional counting — where certain positions must be filled by specific items or certain items must be adjacent — typically requires breaking the problem into cases or using complementary counting (total arrangements minus forbidden arrangements). These advanced techniques are essential in competitive mathematics, computer science algorithm design, and statistical sampling methodology.
Combinatorial numbers grow extremely rapidly. C(100,50) ≈ 10²⁹, and P(100,50) ≈ 10⁹⁴. These astronomical numbers have practical implications for computational problems — any problem requiring enumeration of all permutations or combinations becomes computationally intractable beyond modest sizes. This is the basis of computational complexity theory and the P vs. NP problem, one of the most important open questions in mathematics and computer science. Cryptographic security relies directly on the intractability of combinatorial problems — breaking modern encryption would require testing a number of key combinations so large that all computers on Earth working together could not complete the search before the heat death of the universe. Approximation algorithms, heuristic methods, and probabilistic techniques provide practical approaches for problems where exact combinatorial solutions are infeasible. Our Sample Size Calculator uses combinatorial principles to determine how many observations are needed for statistically valid conclusions.
Permutations and combinations form the foundation of classical probability theory. The probability of an event equals the number of favorable outcomes divided by the total number of possible outcomes — and counting those outcomes requires combinatorial techniques. The probability of a royal flush in poker is C(4,1)/C(52,5) = 4/2,598,960 ≈ 0.000154%. The probability of matching all 6 numbers in a 6/49 lottery is 1/C(49,6) = 1/13,983,816 ≈ 0.00000715%. These calculations connect combinatorics directly to risk assessment, decision-making, and statistical inference throughout science, business, and daily life.
→ Run multiple scenarios. Try different inputs to see how changes affect the outcome. Small differences in rates, terms, or amounts can have a large impact over time.
→ Use conservative estimates. When projecting future returns or growth, err on the low side. Optimistic assumptions lead to plans that fall short.
→ Compare before committing. Use the results alongside other financial calculators on this site to see the full picture before making a financial decision.
→ Bookmark for periodic check-ins. Financial situations change — revisit this calculator quarterly or when your circumstances shift to keep your plan on track.
See also: Probability Calculator · Factorial Calculator · Binomial Probability Calculator