מחשבון תמורות – P(n,r) וצירופים C(n,r)
Calculate permutations P(n,r) and combinations C(n,r) for any values of n and r. Our calculator shows the complete factorial formula, step-by-step solution, and explains when to use permutations vs combinations.
איך להשתמש במחשבון זה
- הזן n (total items)
- הזן r (items chosen)
- הזן Calculate
- לחץ על כפתור חשב
- קרא את התוצאה המוצגת מתחת למחשבון
Permutations vs Combinations: The Key Difference
Permutations P(n,r): Count ordered arrangements. Order matters. "How many ways can you arrange 3 people from a group of 10?" ABC ≠ BAC ≠ CAB — these are different permutations.
Combinations C(n,r): Count unordered selections. Order doesn't matter. "How many ways can you choose 3 people from a group of 10?" {A,B,C} = {B,A,C} = {C,A,B} — all the same combination.
The formulas:
- P(n,r) = n! / (n−r)!
- C(n,r) = n! / (r! × (n−r)!)
C(n,r) = P(n,r) / r! — combinations equal permutations divided by the number of ways to arrange r items (since order doesn't matter in combinations).
How to Calculate P(n,r): Step by Step
P(n,r) counts ordered arrangements of r items chosen from n items:
P(n,r) = n × (n−1) × (n−2) × ... × (n−r+1) = n! / (n−r)!
Example: P(10, 3)
- P(10,3) = 10! / (10−3)! = 10! / 7!
- = (10 × 9 × 8 × 7!) / 7!
- = 10 × 9 × 8 = 720
There are 720 ways to arrange 3 people from a group of 10 in order (e.g., 1st, 2nd, 3rd place finishers in a race).
How to Calculate C(n,r): Step by Step
C(n,r) = n! / (r! × (n−r)!). Also written as ⁿCᵣ or "n choose r" or (n r).
Example: C(10, 3)
- C(10,3) = 10! / (3! × 7!)
- = (10 × 9 × 8 × 7!) / (6 × 7!)
- = (10 × 9 × 8) / (3 × 2 × 1)
- = 720 / 6 = 120
There are 120 ways to choose 3 people from a group of 10 (e.g., selecting a committee of 3 from 10 candidates).
Factorials and Large Numbers
Factorials grow extremely rapidly: 10! = 3,628,800; 20! ≈ 2.43 × 10¹⁸; 52! ≈ 8.07 × 10⁶⁷ (number of ways to shuffle a deck of cards).
Computing large factorials directly overflows standard calculators. The formula P(n,r) = n!/(n-r)! can be simplified by canceling common terms in the numerator and denominator rather than computing raw factorials.
For very large n and r, Stirling's approximation (n! ≈ √(2πn)(n/e)ⁿ) or logarithms of factorials are used.
Real-World Examples
When to use permutations:
- Race finishing positions (1st, 2nd, 3rd out of 20 runners)
- Passwords and PINs (4-digit PIN from 0–9)
- Arranging books on a shelf
- Assigning roles to people
When to use combinations:
- Selecting a team/committee (order of selection doesn't matter)
- Lottery numbers (choosing 6 from 49)
- Choosing toppings for a pizza
- Selecting questions from an exam to answer
Lottery example: UK National Lottery: C(59,6) = 45,057,474. Your odds of winning the jackpot are approximately 1 in 45 million.
Pascal's Triangle and Combinations
Pascal's Triangle is a triangular array where each number is the sum of the two above it. Each entry is a combination: row n, position r = C(n,r).
Row 0: 1 = C(0,0)
Row 1: 1 1 = C(1,0) C(1,1)
Row 2: 1 2 1 = C(2,0) C(2,1) C(2,2)
Row 3: 1 3 3 1
Row 4: 1 4 6 4 1
Pascal's Triangle enables rapid combination calculation and appears in the binomial theorem: (a+b)ⁿ = Σ C(n,k) aⁿ⁻ᵏ bᵏ.
Special Cases and Identities
- C(n,0) = C(n,n) = 1: One way to choose none or all items
- C(n,1) = n: n ways to choose 1 from n
- C(n,r) = C(n, n−r): Symmetry — choosing r is equivalent to choosing which n−r to leave out
- P(n,1) = n: n ways to choose 1 in order
- P(n,n) = n!: All arrangements of n items
- P(n,0) = C(n,0) = 1: One way to arrange/choose nothing
עודכן לאחרונה: March 2026
Frequently Asked Questions
What is the difference between permutation and combination?
Permutations count ordered arrangements (order matters: ABC ≠ BAC). Combinations count unordered selections (order doesn't matter: {A,B,C} = {B,A,C}). Use permutations for rankings/sequences; combinations for teams/subsets.
What is P(5,2)?
P(5,2) = 5!/(5-2)! = 5!/3! = 5 × 4 = 20. There are 20 ordered ways to select 2 items from 5 (e.g., 1st and 2nd place finishers from 5 competitors).
What is C(5,2)?
C(5,2) = 5!/(2!×3!) = (5×4)/(2×1) = 10. There are 10 ways to choose 2 items from 5 (e.g., selecting a pair from 5 people).
How do you calculate 10 choose 2?
C(10,2) = 10!/(2!×8!) = (10×9)/(2×1) = 45. There are 45 ways to choose 2 items from 10.
What is 0! (zero factorial)?
0! = 1 by definition. This is necessary for the formulas to work correctly: C(n,n) = n!/(n!×0!) = n!/(n!×1) = 1 (one way to choose all items), which is correct.
Can r be greater than n in P(n,r)?
No. If r > n, P(n,r) = 0 because you can't arrange more items than you have (without repetition). The formula involves (n-r)! which is undefined for negative arguments.
What is a permutation with repetition?
If repetition is allowed (e.g., a PIN where each digit can repeat), the count is nʳ, not P(n,r). For a 4-digit PIN from 10 digits: 10⁴ = 10,000 possible PINs.
What are the odds of winning the lottery?
For a 6/49 lottery: C(49,6) = 13,983,816. For a 6/59 lottery (UK): C(59,6) = 45,057,474. Your odds are approximately 1 in 14 million to 1 in 45 million, depending on the lottery.
How many ways can 5 people sit in a row?
This is P(5,5) = 5! = 120. If there are only 3 seats for 5 people: P(5,3) = 5×4×3 = 60.
What is nCr on a calculator?
On scientific calculators, nCr (or C(n,r)) is typically accessed by: entering n, pressing nCr (or COMBIN or C), then entering r. On Windows Calculator (scientific mode): n, then select nCr, then r.