Independent study guide

Counting Outcomes: Order, Repetition and Stars and Bars

Choose the right counting method before calculating. Three worked examples and six exercises distinguish ordered outcomes, category totals and probability weights.

Nablio · 6 questionsPublished

1. Start with what gets recorded

Ask two questions before choosing a formula. If two different entries swap positions, is the result different? Can the same type be used again? In a sequence, each position is distinguished. In a totals list, the categories are still labelled, but the order in which items were chosen is not recorded.

If kk types are available in each of rr positions and repetition is allowed, the product rule gives krk^r. If repetition is forbidden and r≤kr\le k, use k(k−1)⋯(k−r+1)k(k-1)\cdots(k-r+1) for positions, or (kr)\binom{k}{r} for an unordered selection. If r>kr>k, there are no outcomes without repetition. With repetition and only totals recorded, count nonnegative integer solutions of x1+⋯+xk=rx_1+\cdots+x_k=r. Use these rules only once you have checked any additional restrictions.

2. Worked example: 81 displays or 15 totals?

Problem. Four labelled display positions each show one shape: circle C, triangle T or square S. Repetition is allowed. How many complete displays are there? How many records if only the counts of C, T and S are stored?

Solution. Swapping a circle and a square changes the display, so there are 34=813^4=81 displays. For a count record, fix the category order C, T, S. The symbol string ★|★★|★ represents (1,2,1)(1,2,1). Four stars mark the four positions’ contributions to the totals; two bars separate three categories. Adjacent bars or a bar at an end allow zero for a category. Every valid symbol string gives one record and every record gives one string. Choose the two bar positions from six symbol positions to get (62)=15\binom{6}{2}=15.

In general, with rr units and k≥1k\ge1 labelled categories, there are r+k−1r+k-1 symbol positions, so the count is (r+k−1k−1)\binom{r+k-1}{k-1}. The stars do not carry the labels of the original positions: those labels are precisely what the counts discard.

3. Worked example: reserve the minimum first

Problem. A community workshop distributes nine identical refill packs across four labelled drawers. Each drawer must get at least one pack. How many distributions are possible?

Solution. Reserve one per drawer. With allocations x1,…,x4x_1,\ldots,x_4, write yi=xi−1y_i=x_i-1. The leftovers satisfy y1+y2+y3+y4=5y_1+y_2+y_3+y_4=5 with no other restrictions besides nonnegativity. Choose three bars among eight symbols: (83)=56\binom{8}{3}=56. Add one back to each leftover count to recover the allocation. If the minima exceed the available total, there are no solutions; if there is also a maximum, direct stars and bars can count forbidden allocations.

4. Worked example: totals do not have equal probabilities

Problem. Return to the four display positions. Each chooses independently among C, T and S with equal probability. What is the probability that all three types appear?

Solution. Every complete display has probability 1/811/81. If all three types appear, exactly one type occurs twice. There are three choices of repeated type, (42)=6\binom{4}{2}=6 choices for its positions, and 2!=22!=2 ways to fill the two remaining positions. Therefore the probability is 3⋅6⋅2/81=4/93\cdot6\cdot2/81=4/9.

There are three favourable count records out of fifteen, but 3/153/15 would be correct only under a different experiment that selects those fifteen records uniformly. Under the stated experiment, (4,0,0)(4,0,0) has one matching display and (2,1,1)(2,1,1) has twelve. Grouping equally likely displays does not preserve equal probabilities unless all groups have the same size.

5. Six practice exercises

1. Repetition in labelled positions

Three numbered pads each display one of four symbols, with repetition. Count complete displays.

Hint

Each pad still has four available choices.

Explained solution

The pads distinguish position and the choices do not restrict each other. The product is 43=644^3=64.

2. Distinguish a set and a sequence

Two of five distinct tiles are selected without repetition. Count unordered selections, then ordered pairs.

Hint

Every unordered selection gives two ordered pairs.

Explained solution

There are 5⋅4=205\cdot4=20 ordered pairs. Each unordered selection is counted twice, giving (52)=10\binom{5}{2}=10.

3. Allow empty categories

Allocate six identical markers to three labelled bins, with no required minimum. Count the allocations.

Hint

Use two bars. They may be adjacent.

Explained solution

Six stars and two bars give (82)=28\binom{8}{2}=28 allocations, including those with one or two empty bins.

4. Unequal minimums

Split seven identical tokens among A, B and C. A must receive at least two, B at least one and C may get zero. Count the allocations.

Hint

Reserve the required tokens before applying the formula.

Explained solution

Reserve 2+1=32+1=3 tokens, leaving four. The remaining counts have no extra restrictions, giving (62)=15\binom{6}{2}=15.

5. A maximum means remove cases

Distribute six identical markers among three labelled bins. Bin A can contain at most two. Count the allocations.

Hint

Start with all allocations and subtract those with three or more in A.

Explained solution

All allocations number (82)=28\binom{8}{2}=28. For forbidden cases reserve three in A, then allocate the remaining three without restrictions: (52)=10\binom{5}{2}=10. The answer is 28−10=1828-10=18.

6. Choose the right probability denominator

Three numbered lights independently choose red or blue, each equally likely. What is the probability of exactly one red light?

Hint

The four possible red totals do not have equal probability. Identify the equally likely outcomes.

Explained solution

There are 23=82^3=8 equally likely colour sequences and (31)=3\binom{3}{1}=3 positions for the red light. The probability is 3/83/8, not 1/41/4.

6. Final check

Name one outcome, test a swap, check repetition and restrictions, and then choose the method. If computing a probability, check the experiment before treating outcomes as equally likely. See MIT 6.042: Advanced Permutations & Combinations II for the stars-and-bars correspondence. Then try the binomial model exercises to apply the position-counting idea to two possible results per trial.

Useful for

Work on the step you’re missing.

Tell us the subject and your preferred time. Nablio confirms the details by text or email.

Request a lesson