Now repetition is allowed, and some objects can be identical. Only subsections 6.5.1–6.5.4 are on the exam. Skip 6.5.5 (distributing objects into boxes).
The master table
Selecting items from types/objects:
| No repetition | Repetition allowed | |
|---|---|---|
| Order matters | ||
| Order doesn't matter |
Plus: arranging objects where are identical of type 1, …, identical of type :
Permutations with repetition
The number of -permutations of a set of objects with repetition allowed is .
Each of the positions independently gets any of the objects (product rule). Example from class: strings of length over the 26 uppercase letters: .
Combinations with repetition (stars and bars)
The number of -combinations from a set with elements with repetition allowed is
Represent a selection of items from types as stars and bars (dividers between the types). For example, with 4 types and 6 items:
Every arrangement of stars and bars is one selection, so the count is the number of ways to choose star positions among spots: .
Memory aid: or, equivalently, .
- 6-combinations of with repetition: .
- 5 pieces of fruit from apples, oranges, pears: .
- 8 bills from 7 denominations (1, 2, 5, 10, 20, 50, 100): .
Integer solutions of equations
The number of solutions of with every an integer is
( = how many items of type ; variables = types.)
.
- Lower bound : give to up front. Subtract from the total, then count normally.
- Upper bound : complement. (All solutions) − (solutions with ).
- Two upper bounds: inclusion–exclusion. All − (first violated) − (second violated) + (both violated).
- Inequality : add a slack variable to make it .
Give out first, leaving to distribute freely among 3 variables: .
All solutions: . Bad ones (): give 5 to , leaving 15: . Answer: .
Permutations with indistinguishable objects
The number of different permutations of objects, where there are indistinguishable objects of type 1, of type 2, …, of type , is
Why: place the type-1 objects in ways, then type 2 in ways, and so on. The product telescopes to the formula. Equivalently: arrangements, but each is counted times because swapping identical letters changes nothing.
- SUCCESS (S×3, C×2, U, E): .
- MISSISSIPPI (M×1, I×4, S×4, P×2): .
- ABBCCCDDDDEEEEE: .
Split by length and by which letters are used (sum rule), applying to each case. Organize by how many copies of the repeated letter you use.
Bit strings with six 1s and eight 0s: . Two types of identical objects is just a binomial coefficient.
The multinomial theorem
- Coefficient of in (with ): .
- Number of distinct terms in : . That's stars and bars, distributing the exponent among variables.
Which formula? A decision guide
- Are some of the objects identical and you're arranging all of them (letters of a word)? Use .
- Does order matter?
- Yes, with repetition: . Without: .
- No, with repetition ("choose 12 donuts from 21 kinds", "solutions of "): . Without: .
- Constraints? Lower bounds: give them out first. Upper bounds: complement / inclusion–exclusion.
- Using when repetition is allowed. "Choose 3 donuts from 5 kinds" is , not .
- Mixing up and in : = number of types, = number of items chosen.
- Forgetting that "at least one of each" means subtract one per type first.
Exam checklist
- Pick the right formula from the master table.
- Stars and bars, including lower/upper bounds and (slack variable).
- Rearrangements of words with repeated letters; "some or all of the letters" by cases.
- Multinomial coefficients and number of terms.