PrecalculusSequences, Series and Probability4 of 5
Sequences, Series and Probability · 4

Permutations and Combinations

We often need to count how many different arrangements or groups are possible without listing every single one by hand.

1

Counting with Slots

Suppose we want to know how many outfits we can make from 33 shirts, 44 pairs of pants, and 22 pairs of shoes, or how many 44-digit passcodes we can form using the digits 00 through 99.

Counting with Slots
A\text{A}
B\text{B}
C\text{C}
11
22
33
44
Shirt\text{Shirt}
Pants\text{Pants}
33
44
11
22
33
44
A\text{A}
A1\text{A}1
A2\text{A}2
A3\text{A}3
A4\text{A}4
B\text{B}
B1\text{B}1
B2\text{B}2
B3\text{B}3
B4\text{B}4
C\text{C}
C1\text{C}1
C2\text{C}2
C3\text{C}3
C4\text{C}4
3 rows of 4=123\ \text{rows of}\ 4 = 12

Here is how the slot method works on the 44-digit passcode using the 1010 digits from 00 to 99:

Text solution
Four slots with repeats allowedEach of the 44 slots can take any of the 1010 digits, so we multiply all four counts together.
10×10×10×10\displaystyle 10 \times 10 \times 10 \times 10 =10,000\displaystyle = 10{,}000
Four slots with no repeatsEach chosen digit uses up one option for the next slot, so the number of choices drops by 11 each time.
10×9×8×7\displaystyle 10 \times 9 \times 8 \times 7 =5,040\displaystyle = 5{,}040
2

Factorials and Permutations

Now we want to count how many ways 55 people can line up in 55 chairs for a photo, and how many ways 1010 runners can win the Gold, Silver, and Bronze medals in a race.

Factorials and Permutations
Alice\text{Alice}
Bob\text{Bob}
Charlie\text{Charlie}
David\text{David}
Eve\text{Eve}

Scrambling all nn items in a line multiplies from nn all the way down to 11, which we write as n!n!:

5×4×3×2×1⏟ways to scramble 5 items\displaystyle \underbrace{5 \times 4 \times 3 \times 2 \times 1}_{\text{ways to scramble 5 items}} =5!\displaystyle = 5! =120\displaystyle = 120

When we have more distinct items than slots and cannot repeat an item, like 1010 runners competing for 33 different medals, we stop counting down as soon as the slots are full.

Text solution
Fill the 33 labeled medal slotsStart with all 1010 runners for Gold, then 99 remaining runners for Silver, and 88 for Bronze.
10⏟Gold×9⏟Silver×8⏟Bronze\displaystyle \underbrace{10}_{\text{Gold}} \times \underbrace{9}_{\text{Silver}} \times \underbrace{8}_{\text{Bronze}} =720\displaystyle = 720
Cancel the unused numbers with factorialsThe permutation formula writes the full 10!10! countdown on top and divides by 7!7! on the bottom to cancel 77 down to 11, where there are no slots left.
P(n,k)=n!(n−k)!P(10,3)=10!(10−3)!=10!7!=10×9×8=720\displaystyle \begin{aligned} P(n, k) &= \frac{n!}{(n - k)!} \\ P(10, 3) &= \frac{10!}{(10 - 3)!} = \frac{10!}{7!} \\ &= 10 \times 9 \times 8 = 720 \end{aligned}

On a test, you don't need to plug into the factorial fraction. Just start counting down at 1010 and stop after 33 slots.

3

Combinations: Dividing Out the Scrambles

Awarding Gold, Silver, and Bronze gave 720720 outcomes because switching who gets Gold and who gets Silver changes the result. Next, we want to pick an unlabeled group, such as 33 people out of 1010 to help carry boxes, or a committee of 44 people from 1212, where the order in which we call their names does not matter.

Combinations: Dividing Out the Scrambles
Gold\text{Gold}
Silver\text{Silver}
Bronze\text{Bronze}
carry boxes\text{carry boxes}

Swapping the same 33 people across the slots gives 3!=6\scramble{3!} = \scramble{6} different medal results on the podium, while the unlabeled group of 33 carrying boxes stays the exact same group across all 6\scramble{6} rows.

