Permutation and Combination Calculator
Calculate permutations (nPr) and combinations (nCr) with step-by-step factorial breakdown. Toggle between order matters vs. does not matter to see the correct formula.
Permutations & Combos
Results update instantly as you type
Enter Values
r!
6
(n−r)!
2
Embed Code
Copy and paste this HTML snippet into any web page to embed this calculator directly.
<iframe src="http://127.0.0.1:54963/embed/math/permutation-combination-calculator?ref=embed" title="Permutation and Combination Calculator" width="100%" style="max-width:600px; border:none; height:500px;" loading="lazy"></iframe>
Direct Link
Share this link to let others open the calculator in their browser.
Type
Permutation — Order Matters
Each different ordering counts as a unique arrangement.
Permutations for n = 5
The highlighted bar (at r = 3) shows the current selection. Other bars show nPr for all possible r values.
Formula
P(n,r) = n! / (n−r)!
Step-by-Step
5! / 2! = 120 / 2 = 60
n!
120
r!
6
(n−r)!
2
Quick Comparison
Permutations count arrangements where order matters (like passwords or race results).
Combinations count selections where order does not matter (like lottery tickets or committee members).
The combination formula divides by r! to remove duplicate orderings.
The Formula
Permutations count arrangements where order matters. Combinations count selections where order does not matter. The key difference is dividing by r! in combinations to eliminate counting different orders as distinct outcomes.
Variable Definitions
Total Items
The total number of distinct items available to choose from. Must be a non-negative integer up to 170.
Items Chosen
How many items you are selecting at a time. Must be between 0 and n.
n Factorial
The product of all positive integers from 1 to n: n × (n−1) × ... × 1. By convention, 0! = 1.
Permutation
Number of ways to arrange r items from n when order matters: n!/(n−r)!
Combination
Number of ways to select r items from n when order does not matter: n!/(r!(n−r)!)
How to Use This Calculator
- 1
Enter the total number of items (n) and how many to choose (r). Both must be non-negative integers with r ≤ n.
- 2
Toggle "Does Order Matter?" to switch between permutations (order matters) and combinations (order does not matter).
- 3
View the result, formula, and detailed step-by-step calculation showing each factorial value.
- 4
Compare permutation vs. combination results — notice that combinations are always smaller because order no longer contributes distinct arrangements.
- 5
The maximum value of n is 170 due to JavaScript factorial overflow limits. For larger values, use the big-number calculator.
Permutations count ordered arrangements; combinations count unordered selections
Understanding the Concept
Permutations and combinations are fundamental counting techniques in combinatorics and probability. Permutations (order matters) count arrangements like passwords ("123" differs from "321"), race rankings (1st, 2nd, 3rd place), and seating arrangements. Combinations (order does not matter) count selections like lottery numbers (the same set of numbers wins regardless of draw order), committee members, and poker hands. The key mathematical insight is that the combination formula is the permutation formula divided by r! — dividing by r! removes the count of different orderings for the same set of items. The factorial function grows extremely fast: 10! = 3,628,800, and 20! is about 2.43 quintillion. This rapid growth is why the calculator caps n at 170 — beyond this, JavaScript's number type can no longer represent the factorial exactly. For larger values, you would need the big-number calculator with arbitrary-precision integers. Real-world applications include password security analysis (how many possible 8-character passwords?), tournament bracket design, genetics (gene combinations), and quality control sampling plans.
Frequently Asked Questions
Sources & References
Related Calculators
Reviews
No reviews yet. Be the first to share your experience with Permutation and Combination Calculator.
Write a Review
