QuickCalculators computes combinations nCr, permutations nPr, and combinations with replacement from n and r, showing the factorial expansion when steps are open. Enter n and r, choose the mode, then read the count with the formula that matches whether order matters.
This page is the canonical combinatorics home for the math hub. Statistics probability tools should link here rather than duplicate counting formulas.
Calculate combinations (nCr)
A combination counts unordered selections of r items from n distinct items. The notation C(n, r), nCr, or "n choose r" all name that count. QuickCalculators evaluates the combination when 0 ≤ r ≤ n for nonnegative integers and explains out-of-range inputs.
Order does not matter in a combination: {A, B} is the same selection as {B, A}. That is the contrast with permutations on the same page.
Apply the combinations formula
The combinations formula is C(n, r) = n factorial / (r factorial × (n - r) factorial). QuickCalculators expands or cancels factorials in the work panel so the fraction reduces before a giant factorial is fully written when possible.
Example: C(5, 2) = 5 factorial / (2 factorial * 3 factorial) = (5 * 4) / (2 * 1) = 10. Symmetry C(n, r) = C(n, n - r) follows from the same formula and can cut work when r is large.
Calculate permutations (nPr)
A permutation counts ordered arrangements of r items from n. The formula is P(n, r) = n factorial / (n - r) factorial. QuickCalculators evaluates nPr as a mode so set-5 permutation scrapes merge here instead of splitting the cluster.
Example: P(5, 2) = 5 * 4 = 20. Each unordered pair corresponds to 2 factorial ordered pairs when r = 2, linking P(n, r) = C(n, r) * r factorial.
Calculate combinations with replacement
Combinations with replacement count unordered selections when repetition is allowed. The standard formula is C(n + r − 1, r). QuickCalculators evaluates that mode so the older combinations-with-replacement tool folds into this page. Example: choosing 2 flavors from 5 with repeats allowed uses C(5 + 2 − 1, 2) = C(6, 2) = 15.
Clarify whether the story allows repeats before picking the mode.
Calculate C(5, 2) step by step
The fixture computes C(5, 2) on QuickCalculators.
- Write 5 factorial / (2 factorial * 3 factorial).
- Cancel 3 factorial to leave (5 * 4) / (2 * 1).
- Compute 20 / 2 = 10.
Listing the pairs from {1,2,3,4,5} also yields ten unordered pairs, matching the formula.
List the combinations of a small set
For small n, listing confirms the count. The handshake problem asks how many handshakes occur among 5 people if each pair shakes once, which is C(5, 2) = 10. QuickCalculators can show the list beside the formula for teaching builds.
Listing fails for large n, which is why the factorial formula matters. When a list and the formula disagree, recount the list for duplicates or missing pairs.
Avoid this common misconception
A common mix-up is using combinations when order matters, such as ranking first and second place. Those stories need permutations. Using nCr for ordered outcomes undercounts by a factor of r factorial. QuickCalculators keeps both modes labeled so the order question is answered before the formula runs.
Frequently asked questions
What is a combination?
A combination is an unordered selection of r items from n. Notation includes C(n, r) and nCr.
What is C(5, 2)?
C(5, 2) equals 10. Entering n = 5 and r = 2 in combination mode returns that fixture.
How do combinations differ from permutations?
Combinations ignore order; permutations count order. P(n, r) = C(n, r) · r factorial.
What is the combinations formula?
The combinations formula is n factorial / (r factorial × (n - r) factorial) for 0 <= r <= n.
What are combinations with replacement?
Combinations with replacement allow repeated items in an unordered selection and use C(n + r − 1, r).
When should you use nPr instead of nCr?
Use nPr when different orders count as different outcomes, such as passwords with position mattering or race place rankings.
Summary
QuickCalculators evaluates nCr, nPr, and combinations with replacement from n and r. The fixture C(5, 2) equals 10. Permutations count order; combinations do not. With-replacement selections use C(n + r − 1, r). Choose the mode from the story before trusting the number.