Swapping the same 3 people across the 3 slots creates 6 different medal results on the podium, but leaves the unlabeled group of 3 completely unchanged.

Dividing the ordered slot countdown by the k!\scramble{k!} ways to scramble those kk slots gives the combination formula, read "nn choose kk":

(nk)=C(n,k)=nCk=n!k!(n−k)!=n×(n−1)×⋯⏞k slots on topk×(k−1)×⋯×1⏟k! scrambles on bottom\displaystyle \begin{aligned} \binom{n}{k} &= C(n, k) = {}_nC_k \\ &= \frac{n!}{\scramble{k!}(n - k)!} \\ &= \frac{\overbrace{n \times (n - 1) \times \cdots}^{\text{$k$ slots on top}}}{\scramble{\underbrace{k \times (k - 1) \times \cdots \times 1}_{\text{$k!$ scrambles on bottom}}}} \end{aligned}

Let's use this setup to pick a committee of 44 people from 1212:

Text solution
Fill 44 slots on top starting from 1212Count down 44 slots as if the order you pick them mattered.
12×11×10×9\displaystyle 12 \times 11 \times 10 \times 9
Divide by the 4!\scramble{4!} scrambles on the bottomSince the 44 committee spots have no labels, divide by the 4×3×2×1\scramble{4 \times 3 \times 2 \times 1} ways to scramble the same 44 people.
(124)\displaystyle \binom{12}{4} =12×11×10×94×3×2×1\displaystyle = \frac{12 \times 11 \times 10 \times 9}{\scramble{4 \times 3 \times 2 \times 1}}
Cancel common factors before multiplyingCancel 4×3\scramble{4 \times 3} with 1212, and divide 1010 by 2\scramble{2} to leave 55.
11×5×9\displaystyle 11 \times 5 \times 9 =495\displaystyle = 495
4

Words with Repeated Letters

Dividing out scrambles also works when we rearrange items and some of them are identical. Suppose we want to count how many different ways we can rearrange the letters of a word like MOM\text{MOM} or BANANA\text{BANANA}.

Words with Repeated Letters
CAT\text{CAT}
MOM\text{MOM}

Swapping the three A\text{A}'s or the two N\text{N}'s among themselves in 3!×2!=12\scramble{3!} \times \scramble{2!} = \scramble{12} ways still spells the exact same word BANANA\text{BANANA}, while swapping two different letters like B\text{B} and A\text{A} makes a new word.

Every word made from BANANA bundles 12 tagged scrambles together, so swapping matching letters stays in the same bundle while swapping different letters makes a new word.

Here is the step-by-step count for the different rearrangements of BANANA\text{BANANA}:

Text solution
Scramble all 66 letters on topCount the 6!6! ways to arrange all 66 letters as if every letter were different.
6!\displaystyle 6! =6×5×4×3×2×1\displaystyle = 6 \times 5 \times 4 \times 3 \times 2 \times 1
Divide out the identical-letter scramblesDivide by 3!\scramble{3!} for the three identical A\text{A}'s and by 2!\scramble{2!} for the two identical N\text{N}'s that can swap places without changing the word.
6!3!×2!=6×5×4×3×2×1(3×2×1)×(2×1)=60\displaystyle \begin{aligned} \frac{6!}{\scramble{3!} \times \scramble{2!}} &= \frac{6 \times 5 \times 4 \times 3 \times 2 \times 1}{\scramble{(3 \times 2 \times 1)} \times \scramble{(2 \times 1)}} \\ &= 60 \end{aligned}
5

Committees: Multiply, Add, or Subtract

Now that we can count a single group using combinations, we want to form committees from a club of 6\tracked{6} men and 77 women (1313 people total) that combine multiple groups or follow rules like "either/or" and "at least one."

Committees: Multiply, Add, or Subtract
6 men\tracked{6\ \text{men}}
7 women7\ \text{women}
2 men\tracked{2\ \text{men}}
3 women3\ \text{women}

Depending on how the committee is described, we either multiply steps, add separate cases, or subtract the one unwanted case from the total:

