Skip to main content
Viva Calculator

N Choose K Calculator – Combinations and Permutations

Calculate combinations and permutations (n choose k).

Calculate

Method and source check

Last checked:

Automated source and implementation review, including worked examples and documented numerical limits. This review does not provide professional advice or specialist approval.

Method

For nonnegative integers 0≤k≤n, compute combinations with a multiplicative BigInt formula and permutations with a falling product.

C(n,k) = n!/(k!(n−k)!)

P(n,k) = n!/(n−k)!

Variables and units

n
number of distinct available items
k
number selected, 0≤k≤n

Worked example

For n=5,k=2, combinations are 10 and permutations are 20.

Limitations

Valid integer results are returned as exact decimal strings; there is no rounding.

  • Assumes distinct items selected without replacement.
  • Inputs must fit the validated JavaScript integer range; very large calculations may take time.
  • C(n,0)=C(n,n)=1.
  • P(n,k)=C(n,k)×k!.

Sources

How to Use

  1. Enter n (the total number of items)
  2. Enter k (the number of items to choose)
  3. View the formulas and results

Calculate combinations and permutations (n choose k)

Calculate binomial coefficients (n choose k), combinations, and permutations. Method: For nonnegative integers 0≤k≤n, compute combinations with a multiplicative BigInt formula and permutations with a falling product.

The formula is: C(n,k) = n! / (k! × (n-k)!)

Combinations vs Permutations

The key difference is whether order matters:

  • Combinations: Order doesn't matter. Choosing {A, B, C} is the same as {C, B, A}
  • Permutations: Order matters. ABC is different from CBA
  • Permutations are always greater than or equal to combinations
  • P(n,k) = C(n,k) × k!

Real-World Examples

Combinations and permutations appear in many situations:

  • Lottery: How many ways to pick 6 numbers from 49? C(49,6) = 13,983,816
  • Poker hands: 5 cards from 52 = C(52,5) = 2,598,960 possible hands
  • Team selection: Choosing 5 players from 12 = C(12,5) = 792 ways
  • Password arrangements: Arranging 4 digits = P(10,4) = 5,040 permutations (without repeated digits)

Properties of Binomial Coefficients

  • C(n,0) = C(n,n) = 1
  • C(n,k) = C(n, n-k) (symmetry)
  • C(n,k) = C(n-1,k-1) + C(n-1,k) (Pascal's identity)
  • Sum of row n in Pascal's triangle = 2^n

Method, example, rounding, and limits

Method: For nonnegative integers 0≤k≤n, compute combinations with a multiplicative BigInt formula and permutations with a falling product.

Worked example: n=5, k=2 → C=10, P=20.

Rounding: Exact integer strings; no rounding.

Limit: Assumes distinct items selected without replacement.

Reference: OpenStax. https://openstax.org/books/college-algebra-2e/pages/9-5-counting-principles

Frequently Asked Questions

When should I use combinations vs permutations?
Use combinations when the order of selection doesn't matter (like choosing team members). Use permutations when order matters (like arranging people in a line or assigning positions).
Why is C(n,k) = C(n, n-k)?
Choosing k items to include is the same as choosing (n-k) items to exclude. For example, choosing 3 people from 5 to be on a team is equivalent to choosing 2 people to not be on the team.
What is Pascal's Triangle?
Pascal's Triangle is a triangular array where each number is the sum of the two numbers above it. The nth row contains all binomial coefficients C(n,0) through C(n,n).
Can n choose k handle large numbers?
The result uses arbitrary-precision integer arithmetic after the entered n and k pass integer validation. Very large valid calculations can take longer, and input values must remain within the supported integer range.