Combinations & Permutations with Replacement
CR(n,r) counts ways to choose r items from n types when repetition is allowedโstars and bars gives CR(n,r)=C(n+r-1,r). PR(n,r)=n^r counts ordered r-tuples with replacement.
Why This Mathematical Concept Matters
Why: With replacement: you can pick the same item again. CR counts multisets; PR counts sequences. Ice cream: 3 scoops from 5 flavors (replacement allowed) = CR(5,3).
How: CR(n,r) = C(n+r-1,r)โplace r stars in n bins (n-1 bars). PR(n,r) = n^rโeach of r positions has n choices.
- โDice: 2 dice = 6ยฒ = 36 outcomes (PR).
- โIce cream: 3 scoops from 5 flavors = CR(5,3) = C(7,3) = 35.
- โStars and bars: r identical items into n distinct bins.
๐ Examples โ Click to Load
Enter Values
Comparison Chart
Distribution
๐ Step-by-Step Breakdown
โ ๏ธFor educational and informational purposes only. Verify with a qualified professional.
๐งฎ Fascinating Math Facts
PR(n,r) = n^r โ each of r choices has n options.
Stars and bars: r stars, n-1 bars โ C(n+r-1,r) ways.
๐ Key Takeaways
- โข CR(n,r) โ Combinations with replacement: choose r from n, order doesn't matter, items can repeat
- โข PR(n,r) โ Permutations with replacement: arrange r from n, order matters, items can repeat
- โข C(n,r) โ Regular combinations: no repetition
- โข P(n,r) โ Regular permutations: no repetition
- โข Stars and bars: CR(n,r) = C(n+r-1, r) โ placing r items in n bins
๐ก Did You Know?
๐ How It Works
CR(n,r) counts multisets of size r from n types โ "stars and bars": placing r indistinguishable items into n distinct bins. CR(n,r) = C(n+r-1, r).
PR(n,r) = n^r: each of r positions can be any of n items independently. Used for PINs, passwords, dice.
๐ Worked Example: CR(5,3)
Step 1: CR(5,3) = C(5+3-1, 3) = C(7,3)
Step 2: C(7,3) = 7! / (3! ร 4!) = 5040 / (6 ร 24) = 35
Result: 35 ways to get 3 scoops from 5 flavors (vanilla-vanilla-chocolate = chocolate-vanilla-vanilla)
Stars and bars: 3 stars, 4 bars โ C(7,3) = 35
๐ Real-World Applications
๐ฆ Ice Cream Scoops
CR(5,3) = 35 combos for 3 scoops from 5 flavors.
๐ฒ Dice & Games
PR(6,2) = 36 for 2 dice; PR(6,3) for 3 dice.
๐ Combination Locks
PR(10,4) = 10,000 for 4-digit lock.
๐ Passwords
PR(62,8) for 8-char alphanumeric.
๐ป Binary Strings
PR(2,n) = 2^n for n-bit binary.
๐ Sampling
With replacement vs without in statistics.
โ ๏ธ Common Mistakes to Avoid
- Using C instead of CR: Ice cream (repetition OK) needs CR, not C.
- Using P instead of PR: PINs (repetition OK) need PR = n^r, not P(n,r).
- Confusing order: CR = order doesn't matter; PR = order matters.
- n=0, r>0: PR(0,r)=0, CR undefined. No items to choose from.
- Overflow: n+r-1 โค 500 for CR to avoid overflow.
๐ฏ Expert Tips
๐ก Stars and Bars
CR(n,r) = r stars + (n-1) bars โ C(n+r-1, r) ways to arrange.
๐ก CR vs PR
CR: order doesn't matter (ice cream). PR: order matters (PIN).
๐ก PR = n^r
Each position independent. 10^4 = 10,000 4-digit PINs.
๐ก Compare All Four
C < CR when r > 1; P < PR when r > 1. CR < PR typically.
๐ Reference Table
| Type | Formula | Order |
|---|---|---|
| C(n,r) | n! / (r!(n-r)!) | Rep: No |
| CR(n,r) | C(n+r-1, r) | Rep: Yes |
| P(n,r) | n! / (n-r)! | Rep: No |
| PR(n,r) | n^r | Rep: Yes |
๐ Quick Reference
๐ Practice Problems
โ FAQ
When to use CR vs PR?
Use CR when order doesn't matter (ice cream flavors). Use PR when order matters (PIN codes, dice rolls).
Why is CR(n,r) = C(n+r-1,r)?
Stars and bars: placing r items in n bins is equivalent to choosing r positions from n+r-1 slots.
What is the multiset coefficient?
CR(n,r) is the multiset coefficient โ number of r-element multisets from an n-element set.
Can r exceed n for CR?
Yes. CR(5,10) = C(14,10) = 1001 โ 10 scoops from 5 flavors.
PR vs P?
PR allows repetition (n^r); P does not (n!/(n-r)!).
CR vs C?
CR allows repetition (C(n+r-1,r)); C does not (n!/(r!(n-r)!)).
Real-world CR example?
Distributing r identical candies to n children: CR(n,r).
๐ Summary
CR(n,r) = C(n+r-1,r) counts multisets; PR(n,r) = n^r counts ordered sequences with replacement. Use CR for ice cream, PR for PINs. Stars and bars explains CR.
โ Verification Tip
CR(n,1)=n, CR(n,0)=1. PR(n,1)=n, PR(n,0)=1. CR(5,3)=35, PR(10,4)=10000.
๐ Next Steps
Explore the Combination Calculator for C(n,r), Permutation Calculator for P(n,r), or Binomial Coefficient Calculator for Pascal's triangle.
โ ๏ธ Disclaimer: For n+r-1 > 500, overflow may occur. Results for educational use. Verify critical calculations independently.