Text solution
Two men AND three women (multiply steps)Fill one slot for the group of 2\tracked{2} men and a second slot for the group of 33 women, then multiply because every pair of men can be matched with every group of 33 women.
(62)⏟2 men×(73)⏟3 women=6×52×1×7×6×53×2×1=15×35=525\displaystyle \begin{aligned} &\tracked{\underbrace{\binom{6}{2}}_{\text{2 men}}} \times \underbrace{\binom{7}{3}}_{\text{3 women}} \\ &= \frac{\tracked{6 \times 5}}{\scramble{2 \times 1}} \times \frac{7 \times 6 \times 5}{\scramble{3 \times 2 \times 1}} \\ &= \tracked{15} \times 35 = 525 \end{aligned}
Two men OR two women (add separate cases)Count the 22-man committees and the 22-woman committees separately, then add them because a single 22-person committee cannot be both at once.
(62)⏟all men+(72)⏟all women\displaystyle \tracked{\underbrace{\binom{6}{2}}_{\text{all men}}} + \underbrace{\binom{7}{2}}_{\text{all women}} =15+21\displaystyle = \tracked{15} + 21 =36\displaystyle = 36
Four people with AT LEAST ONE woman (subtract the "none" case)Count all possible 44-person committees from the 1313 people, then subtract the unwanted committees with 00 women (where all 44 are chosen from the 6\tracked{6} men).
(134)⏟total−(64)⏟0 women\displaystyle \total{\underbrace{\binom{13}{4}}_{\text{total}}} - \tracked{\underbrace{\binom{6}{4}}_{\text{0 women}}} =715−15\displaystyle = \total{715} - \tracked{15} =700\displaystyle = 700
6

Restrictions, Boxes, and Gaps

Finally, we want to count arrangements that put a special rule on certain slots, like forming a 44-digit even number from {1,2,3,4,5}\{1, 2, 3, 4, 5\} without repeats, or lining up 55 friends (A,B,C,D,E\text{A}, \text{B}, \text{C}, \text{D}, \text{E}) in 55 chairs when certain friends must sit right next to each other or cannot sit next to each other.

Restrictions, Boxes, and Gaps
{1,2,3,4,5}\{1, 2, 3, 4, 5\}
no repeats\text{no repeats}
even\restricted{\text{even}}
A,B together\tracked{\text{A}}, \tracked{\text{B}}\ \text{together}
2!\together{2!}
A\tracked{\text{A}}
B\tracked{\text{B}}
C\text{C}
D\text{D}
E\text{E}
4 units4\ \text{units}
A,B,C apart\tracked{\text{A}}, \tracked{\text{B}}, \tracked{\text{C}}\ \text{apart}
A\tracked{\text{A}}
B\tracked{\text{B}}
C\tracked{\text{C}}
D\text{D}
E\text{E}

Seating D\text{D} and E\text{E} first as buffers leaves a buffer person between every pair of gaps, so putting at most one of A,B,\tracked{\text{A}}, \tracked{\text{B}}, and C\tracked{\text{C}} into each gap keeps all of them apart.

Because Charlie, David, and Eve separate the gaps around them, putting Alice and Bob into two different gaps guarantees someone will sit between them when the empty gaps close up.

Here are the steps for each type of restriction:

