Calculate combinations C(n, k), permutations or combinations with repetition from n and k, or solve for n or k from a known combination count.

Choose combinations, arrangements, or integer partitions. Integer partitions count unordered sums; set partitions use 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.

Integer Partition Number p(n)

An integer partition writes a nonnegative integer n as a sum of positive integers without counting different orders separately. Choose Integer partition number p(n) and enter n from 0 to 10,000. The result is an exact count. This mode is different from combinations C(n, k) and from set partitions of distinct objects.

With p(0) = 1 and p(t) = 0 for t < 0, Euler’s recurrence is p(n) = p(n โˆ’ 1) + p(n โˆ’ 2) โˆ’ p(n โˆ’ 5) โˆ’ p(n โˆ’ 7) + p(n โˆ’ 12) + p(n โˆ’ 15) โˆ’ โ€ฆ . The offsets are k(3k โˆ’ 1)/2 and k(3k + 1)/2 for k = 1, 2, โ€ฆ, with signs +, +, โˆ’, โˆ’ repeating. Terms stop when their arguments become negative.

For example, enter n = 5 to get p(5) = 7: 5; 4 + 1; 3 + 2; 3 + 1 + 1; 2 + 2 + 1; 2 + 1 + 1 + 1; and 1 + 1 + 1 + 1 + 1. Writing 1 + 4 instead of 4 + 1 does not add another partition. For n = 0, the empty sum gives p(0) = 1.

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.