๐Ÿ”ก

Permutation and Combination Calculator

Count possibilities using combinatorics.

Combinatorics Lab

Enter total items (n) and items to select (r). Toggle repetition for problems where items can be chosen more than once. Both P and C are computed simultaneously.

When on: items can be chosen more than once. P = n^r; C uses stars-and-bars.

Formatting

Comparison
Enter n and r to see results.

Using the Combinatorics Lab

Enter set size (n) and sample size (r). Results for P and C update live. Toggle "Repetition allowed" for problems where items can repeat. The Logic Visualizer shows how choices multiply; the Logic Trace breaks down factorial steps. Use Formatting for large factorials (scientific notation, significant figures).

At a glance

Result tags

"Order matters" (P) vs "Order irrelevant" (C)โ€”use the result card labels to confirm which formula applies to your problem.

Repetition toggle

Off = without replacement (r โ‰ค n). On = items can repeat; formulas switch to n^r and stars-and-bars.

Logic Visualizer

Shows r slots with diminishing or repeated choices. The product equals P(n,r).

Logic Trace

Step-by-step n!, (nโˆ’r)!, division for P, then division by r! for C. Large factorials use BigInt.

Permutation and Combination Calculator: nPr, nCr Formulas & Examples

Free permutation and combination calculator with step-by-step Logic Trace. Compute P(n,r) and C(n,r) side-by-side. Slot visualizer, repetition allowed. For combinatorics, probability, GRE, SAT, and discrete math.

What This Calculator Does and Who It's For

  • Who it's for
    Students in combinatorics, probability, or discrete math; test prep (GRE, SAT, actuarial exams); anyone counting arrangements or selections. Use when you need to decide permutation vs combination or verify homework with step-by-step output. Commonly used for "how to calculate permutations and combinations" and "nCr nPr formula" queries.
  • Trust and scope
    Calculations run entirely in your browser; no data is sent to any server. BigInt ensures exact factorial arithmetic. Supports standard (no-repetition) and repetition-allowed cases with clear error handling when r > n.
This permutation and combination calculator computes both nPr (permutations) and nCr (combinations) in a dual-result dashboard. Enter total items (n) and items to choose (r); the tool validates r โ‰ค n when repetition is off and supports repetition allowed for advanced combinatorics. The Logic Visualizer shows how choices multiply (e.g., 10ร—9ร—8 for P(10,3)), and the Logic Trace breaks down factorial steps with comma-separated integers for values โ‰ค 1,000,000. Formatting options (scientific notation, significant figures) handle large factorials. All calculations use BigInt for exact arithmeticโ€”no floating-point roundoff.

Permutation vs Combination: When Order Matters

Permutations count arrangements where order matters. Picking a President and VP from 5 candidates gives P(5,2) = 5ร—4 = 20โ€”AB and BA are different outcomes. Combinations count selections where order does not matter. Picking 2 committee members from 5 gives C(5,2) = 10โ€”AB and BA are the same committee. The formulas reflect this: P(n,r) = n!/(nโˆ’r)! and C(n,r) = n!/(r!(nโˆ’r)!). Since C divides by r!, combinations are always โ‰ค permutations for the same n and r. Use this calculator to compare both and choose the correct formula for your problem.

nPr and nCr Formulas: With and Without Repetition

Without repetition: P(n,r) = n!/(nโˆ’r)!; C(n,r) = n!/(r!(nโˆ’r)!). Requires r โ‰ค n. With repetition allowed: Permutations = n^r (each of r slots can be any of n items). Combinations with repetition use the stars-and-bars formula: C(n+rโˆ’1, r). The calculator switches formulas automatically based on the Repetition toggle and shows the appropriate Logic Trace. This covers the full range of combinatorics problemsโ€”from basic "how many ways to arrange" to advanced "combinations with replacement."

The Logic Visualizer and Counting Principle

The Logic Visualizer implements the counting principle. For P(6,2) without repetition, two slots show (6)ร—(5) = 30. For C(6,2), those 30 arrangements include duplicates (AB and BA); dividing by 2! = 2 gives 15 unique combinations. With repetition, e.g., P(10,3), slots show 10ร—10ร—10 = 1,000. The visualizer helps you see why permutations exceed combinations and how the factorial formulas arise from sequential choicesโ€”supporting both permutation formula and combination formula understanding.

FAQ

? What is the difference between permutation and combination?

A permutation counts arrangements where order mattersโ€”e.g., picking a President and VP from 5 candidates: AB (A=President, B=VP) differs from BA. A combination counts selections where order does not matterโ€”e.g., picking 2 committee members: AB and BA are the same group. Formulas: P(n,r) = n!/(nโˆ’r)!, C(n,r) = n!/(r!(nโˆ’r)!). Combinations are always โ‰ค permutations for the same n and r because C divides by r! to remove duplicate orderings.

? When should I use permutations vs combinations?

Use permutations when order or position matters: race rankings, passwords, seating arrangements, license plates. Use combinations when you are choosing a set: lottery numbers, committees, poker hands, picking flavors. Quick test: "If I swap two items, do I get a different outcome?" Yes โ†’ permutation. No โ†’ combination.

? How do you calculate nCr and nPr?

nPr (permutations): P(n,r) = n!/(nโˆ’r)!. Example: P(10,3) = 10ร—9ร—8 = 720. nCr (combinations): C(n,r) = n!/(r!(nโˆ’r)!) = P(n,r)/r!. Example: C(10,3) = 720/6 = 120. With repetition allowed: P = n^r; C uses stars-and-bars: C(n+rโˆ’1, r). This calculator shows both with a step-by-step Logic Trace.

? What happens when r is greater than n?

Without repetition, r > n is impossibleโ€”you cannot pick more distinct items than exist. The calculator shows a Mathematical Error and explains this. With repetition allowed, r can exceed n; each slot can choose any of n items, so P = n^r and C = C(n+rโˆ’1, r).

? What is the Logic Visualizer (slot diagram)?

The Logic Visualizer shows the counting principle: r slots filled with choices. Without repetition: (n)ร—(nโˆ’1)ร—โ€ฆร—(nโˆ’r+1) = P(n,r). With repetition: each slot has n options โ†’ nร—nร—โ€ฆร—n = n^r. For combinations, the same product is divided by r! to remove duplicate orderings. This helps you see why permutations exceed combinations when order matters.
๐Ÿ’ก
Mathematical Reference Note

Calculation Logic: This tool uses standard mathematical algorithms. While we strive for accuracy, errors in logic or user input can result in incorrect data.

Verification: Results should be cross-checked if used for important academic, professional, or personal calculations.

Standard Terms: This tool is provided free of charge and as-is. CalcRegistry provides no warranty regarding the accuracy or fitness of these results for your specific needs.

ยฉ 2026 CalcRegistry Reference Last System Check: FEB 2026Free Online Utility Tools