Text solution
Four-digit even number from {1,2,3,4,5}\{1, 2, 3, 4, 5\} (fill the restricted slot first)Put one of the 2\restricted{2} even digits (2\restricted{2} or 4\restricted{4}) into the last slot first, then fill the remaining three slots from the 44 leftover digits.
4×3×2×2⏟even\displaystyle 4 \times 3 \times 2 \times \restricted{\underbrace{2}_{\text{even}}} =48\displaystyle = 48
Alice and Bob must sit together (box method)Put A\tracked{\text{A}} and B\tracked{\text{B}} in one box so you are arranging 44 units ([AB],C,D,E\together{\text{[AB]}}, \text{C}, \text{D}, \text{E}) in 4!4! ways, then multiply by the 2!\together{2!} ways A\tracked{\text{A}} and B\tracked{\text{B}} can swap seats inside their box.
4!⏟4 units×2!⏟inside box\displaystyle \underbrace{4!}_{\text{4 units}} \times \together{\underbrace{2!}_{\text{inside box}}} =24×2\displaystyle = 24 \times \together{2} =48\displaystyle = 48
Only two people (A\tracked{\text{A}} and B\tracked{\text{B}}) must stay apart (subtract "together" from total)Out of all 5!=120\total{5!} = \total{120} lineups, A\tracked{\text{A}} and B\tracked{\text{B}} are either together or apart, so subtract the 48\together{48} "together" lineups from the total.
120⏟total−48⏟together\displaystyle \total{\underbrace{120}_{\text{total}}} - \together{\underbrace{48}_{\text{together}}} =72\displaystyle = 72
Three people (A,B,C\tracked{\text{A}}, \tracked{\text{B}}, \tracked{\text{C}}) must all stay apart (gaps method)Seat the buffer people (D\text{D} and E\text{E}) first in 2!2! ways to create 3\tracked{3} separated gaps (A‾ D B‾ E C‾\tracked{\underline{\phantom{A}}}\,\text{D}\,\tracked{\underline{\phantom{B}}}\,\text{E}\,\tracked{\underline{\phantom{C}}}), then place A,B,\tracked{\text{A}}, \tracked{\text{B}}, and C\tracked{\text{C}} into the 3\tracked{3} gaps in 3×2×1\tracked{3 \times 2 \times 1} ways.
2!⏟buffers×(3×2×1)⏟gaps\displaystyle \underbrace{2!}_{\text{buffers}} \times \tracked{\underbrace{(3 \times 2 \times 1)}_{\text{gaps}}} =2×6\displaystyle = 2 \times \tracked{6} =12\displaystyle = 12

Key concepts

In these counting problems, draw slots for the decisions and ask whether the roles have different labels or restrictions:

Labeled slots (order matters)

When choosing distinct items without repetition, count down one slot at a time and multiply. Do not divide by k!\scramble{k!} when the slots have different roles like Gold, Silver, and Bronze (10×9×8=72010 \times 9 \times 8 = 720 is already finished).

Unlabeled slots (combinations)

When picking a group of kk from nn where order doesn't matter, put kk slots on top starting from nn and divide by k!\scramble{k!} on the bottom to remove the scrambles:

(nk)=n!k!(n−k)!(83)=8×7×63×2×1=56\displaystyle \begin{aligned} \binom{n}{k} &= \frac{n!}{\scramble{k!}(n - k)!} \\ \binom{8}{3} &= \frac{8 \times 7 \times 6}{\scramble{3 \times 2 \times 1}} = 56 \end{aligned}

Repeated letters

Start with the factorial of all letters on top, and divide by the factorial of each repeated letter on the bottom (BANANA→6!3!×2!=60\text{BANANA} \rightarrow \frac{6!}{\scramble{3!} \times \scramble{2!}} = 60).

Combining steps vs. cases

  • AND →\rightarrow Multiply step counts when each earlier choice gives the same number of options at the next step ((62)×(73)\tracked{\binom{6}{2}} \times \binom{7}{3} for 2\tracked{2} men and 33 women).
  • OR →\rightarrow Add separate cases that cannot happen together ((62)+(72)\tracked{\binom{6}{2}} + \binom{7}{2} for 2\tracked{2} men or 22 women).
  • AT LEAST ONE →\rightarrow Subtract the "none" case from the total, keeping any other restrictions in both counts ((134)−(64)\total{\binom{13}{4}} - \tracked{\binom{6}{4}}).
Slot restrictions, boxes, and gaps

  • Restricted slot: Consider filling a restricted slot first (4×3×2×2⏟even=484 \times 3 \times 2 \times \restricted{\underbrace{2}_{\text{even}}} = 48).
  • Must stay together: Put them in a single box, arrange the units, and multiply by the scrambles inside the box (4!×2!=484! \times \together{2!} = 48).
  • Must stay apart: For 22 people who cannot sit together, subtract the "together" count from the total (120−48=72\total{120} - \together{48} = 72). If no two of 33 people may sit next to each other, subtracting "all three together" is not enough (120−36\total{120} - \together{36} still leaves pairs sitting next to each other); instead, seat the other people first and place the 33 into separate gaps (2!×(3×2×1)=122! \times \tracked{(3 \times 2 \times 1)} = 12).
