Discrete MathematicsCounting: Choices, Arrangements and Selections2 of 7
Counting: Choices, Arrangements and Selections · 2
Permutations and Factorials
When we count choices across a row of slots where repetition is allowed, like a 4-digit PIN that can reuse any of the 10 digits in every spot (10×10×10×10=104), the pool of options stays the same at every step. Now we want to count how many ways we can line up distinct items when we cannot repeat them.
1
Arranging All n Items in a Line
We want to find the number of different orders for lining up a whole collection of distinct items, such as placing 3 different books on a shelf.
Permutations and Factorials
Text solution
Fill the slots from left to right as the pool shrinksOnce you place a book in the first slot, it is no longer available for the remaining slots, so the number of choices drops by 1 each step:
1st slot3×2nd slot2×3rd slot1=6 ways
So there are 6 different orders to line up the 3 books.
For any positive whole number n, the product of all whole numbers from n down to 1 is written with an exclamation mark and read as "n factorial":
n factorialn!0!=n×(n−1)×(n−2)×⋯×1=1(one way to leave an empty shelf)
2
Lining Up k Items Out of n
Now suppose we have more items than slots: we want to choose and order k items out of n distinct items, where the order of the lineup matters (a permutation).
Lining Up k Items Out of n
Text solution
Multiply down for only as many slots as you haveWith 10 books and a shelf that only holds 3, the multiplication stops after the third slot because the other 7 books stay in the box:
1st slot10×2nd slot9×3rd slot8=720 ways
Write the same product as a ratio of factorialsDividing the full 10! by the 7! ways to arrange the 7 unpicked books cancels the unused tail from 7 down to 1:
So there are 720 ways to line up 3 books out of 10.
In factorial notation, the number of permutations of k items chosen from n distinct items is:
P(n,k)=leftover items(n−k)!n!
With numbers, drawing k slots and multiplying down k steps is faster than writing out the fraction; save the factorial formula for algebra with variables.
In this lineup of 10 books, the slots on the shelf give the factors at the front of 10!, while the unpicked books in the box give the (10−k)! tail that cancels out of (10−k)!10!.
Stopping the multiplication after the slots on the shelf leaves the exact same factors as dividing the full factorial by the factorial of the leftover books in the box.
3
Algebra with Factorials
Sometimes we know the total count or have a fraction containing n! and need to simplify the expression or solve for n. Because a factorial is a product counting down by 1 at each step, we can pull factors off the front and leave the rest as a smaller factorial:
n!=n×(n−1)!=n×(n−1)×(n−2)!
Algebra with Factorials
(n−1)!(n+1)!=?
P(n,2)3×n!=56=360nn=?=?
Text solution
Expand the larger factorial until its tail matches the smaller factorialIn (n−1)!(n+1)!,(n+1) is larger than (n−1), so pull factors off (n+1)! one step at a time until (n−1)! appears and cancels:
(n−1)!(n+1)!=(n−1)!(n+1)×n×(n−1)!=(n+1)n
Turn P(n,k) into slots to solve for nFor P(n,2)=56, filling 2 slots starting from n gives the product of two consecutive whole numbers:
n(n−1)8×7=56=56⟹n=8
Isolate a single factorial before evaluatingFor 3×n!=360, divide by 3 first rather than expanding n!:
n!5!=120=120⟹n=5
Each factor pulled off the front of (n+1)! steps the remaining factorial down by 1, and as soon as that tail reaches (n−1)!, it cancels the denominator completely.
Unrolling the factorial on top from the front exposes the smaller factorial inside it, which cancels the one in the denominator.
4
Positional Restrictions: Picky Slots First
Now we want to count lineups when certain positions have rules about who or what is allowed in them.
Positional Restrictions: Picky Slots First
Text solution
Fill the restricted slot before the unrestricted onesWhen 5 friends line up and only Alice or Bob can stand in the fifth slot on the far right, fill that picky fifth slot first (2 choices), which leaves 4 people for the other 4 slots:
4×3×2×1×picked 1st2=48 ways
Watch for hidden restrictions like a leading zeroTo make a 4-digit number from the 6 tiles 0,1,2,3,4,5 without repetition, the first slot cannot be 0(5 choices), and then 0 goes back into the pool of unused digits for the second slot (5 choices):
no 05×0 back in5×4×3=300 four-digit numbers
If you fill the first four slots from left to right, the number of choices left for the fifth slot is 1 or 0, depending on whether you already placed one or both of Alice and Bob. Filling the fifth slot first keeps it at 2 choices every time.
Fill the restricted slot first so your earlier choices don't change how many options it has left.
5
Keeping Items Together: The Glue Method
What if a restriction doesn't fix items to a specific spot, but requires a group of items to stay right next to each other anywhere in the line?
Keeping Items Together: The Glue Method
Text solution
Glue the grouped items into one block and count the outside arrangementsWhen Alice and Bob must stand together among 5 friends, box them into [AB] so you are arranging 4 outside objects ([AB],C,D,E):
Outside arrangements=4!=24
Multiply by the arrangements inside the boxFor every outside lineup, Alice and Bob can stand as [AB] or [BA] inside their box (2! ways):
outside4!×inside2!=24×2=48 ways
Putting k friends in a box turns them into a single block to arrange with the remaining friends outside, and each outside lineup has k! ways to order the friends inside the box.
Interactive c4
Key concepts
Counting arrangements without repetition always comes back to tracking how many choices are available as you fill slots one by one:
Check whether repetition is allowed first
If items can be reused, the pool never shrinks (a 4-digit PIN from 10 digits is 104). Only use factorials and shrinking slots when each item can be used at most once.
All n items vs. k items out of n
Lining up all n distinct items takes n slots and multiplies all the way down to 1, giving n! (with 0!=1). Lining up only k items out of n stops after k slots (3 books out of 10 gives 10×9×8), which in factorial form is P(n,k)=(n−k)!n!.
Factorial algebra
If factorials with variables sit in a fraction like (n−1)!(n+1)!, expand the larger factorial from the front until its tail cancels the smaller one: (n+1)n. If a single n! is multiplied by a number like 3×n!=360, don't expand it: divide by 3 to isolate n!=120 first.
Restrictions on positions vs. neighbors
If a rule restricts where someone can go, fill the picky slot first (4-digit numbers from 0–5: fill the non-zero first digit before putting 0 back in the pool, giving 5×5×4×3). If a rule restricts who stays together, glue the group into one block and multiply outside arrangements by inside arrangements (2 friends glued among 5 gives 4!×2!).
6
Practice
1
Six different paintings are to be hung in a single row along a gallery wall. In how many different orders can all six paintings be hung?
Watch out: don't keep all 6 choices in every slot to get 66=46,656, because once a painting is on the wall it cannot be hung again.Watch out: multiply the slot choices rather than adding them to get 21.
Draw 6 slots for the 6 spots on the wall and see how many paintings remain available as you move from left to right.
Filling the 6 slots without repeating a painting shrinks the pool by 1 each time:
6!=6×5×4×3×2×1=720
(Watch out: don't keep all 6 choices in every slot to get 66=46,656, because once a painting is on the wall it cannot be hung again; and multiply the slot choices rather than adding them to get 21.)
Total: 720.
2
A race has 12 runners and no ties are possible. In how many different ways can gold, silver, and bronze medals be awarded to 1st, 2nd, and 3rd place?
Watch out: don't keep multiplying all the way down to 1 to get 12!=479,001,600, because the 9 runners who don't win a medal don't have slots.
How many medal slots are you filling out of the 12 runners?
Draw 3 slots for gold, silver, and bronze, and multiply down for those 3 spots only:
12×11×10=1,320
(Watch out: don't keep multiplying all the way down to 1 to get 12!=479,001,600, because the 9 runners who don't win a medal don't have slots.)
Total: 1,320.
3
Write P(6,6) as a fraction of factorials using P(n,k)=(n−k)!n!, and evaluate it using the definition of 0!.
Substitute n=6 and k=6 into the fraction and remember how many ways there are to arrange zero leftover items.
Substituting n=6 and k=6 leaves 0! in the denominator:
P(6,6)=(6−6)!6!=0!6!
Using 6!=720 and 0!=1 (not 0, which would make the fraction 0720 undefined):
1720=720
4
Simplify the factorial fraction (n−1)!(n+2)!.
Watch out: don't stop one step early at (n+2)(n+1) by skipping the factor of n between n+1 and n−1.
Which factorial is larger? Pull factors off its front one by one until the remaining tail matches the denominator.
Expand (n+2)! three steps down until you reach (n−1)!:
(Watch out: don't stop one step early at (n+2)(n+1) by skipping the factor of n between n+1 and n−1.)
Result: (n+2)(n+1)n.
5
Solve for n:4×n!=2,880.
Isolate n! on one side before trying to figure out what n is.
Divide both sides by 4 first (don't multiply the 4 inside the factorial to write (4n)!=2,880):
n!=42,880=720
Since 6!=720, we get:
n=6
6
Solve for n:P(n,2)=90.
Since 10×9=90,n is the larger starting number (watch out for picking the second factor 9 instead of 10).
Write P(n,2) as the product of 2 slots starting at n.
Filling two slots gives the product of two consecutive whole numbers:
n(n−1)=90
Since 10×9=90,n is the larger starting number (watch out for picking the second factor 9 instead of 10):
n=10
7
Seven performers, 3 comedians and 4 musicians, are scheduled to perform one after another. If the show must both open and close with a comedian, how many different lineups are possible?
The third unused comedian joins the 4 musicians, leaving 5 performers for the 5 middle slots (watch out for only arranging the 4 musicians in the middle to get 3×2×4!=144).
Fill the opening and closing slots first, then count how many total performers are left for the middle slots.
Fill the two picky slots first: 3 choices for the opening comedian and 2 choices for the closing comedian. The third unused comedian joins the 4 musicians, leaving 5 performers for the 5 middle slots (5!=120 ways; watch out for only arranging the 4 musicians in the middle to get 3×2×4!=144):
3×2×5!=3×2×120=720
8
Using the digit tiles 0,1,2,3,4,5,6 without repeating any digits, how many 4-digit odd numbers can you make?
Put 0 back in the pool for the middle two slots: forgetting to put 0 back in for the second slot gives 5×4×3×3=180.Fill the pickiest last slot first: filling the first slot before the last slot gives 6×5×4×3=360.
Both the last slot (odd) and the first slot (non-zero) are picky. Fill the last slot first so you know how many non-zero digits remain for the first slot.
Fill the pickiest last slot first with an odd digit (1,3, or 5, giving 3 choices). Next, fill the picky first slot, which cannot be 0 and cannot be the odd digit just used (5 choices left out of 7). Then put 0 back in the pool for the middle two slots, giving 5 choices and 4 choices (forgetting to put 0 back in for the second slot gives 5×4×3×3=180, and filling the first slot before the last slot gives 6×5×4×3=360):
5×5×4×3=300
9
Six friends (Alice, Bob, Charlie, David, Eve, and Frank) sit in a row of 6 seats. If Alice, Bob, and Charlie must sit together in three consecutive seats, how many seating arrangements are possible?
Multiply by the 3!=6 ways Alice, Bob, and Charlie can be ordered inside their block (watch out for leaving off the inside orders to get 24).Multiply by the 3!=6 ways Alice, Bob, and Charlie can be ordered inside their block (watch out for multiplying by 3 instead of 3! to get 72).
Glue Alice, Bob, and Charlie into a single block and count how many outside objects you have to arrange.
Glue Alice, Bob, and Charlie into one block [ABC], giving 4 outside objects ([ABC],D,E,F) that can be arranged in 4!=24 ways. Then multiply by the 3!=6 ways Alice, Bob, and Charlie can be ordered inside their block (watch out for leaving off the inside orders to get 24, or multiplying by 3 instead of 3! to get 72):
4!×3!=24×6=144
10
A shelf holds 8 distinct books: 4 mystery novels, 3 biographies, and 1 dictionary. If all 4 mystery novels must stay together and all 3 biographies must stay together, how many ways can the 8 books be arranged on the shelf?
The mystery block, the biography block, and the dictionary form 3 outside objects (leaving out the dictionary and using 2! gives 288).The mystery block, the biography block, and the dictionary form 3 outside objects, which can be ordered in 3!=6 ways (forgetting to arrange the outside objects altogether gives 4!×3!=144).
Make one glued block for the mysteries and a second glued block for the biographies, and don't forget the dictionary when counting outside objects.
The mystery block, the biography block, and the dictionary form 3 outside objects, which can be ordered in 3!=6 ways (leaving out the dictionary and using 2! gives 288, and forgetting to arrange the outside objects altogether gives 4!×3!=144). Multiply by 4!=24 ways to order the mysteries inside their block and 3!=6 ways to order the biographies inside theirs: