C N R N R N-R Calculator
This calculator helps you compute combinations with repetition (C n r n r) and permutations with repetition (n r n-r). These are fundamental concepts in combinatorics that count the number of ways to select or arrange items with repetition allowed.
What is C n r n r?
Combinations with repetition (C n r n r) refer to the number of ways to choose r items from n types of items where repetition is allowed and the order of selection does not matter. This is also known as the "stars and bars" theorem in combinatorics.
Permutations with repetition (n r n-r) count the number of ways to arrange r items from n types of items where repetition is allowed and the order matters.
Both C n r n r and n r n-r are important in probability, statistics, and combinatorial mathematics. They are used in problems involving counting possible outcomes, probability distributions, and algorithm design.
How to Calculate C n r n r
To calculate combinations with repetition, you need to know:
- The number of types of items (n)
- The number of items to choose (r)
The formula for combinations with repetition is:
C(n, r) = (n + r - 1)! / (r! × (n - 1)!)
For permutations with repetition, the formula is:
P(n, r) = nr
These formulas account for the different ways repetition affects the counting process in each scenario.
Formula
The general formula for combinations with repetition is:
C(n, r) = (n + r - 1)! / (r! × (n - 1)!)
Where:
- n = number of types of items
- r = number of items to choose
- ! = factorial
For permutations with repetition, the formula is simpler:
P(n, r) = nr
This formula shows that for each position in the arrangement, there are n choices available.
Example Calculation
Let's calculate C(3, 2) and P(3, 2):
- Combinations with repetition: C(3, 2) = (3 + 2 - 1)! / (2! × (3 - 1)!) = 4! / (2! × 2!) = 24 / (2 × 2) = 6
- Permutations with repetition: P(3, 2) = 32 = 9
This means there are 6 ways to choose 2 items from 3 types with repetition allowed (order doesn't matter), and 9 ways to arrange 2 items from 3 types with repetition allowed (order matters).
FAQ
What is the difference between combinations and permutations?
Combinations count the number of ways to choose items where order doesn't matter, while permutations count the number of ways to arrange items where order matters.
When would I use combinations with repetition?
You would use combinations with repetition when you need to count the number of ways to distribute identical items into distinct groups, such as distributing candies to children.
How does repetition affect the calculation?
Repetition increases the number of possible outcomes because the same item can be chosen multiple times. The formulas account for this by including the repetition factor in the calculation.