7

Practice

1

A lunch special lets you choose 1 of 4 soups, 1 of 5 sandwiches, and 1 of 3 drinks. How many different lunch specials can you order?

Are you picking a soup, a sandwich, and a drink together to build one meal, or only one item total? Draw a slot for each decision.

We are filling three steps of a single meal (soup AND sandwich AND drink), so we draw 33 slots and multiply the choices. Do not add them (4+5+3=124 + 5 + 3 = 12 would count the ways to pick just one single item from the menu).
4×5×3\displaystyle 4 \times 5 \times 3 =60\displaystyle = 60
2

A club with 9 members is electing a President, a Vice President, and a Treasurer, with no member holding more than one office. In how many ways can the 3 offices be filled?

Do the 3 slots have different titles, or are they an unlabeled group of 3?

Draw 33 slots for President, Vice President, and Treasurer, and count down starting from 99. Because the three offices have different titles, stop after multiplying. Do not divide by 3!=6\scramble{3!} = \scramble{6} (which would give 8484, the count for an unlabeled 33-person committee).
9×8×7\displaystyle 9 \times 8 \times 7 =504\displaystyle = 504
3

An ice cream shop offers 10 flavors. How many different bowls of 3 different flavors can you order?

Once the 3 scoops are in the bowl, does the order you named them change the bowl?

Put 33 slots on top starting from 1010, then divide by 3!\scramble{3!} on the bottom because the 33 scoops sit in the same unlabeled bowl (forgetting to divide by 3!=6\scramble{3!} = \scramble{6} gives 10×9×8=72010 \times 9 \times 8 = 720, which counts every bowl 6\scramble{6} separate times).
(103)\displaystyle \binom{10}{3} =10×9×83×2×1\displaystyle = \frac{10 \times 9 \times 8}{\scramble{3 \times 2 \times 1}} =120\displaystyle = 120
4

How many different ways can the letters of the word SUCCESS be arranged?

Count the total number of letters first, then check which letters appear more than once.

