Combination & Permutation Calculator

Calculate C(n,r) and P(n,r), compare unordered selections with ordered arrangements, and copy the exact integer even when the screen uses compact notation.

r ≤ n required. Both whole numbers between 0 and 170.

Quick Example

A five-card hand drawn from a 52-card deck has 2,598,960 possible groups because the order of the cards in the hand is irrelevant. Awarding gold, silver and bronze in a race is different: moving one person to another place creates a new outcome. The first situation uses C(n,r); the second uses P(n,r).

Order changes the unit being counted

A combination counts groups. Choosing Ava and Noah gives the same pair as choosing Noah and Ava. A permutation counts arrangements, so assigning Ava as chair and Noah as secretary is different from reversing those jobs. The words “choose” and “select” do not settle the issue by themselves; ranks, seats and named roles usually make order matter.

One pair of inputs, two meanings

For n = 5 and r = 2, C(5,2) is 10 while P(5,2) is 20. Each pair can be ordered in 2! ways, which explains P(n,r) = C(n,r) × r!. Reading both values together is useful when a word problem is unclear: if swapping the selected items changes the outcome, use the ordered count.

Read n and r before expanding factorials

The combination formula is C(n,r) = n! / [r! × (n-r)!]. The permutation formula is P(n,r) = n! / (n-r)!. Here n is the number available, r is the number taken and the exclamation mark denotes factorial. Dividing by r! removes the duplicate orders of every group from the unordered result.

How to calculate combinations without writing every factor

  1. For n = 8 and r = 3, start with 8! / (3! × 5!).
  2. Cancel the shared 5!, leaving (8 × 7 × 6) / (3 × 2 × 1).
  3. Divide 336 by 6 to obtain C(8,3) = 56. The ordered result keeps 336 because it does not divide by 3!.

Cancelling first avoids unnecessarily large intermediate numbers. When r is close to n, the symmetry C(n,r) = C(n,n-r) gives a shorter hand calculation. The calculator uses the same identities with BigInt integers, so no floating-point rounding enters the count.

Repetition, limits and edge cases

The inputs accept whole numbers from 0 through 170, and r cannot exceed n. They describe selections without repetition. For n ≥ 1 types and r ≥ 0 selections with repetition, the unordered count is C(n+r-1,r). For an ordered code with n choices at each of r positions, repetition instead gives nr possibilities. Leading zeroes are allowed in that code model.

C(n,0), C(n,n) and P(n,0) all equal 1. These are valid boundary values: there is one empty selection and one way to take the full set without assigning an order. The quick examples C(49,6) and C(52,5) show how rapidly the counts grow.

Results longer than 30 digits use compact notation on screen to keep the card readable. Copy or share the result when you need every digit; the complete BigInt value is used instead of the shortened display.

Frequently Asked Questions About the Combination & Permutation Calculator

In a counting problem, a combination is a group chosen without regard to order. C(5,2) = 10 because reversing the two people does not create another pair. The notation is C(n,r) or nCr.

A permutation counts ordered arrangements. Assigning two different positions among five people gives P(5,2) = 20 outcomes because swapping the two people changes their roles.

The combination formula is C(n,r) = n! / [r! × (n-r)!]. The permutation formula is P(n,r) = n! / (n-r)!. Dividing by r! removes the different orders of each selected group.

The normal inputs describe selection without repetition. For an unordered selection with repetition, use n+r-1 as the total and r as the number chosen, then read C rather than P. This requires n ≥ 1, r ≥ 0 and a transformed total no greater than 170.

Couldn't find the answer you were looking for?

Explore all our tools and get the fastest answer to your question.

Go to All Tools