Calculate combinations from n and k, permutations, or combinations with repetition. Select an inverse combination mode to find n or all valid k values from an exact count.

This page counts combinations and arrangements. General set partitions require Bell or Stirling numbers.

Combination presets

Partition Formula

The formula below is the binomial coefficient: it counts unordered selections of k distinct items from n, or a chosen subset and its complement as two labeled groups. It does not count general set partitions. The formula is:

P = n! / (k! ร— (n - k)!)

Variables:

  • P is the number of combinations (unordered k-item selections)
  • n is the total number of items in the set
  • k is the number of items in a subset

To calculate combinations, divide n! by k! ร— (n โˆ’ k)!, with whole numbers 0 โ‰ค k โ‰ค n. The calculator uses exact integer arithmetic rather than floating-point factorials.

What is a Partition in Combinatorics?

In combinatorics, a set partition divides a set into nonempty, non-overlapping blocks covering every element. General set partitions are counted by Bell numbers, and partitions into a specified number of blocks by Stirling numbers of the second kind. The binomial formula on this page instead counts selected subsets; it is not a Bell or Stirling-number calculator.

How to Calculate Combinations?

The following steps outline how to calculate combinations without repetition:


  1. First, determine the total number of items in the set (n).
  2. Next, determine the number of items in a subset (k).
  3. Next, gather the formula from above = P = n! / (k! * (n – k)!).
  4. Finally, select Combinations and calculate the number of unordered selections (P).
  5. After inserting the variables and calculating the result, check your answer with the calculator above.

Example Problem : 

Use the following variables as an example problem to test your knowledge.

Total number of items in the set (n) = 5

Number of items in a subset (k) = 2. The result is C(5, 2) = 10. In the inverse k mode, a count of 10 for n = 5 gives k = 2 or k = 3.