There are 77 letters total, with three identical S\text{S}'s and two identical C\text{C}'s. Divide 7!7! by both 3!\scramble{3!} and 2!\scramble{2!} on the bottom (dividing by only 3!\scramble{3!} and missing the two C\text{C}'s gives 840840).
7!3!×2!=7×6×5×4×3×2×1(3×2×1)×(2×1)=420\displaystyle \begin{aligned} \frac{7!}{\scramble{3!} \times \scramble{2!}} &= \frac{7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1}{\scramble{(3 \times 2 \times 1)} \times \scramble{(2 \times 1)}} \\ &= 420 \end{aligned}
5

Using the digits {1,2,3,4,5,6}\{1, 2, 3, 4, 5, 6\} without repeating any digits, how many 4-digit odd numbers can be formed?

Which of the 4 slots decides whether the number is odd? Fill that slot first.

Fill the restricted last slot first using one of the 3\restricted{3} odd digits (1,3,\restricted{1}, \restricted{3}, or 5\restricted{5}). That leaves 55 digits available for the first slot, 44 for the second, and 33 for the third (going left to right as 6×5×46 \times 5 \times 4 first and then multiplying by 33 at the end gives 360360, ignoring that earlier slots could have already used up the odd digits).
5×4×3×3⏟odd\displaystyle 5 \times 4 \times 3 \times \restricted{\underbrace{3}_{\text{odd}}} =180\displaystyle = 180
6

An animal shelter has 5 dogs and 8 cats. In how many ways can a family adopt a group of 2 dogs and 3 cats?

You are choosing a group of 2 dogs AND a group of 3 cats. How do you count each group, and how do you combine the two steps?

Choose 2\tracked{2} dogs out of 5\tracked{5} in (52)\tracked{\binom{5}{2}} ways and 33 cats out of 88 in (83)\binom{8}{3} ways, then multiply the two steps together (adding them gives 10+56=66\tracked{10} + 56 = 66, which would count adopting either 22 dogs OR 33 cats, not both).
(52)×(83)=5×42×1×8×7×63×2×1=10×56=560\displaystyle \begin{aligned} \tracked{\binom{5}{2}} \times \binom{8}{3} &= \frac{\tracked{5 \times 4}}{\scramble{2 \times 1}} \times \frac{8 \times 7 \times 6}{\scramble{3 \times 2 \times 1}} \\ &= \tracked{10} \times 56 = 560 \end{aligned}
7

A reading list has 6 history books and 5 science books. In how many ways can you choose 3 books if all 3 must be on the same subject?

Can a single selection of 3 books be all history AND all science at the same time?

Split into two separate cases, 3\tracked{3} history books OR 33 science books, and add the two counts together (multiplying them gives 20×10=200\tracked{20} \times 10 = 200, which counts ways to pick 3\tracked{3} history books AND 33 science books for a 66-book stack).
(63)+(53)=6×5×43×2×1+5×4×33×2×1=20+10=30\displaystyle \begin{aligned} \tracked{\binom{6}{3}} + \binom{5}{3} &= \frac{\tracked{6 \times 5 \times 4}}{\scramble{3 \times 2 \times 1}} + \frac{5 \times 4 \times 3}{\scramble{3 \times 2 \times 1}} \\ &= \tracked{20} + 10 = 30 \end{aligned}
8

A club has 5 juniors and 6 seniors. How many 4-person committees can be formed that include at least 1 junior?

Out of all possible 4-person committees from the 11 members, what is the only case that has no juniors at all?

Count all possible 44-person committees from the 1111 members, then subtract the unwanted committees with 00 juniors, where all 44 members are chosen from the 66 seniors (picking 1\tracked{1} junior first in 5\tracked{5} ways and multiplying by (103)=120\binom{10}{3} = 120 gives 600600, which counts every committee with more than one junior multiple times).
(114)−(64)=11×10×9×84×3×2×1−6×5×4×34×3×2×1=330−15=315\displaystyle \begin{aligned} \total{\binom{11}{4}} - \binom{6}{4} &= \frac{\total{11 \times 10 \times 9 \times 8}}{\scramble{4 \times 3 \times 2 \times 1}} - \frac{6 \times 5 \times 4 \times 3}{\scramble{4 \times 3 \times 2 \times 1}} \\ &= \total{330} - 15 = 315 \end{aligned}
9

Six friends line up in 6 chairs for a photo. In how many ways can they sit if 3 specific friends insist on sitting right next to each other?

Put the 3 friends who must sit together into a single box first. How many total units are you arranging in a line now?

Arrange the 44 units (the box of 3\together{3} friends plus the 33 other friends) in 4!4! ways, then multiply by the 3!\together{3!} ways the 3\together{3} friends can scramble inside their box (forgetting to scramble inside the box leaves just 4!=244! = 24).
4!×3!\displaystyle 4! \times \together{3!} =24×6\displaystyle = 24 \times \together{6} =144\displaystyle = 144
10

Four adults and 3 children line up in 7 chairs for a photo. If no two children are allowed to sit next to each other, how many seating arrangements are possible?

Seat the 4 adults first as buffers. How many gap spaces do 4 seated adults create when you include the two ends?

Seat the 44 adults first in 4!4! ways, creating 5\tracked{5} separated gaps (C‾ A C‾ A C‾ A C‾ A C‾\tracked{\underline{\phantom{C}}}\,\text{A}\,\tracked{\underline{\phantom{C}}}\,\text{A}\,\tracked{\underline{\phantom{C}}}\,\text{A}\,\tracked{\underline{\phantom{C}}}\,\text{A}\,\tracked{\underline{\phantom{C}}}), then place the 3\tracked{3} children into those 5\tracked{5} gaps in 5×4×3\tracked{5 \times 4 \times 3} ways (do not simply subtract the "all 33 children together" cases, 7!−5!×3!=4,320\total{7!} - \together{5! \times 3!} = 4{,}320, which still leaves pairs of children sitting together; and don't forget the two end gaps, which would leave only 33 middle gaps and give 4!×3!=1444! \times 3! = 144).
4!×(5×4×3)\displaystyle 4! \times \tracked{(5 \times 4 \times 3)} =24×60\displaystyle = 24 \times \tracked{60} =1,440\displaystyle = 1{,}440