Category

Combination Calculator (nCr) — Combinations, Permutations & Generator

Calculate combinations C(n,k) and permutations P(n,k) with or without repetition. Generate all possible combinations up to 10 elements. Includes combination probability and step-by-step formulas.

0 calculations

Calculation Parameters

Optional. Used to label each generated combination.
Quick Reference:
C(n,k) = n! / (k! × (n−k)!)
P(n,k) = n! / (n−k)!

Enter Parameters

Enter n (set size) and k (subset size), then click Calculate.

What Is a Combination? — Combination Definition

A combination is a selection of items from a larger set where the order does not matter. If you have a set of n distinct objects and want to choose k of them, the number of ways to do so is called C(n, k), also written nCk or "n choose k".

For example, choosing 2 fruits from {Apple, Banana, Cherry} gives: {Apple, Banana}, {Apple, Cherry}, {Banana, Cherry} — 3 combinations. The order (Apple first or Banana first) is irrelevant.

How to Calculate Combinations — Combination Formula

The combinations formula (without repetition) is:

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

Where n! (n factorial) = n × (n−1) × … × 1. For example, C(10, 3) = 10! / (3! × 7!) = 120.

Step-by-Step Example: C(5, 2)

  • n = 5, k = 2
  • 5! = 120, 2! = 2, 3! = 6
  • C(5, 2) = 120 / (2 × 6) = 10

Metric/SI example: Selecting 2 chemical elements (in grams) from a set of 5 to mix — C(5, 2) = 10 unique mixtures.
US system example: Picking 2 ingredients (measured in cups/oz) from 5 — same 10 combinations.

Permutation and Combination

The key difference:

  • Combination: Order does NOT matter — {A, B} = {B, A}
  • Permutation: Order DOES matter — {A, B} ≠ {B, A}

The permutation formula:

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

Since order matters, P(n, k) ≥ C(n, k). In fact: P(n, k) = C(n, k) × k!

Example: P(5, 2) = 5! / 3! = 20, while C(5, 2) = 10. The 20 permutations include both {A, B} and {B, A} as distinct, whereas combinations count them as one.

Permutation and Combination with Repetition

Combinations with Repetition

When items can be chosen more than once:

Crep(n, k) = C(n + k − 1, k) = (n + k − 1)! / (k! × (n − 1)!)

Example: Choosing 2 scoops of ice cream from 3 flavors (repetition allowed) = C_rep(3, 2) = C(4, 2) = 6.

Permutations with Repetition

Prep(n, k) = nk

Example: A 4-digit PIN from digits 0–9 (with repetition) = 104 = 10,000 possible codes.

Combination Generator

Our combination generator lists every possible combination when n ≤ 10 and total combinations ≤ 300. Simply enter your items (comma-separated) to see all results. For example, entering "A, B, C, D, E" with k = 2 yields: {A,B}, {A,C}, {A,D}, {A,E}, {B,C}, {B,D}, {B,E}, {C,D}, {C,E}, {D,E} — exactly C(5,2) = 10 combinations.

Combination Probability

If you randomly draw k items from a set of n, the probability that you select one specific combination is:

P = 1 / C(n, k)

Example — Lottery: If you pick 6 numbers from 49, C(49, 6) = 13,983,816. The probability of hitting the jackpot is 1 / 13,983,816 ≈ 0.0000000715 (about 1 in 14 million).

Linear Combination

A linear combination is a sum of terms, each multiplied by a scalar coefficient:

a₁x₁ + a₂x₂ + … + aₙxₙ

This concept is central to linear algebra, spanning vector spaces, and solving systems of equations. It is distinct from the combinatorial "n choose k" definition above.

Currency Applications of Combinations

Combinations appear frequently in financial and investment scenarios — across all currencies:

  • Portfolio selection (USD $): Choosing 5 stocks from a list of 20 — C(20, 5) = 15,504 portfolios.
  • Currency basket (EUR €): Selecting 3 currencies from the G10 (10 currencies) — C(10, 3) = 120 baskets.
  • Bond portfolio (GBP £): Picking 4 bonds from 12 offerings — C(12, 4) = 495 combinations.
  • Crypto selection (BTC / ETH): Choosing 2 coins from the top 50 — C(50, 2) = 1,225 pairs.

Measurement System Examples

Metric System

  • Selecting 3 chemical compounds (measured in moles) from a set of 8 for a reaction: C(8, 3) = 56.
  • Choosing 2 kg weights from a set of 5 different masses: C(5, 2) = 10 weight combinations.

US / Imperial System

  • Picking 3 recipe ingredients (in cups/oz) from 7 options: C(7, 3) = 35 recipes.
  • Selecting 4 pipe diameters (in inches) from 10 available sizes: C(10, 4) = 210 combinations.

Frequently Asked Questions (FAQ)

What is the difference between C(n,k) and P(n,k)?

C(n,k) counts unordered selections; P(n,k) counts ordered arrangements. P(n,k) = C(n,k) × k!

Can k be 0?

Yes. C(n, 0) = 1 for any n (there is exactly one way to choose nothing). P(n, 0) = 1 as well.

Can n = k?

Yes. C(n, n) = 1 (choose all elements — one way). P(n, n) = n! (all permutations of n elements).

What is the maximum n this calculator supports?

Up to n = 300. For exact results with large n (e.g., n = 200), the calculator uses GMP (GNU Multiple Precision) arithmetic when available on the server. Otherwise, results are shown in scientific notation.

When does the combination generator work?

The generator lists all combinations when n ≤ 10 and C(n,k) ≤ 300. For larger values the number of combinations would be impractical to display. Enter your actual item names (comma-separated) to label each combination.

How is combination probability used in lotteries?

In a 6/49 lottery you pick 6 numbers from 49. C(49, 6) = 13,983,816. Your chance of matching all 6 is 1 / 13,983,816. The more numbers in the pool (n) or the larger the pick (k), the more the combinations — and the lower the probability.

Calculation History

Loading...