{ Combination & Permutation Calculator }

// calculate C(n,r) and P(n,r) with full formula breakdown

Calculate combinations C(n,r) and permutations P(n,r) instantly. Shows step-by-step factorial formulas, results, and all arrangement counts for any n and r values.

Total number of items in the set
C(n, r) P(n, r)
Number of items to select or arrange
āˆ‘

Enter n and r values above

Click Calculate to see combinations and permutations

HOW TO USE

  1. 01
    Enter n

    Type the total number of items in your set (e.g. 10 students).

  2. 02
    Enter r

    Type how many items you're choosing or arranging (e.g. 3 positions).

  3. 03
    Calculate

    Click Calculate to see C(n,r) and P(n,r) with full formula steps and a reference table.

FEATURES

nCr Calculator nPr Calculator Factorial Steps Reference Table BigInt Support Copy Results

USE CASES

  • šŸŽ² Probability and statistics problems
  • šŸŽ“ Homework and exam prep
  • šŸ† Lottery and game odds calculation
  • šŸ’» Algorithm complexity analysis
  • šŸ“Š Data science and ML combinatorics

WHAT IS THIS?

This tool calculates both combinations C(n,r) — where order doesn't matter — and permutations P(n,r) — where order does matter — for any non-negative integers n and r. It shows the complete factorial breakdown so you can understand exactly how the result is computed.

RELATED TOOLS

FREQUENTLY ASKED QUESTIONS

What is the difference between combinations and permutations?

A combination counts the number of ways to choose r items from n where order does not matter. A permutation counts arrangements where order does matter. For example, choosing 3 toppings from 10 is a combination; arranging 3 runners on a podium from 10 is a permutation.

What is the formula for C(n, r)?

The combination formula is: C(n, r) = n! / (r! Ɨ (nāˆ’r)!) where ! denotes factorial. This is also written as "n choose r" or shown with binomial coefficient notation.

What is the formula for P(n, r)?

The permutation formula is: P(n, r) = n! / (nāˆ’r)!. Since order matters in permutations, there are always more permutations than combinations for the same n and r (when r > 1).

Can r be greater than n?

No — r must be less than or equal to n. You cannot choose more items than exist in the set. The calculator will show an error if r > n.

What does C(n, 0) or P(n, 0) equal?

Both equal 1. There is exactly one way to choose zero items from a set (the empty selection), and exactly one way to arrange zero items. This is consistent with the definition of 0! = 1.

How large can n and r be?

This tool uses JavaScript BigInt for client-side calculations, supporting very large numbers. Values up to n = 1000 are accepted, though results may have hundreds of digits for large inputs.

What is a factorial?

A factorial of a non-negative integer n (written n!) is the product of all positive integers from 1 to n. For example, 5! = 5 Ɨ 4 Ɨ 3 Ɨ 2 Ɨ 1 = 120. By convention, 0! = 1.

Why is P(n, r) always ≄ C(n, r)?

Because P(n, r) = C(n, r) Ɨ r!. Permutations include all the orderings of each combination. When r = 1, P = C. For r ≄ 2, P is always strictly larger than C since r! ≄ 2.

What is a Combination and Permutation Calculator?

A combination and permutation calculator is a mathematical tool that computes the number of ways to select or arrange items from a set. Whether you're solving a probability problem, preparing for an exam, analyzing game odds, or working on a software algorithm, knowing how many possible outcomes exist is fundamental. This free online calculator handles both C(n,r) and P(n,r) instantly, showing you the complete factorial breakdown so you understand not just the answer, but the method behind it.

šŸ’” Looking for premium web development assets? MonsterONE offers unlimited downloads of templates, UI kits, and developer tools — worth checking out.

Understanding Combinations: C(n, r)

A combination answers the question: "In how many ways can I choose r items from a group of n, if the order of selection does not matter?" The formula is:

C(n, r) = n! / (r! Ɨ (nāˆ’r)!)

For example, if you want to choose 3 pizza toppings from a menu of 10, the order you pick them doesn't affect the final pizza. So C(10, 3) = 120 possible combinations. Combinations appear in probability theory, statistics, the binomial theorem, and many areas of discrete mathematics.

Understanding Permutations: P(n, r)

A permutation answers the question: "In how many ordered arrangements can I place r items from a group of n?" The formula is:

P(n, r) = n! / (nāˆ’r)!

For example, if 10 runners enter a race and you want to know how many distinct ways the gold, silver, and bronze medals can be awarded, the order matters — P(10, 3) = 720 arrangements. Permutations are used in cryptography, scheduling, seating arrangements, and counting ordered sequences.

Key Difference: Order Matters

The crucial distinction between combinations and permutations is whether the order of selection matters. Consider choosing 2 letters from {A, B, C}:

This is why P(n,r) = C(n,r) Ɨ r! — each combination generates r! permutations through its different orderings.

What Is a Factorial?

Both formulas rely on factorials. The factorial of n (written n!) is the product of all positive integers up to n:

Factorials grow extremely fast. 20! is already over 2 quintillion. This calculator uses JavaScript's BigInt type to handle arbitrarily large factorials without losing precision, unlike floating-point arithmetic which would introduce rounding errors.

Real-World Applications

Lottery odds: If a lottery draws 6 numbers from 49, the number of possible tickets is C(49, 6) = 13,983,816. Order doesn't matter (the balls aren't ranked), so we use combinations.

Password security: If a 4-digit PIN uses digits 0–9 without repetition, the number of possible PINs is P(10, 4) = 5,040. Order matters because 1234 and 4321 are different PINs.

Team selection: Choosing 5 players from a squad of 20 for a basketball starting lineup is C(20, 5) = 15,504 possible teams.

Seating arrangements: Arranging 4 guests in 4 specific chairs from a group of 8 people is P(8, 4) = 1,680 arrangements.

Special Cases

Several edge cases are worth noting: C(n,0) = P(n,0) = 1 for all n (there's exactly one way to choose or arrange nothing). C(n,n) = 1 (only one way to choose all items). C(n,1) = n (you can choose any single item). P(n,n) = n! (the number of ways to arrange all n items, also called a full permutation).

How This Calculator Works

Enter n (the total set size) and r (how many to choose or arrange), then click Calculate. The tool immediately computes C(n,r) and P(n,r) using BigInt arithmetic to handle very large numbers precisely. It then displays a step-by-step factorial breakdown — showing n!, r!, and (nāˆ’r)! individually — so you can follow the math. A quick-reference table lists all C(n,k) and P(n,k) for k from 0 to n, making it easy to compare values across different r selections at once.

ā˜•