Discrete MathematicsCounting: Choices, Arrangements and Selections6 of 7
Counting: Choices, Arrangements and Selections · 6
Counting by Bijection
Some sets are too tangled or constrained to count directly, so we pair their items one-to-one with a simpler set we already know how to count.
Counting by Bijection and the Reverse Test
1
Subsets as Binary Strings
First, we want to find the total number of subsets we can make from {A,B,C,D}, and more generally from a set of n items. Listing subsets by size forces us to add up separate cases from size 0 to size n because the subsets keep changing size, so instead we turn every subset into a fixed-length string of zeros and ones.
Subsets as Binary Strings
Text solution
Translate each subset into a 4-digit binary stringPut a slot under each of the 4 letters and write 1 if the letter is in the subset or 0 if it is out.
⟷subset {A,C}A1B0C1D0
Invert with the Reverse TestAny 4-digit string of 0s and 1s picks out the exact subset of letters that have a 1 under them.
0101⟷{B,D}
Count the slots by the product ruleEach of the 4 independent slots has 2 choices (0 or 1), and for n items each of the n slots has 2 choices.
2×2×2×2n slots2×2×⋯×2=24=16,=2n
So {A,B,C,D} has 16 subsets, and a set of n items has 2n subsets in total.
2
Pairing Two Sets Directly
We now know a set of n items has 2n subsets in total, and for n≥1 we want to find how many of those subsets have an even number of elements and how many have an odd number of elements. Rather than translating subsets into strings, we can pair the two collections with each other directly to show they have the exact same size.
Pairing Two Sets Directly
Text solution
Pair complements to see equal sizesJust as picking 3 of 10 people for a committee leaves behind a unique group of 7 people who stay home, a direct pairing shows two sets have the same count without a formula.
(310)=(710)
Flip one fixed element APick one item A from the n items, and put A in if it is absent or take A out if it is already present, which changes the subset's size by ±1 and turns every even subset into an odd subset.
flip A⟷Even subset {B,C}Odd subset {A,B,C}
Split the 2n subsets into two equal halvesFlipping A a second time returns the original subset, so even and odd subsets match one-to-one and divide the total count in half.
22n=2n−1
So a set of n items has 2n−1 subsets of even size and 2n−1 subsets of odd size.
3
Grid Paths as Words
Now let's count paths on a grid: on a city grid that is 4 blocks wide and 3 blocks tall, we want to find the number of paths from the bottom-left corner to the top-right corner using only Right (R) and Up (U) steps.
Grid Paths as Words
Text solution
Write each path as a 7-letter wordEvery valid path to the top-right corner must move 4 blocks right and 3 blocks up in some order, which translates into a 7-letter word made of four R's and three U's.
⟷Path on 4×3 gridRRURURU(4R’s,3U’s)
Choose which 3 of the 7 slots get a UAny 7-letter word with four R's and three U's traces a unique path on the grid, and placing the three U's automatically puts the four R's into the remaining slots.
(37)=3×2×17×6×5=35
So there are 35 valid paths from the bottom-left corner to the top-right corner of the 4-by-3 grid.
Every valid path from the bottom-left corner to the top-right corner uses the exact same four R's and three U's, so choosing which 3 of the 7 step slots get a U locks in the entire path on the grid.
Every path across the 4-by-3 grid uses the same four R's and three U's, so picking which 3 of the 7 slots get a U sets the whole path.
4
Squeezing Out Mandatory Spacers
Next, suppose we have 10 chairs in a row and want to find the number of ways to choose 4 chairs so that no two chosen chairs sit right next to each other. We cannot count the choices one chair at a time because a chair at the end of the row blocks only one neighbor while a chair in the middle blocks two, so we build a bijection that removes the spacing rule.
Squeezing Out Mandatory Spacers
Text solution
Squeeze out the 3 mandatory empty spacersBecause at least 1 empty chair must sit right after each of the first 3 chosen chairs (X), removing those 3 mandatory spacer chairs shrinks the arrangement to 7 chairs with no spacing rules.
Put the spacers back in (Reverse Test)Taking any 4 chair positions c1<c2<c3<c4 in the 7-chair row and inserting 1 empty chair after each of the first three shifts their seat numbers so they are guaranteed to be at least 2 apart in the 10-chair row.
⟷c1<c2<c3<c4c1,c2+1,c3+2,c4+3
Choose 4 chairs freely from the 7-chair rowEvery free choice of 4 chairs out of 7 matches a unique spaced-out choice in the 10-chair row.
(47)=4×3×2×17×6×5×4=35
So there are 35 ways to choose 4 non-adjacent chairs from a row of 10.
Even when chosen chairs sit side by side in the 7-chair row, inserting the 3 spacer chairs always pushes them at least one empty chair apart in the 10-chair row.
Putting one empty spacer chair after each of the first three chosen chairs turns any 7-chair choice with no spacing rule into its own spaced-out 10-chair choice.
5
Hidden Pairings in Tournaments and Circles
Sometimes the easy set isn't a binary string or a row of slots at all, but another collection of objects hiding inside the same problem. First, we want to find the total number of matches played in a 137-player single-elimination tournament with any setup of byes; second, we want to find the number of interior crossing points formed when 6 dots around a circle are all connected by straight chords with no three chords meeting at the same interior point.
Hidden Pairings in Tournaments and Circles
Text solution
Tournament: Pair each match with the player it eliminatesEvery match produces 1 loser, and every player except the 1 undefeated champion loses exactly once.
Matches played=Losers=137−1=136
So 136 matches are played in the tournament, regardless of how the bracket and byes are set up.
Circle chords: Pair each interior crossing with its 4 boundary endpointsTracing the 2 crossing lines out to the edge gives 4 boundary dots, and any 4 boundary dots can be joined to cross inside the circle in only one way (their single pair of diagonals).
Interior crossings for n dots=(4n)
Evaluate for 6 boundary dotsCount the 4-dot subsets chosen from the 6 dots around the circle.
(46)=4×3×2×16×5×4×3=15
So the chords between 6 dots on a circle create 15 interior crossing points.
Any 4 dots on the boundary of the circle have only one pair of diagonals that cross on the inside, so 4-dot boundary subsets and interior crossings match one-to-one.
Every subset of 4 dots on the circle has only one pair of crossing diagonals, matching the interior crossings one-to-one.
Key concepts
When a counting problem already asks for a free choice of k items from n (like choosing any 4 chairs out of 10 in (410) ways) or a fixed sequence of independent slots, count it directly with combinations or the product rule. You don't need a new bijection. Bring in a bijection when changing sizes, even-or-odd rules, spacing gaps, or tangled geometry block a direct count, and always verify your rule with the Reverse Test by checking that every item on the easy side reconstructs one and only one valid item on the hard side.
If the groups you are counting change size, turn them into a fixed row of yes-or-no slots: subsets of n items match n-digit binary strings ({A,C}↔1010 in {A,B,C,D}), giving 2n subsets in total. To show two halves of a collection have the exact same size without listing cases, pair them directly by flipping one fixed element A in or out ({B,C}↔{A,B,C}), which splits the 2n subsets into 2n−1 even subsets and 2n−1 odd subsets. When counting paths on a grid, translate the path into a step word: walking 4 blocks right and 3 blocks up is a 7-letter word of four R's and three U's, counted by choosing the U slots in (37)=35 ways. When a spacing rule forces empty spacers between chosen items in a row, squeeze out the mandatory spacers after every chosen item except the last one (removing 3 spacer chairs from 10 to pick 4 chairs freely from 7 in (47)=35 ways). Finally, when neither strings nor rows fit, ask what inside the problem uniquely locks in one object: each match in a 137-player single-elimination tournament is locked in by the unique loser it knocks out (137−1=136 matches), and each interior chord crossing in a circle of n dots is locked in by its 4 boundary endpoints ((4n) crossings).
6
Practice
1
Let S={1,2,3,4,5,6,7,8}. Using the bijection between subsets of S and 8-digit binary strings, how many subsets of S contain both 1 and 2, but do not contain 8?
Watch out not to treat the excluded 8 as a free slot, which would leave 8−2=6 slots and give the wrong answer 26=64.
In the 8 yes-or-no slots for the elements of S, which slots are already locked in and how many slots still have a free choice?
In the 8-digit binary string, the slots for 1 and 2 are locked as 1 and the slot for 8 is locked as 0. Watch out not to treat the excluded 8 as a free slot, which would leave 8−2=6 slots and give the wrong answer 26=64. That leaves 8−3=5 free slots with 2 choices each, giving 25=32.
2
A club has 10 members, including Alice and Bob. How many subsets of the club's members contain an odd number of people and do not include Alice?
Since Bob still counts as one of the 9 free members before flipping, don't subtract him twice to get 27=128.
First lock Alice out of the group. How many members are left to form subsets, and whose status can you flip to pair the even and odd subsets among them?
Locking Alice out leaves the other 9 members, who form 29=512 subsets in total (do not start from all 10 members to get 210−1=512, because Alice's slot is fixed at 0). Flipping whether Bob is in or out pairs every even subset with a unique odd subset without ever adding Alice. Since Bob still counts as one of the 9 free members before flipping, don't subtract him twice to get 27=128. This splits the 512 subsets into two equal halves of size 2512=28=256.
3
On a city grid that is 6 blocks wide and 5 blocks tall, you walk from the bottom-left corner (0,0) to the top-right corner (6,5) taking only Right (R) and Up (U) steps. How many paths pass through the intersection at (2,3)?
Since a full path chooses the first stage and the second stage, multiply the counts rather than adding 10+15=25.
Break the walk into two stages, from (0,0) to (2,3) and then from (2,3) to (6,5), and write the step word for each stage.
Walking from (0,0) to (2,3) translates into a 5-letter word with 2R's and 3U's ((25)=10 choices), and walking the remaining blocks from (2,3) to (6,5) translates into a 6-letter word with 6−2=4R's and 5−3=2U's ((26)=15 choices). Since a full path chooses the first stage and the second stage, multiply the counts rather than adding 10+15=25:10×15=150.
4
A street has 15 streetlights in a row. The city wants to turn off 4 of them to save power, but for safety there must be at least 2 working streetlights between any two turned-off streetlights. In how many ways can the 4 streetlights be chosen?
The 4th turned-off light is the last one and needs no spacers after it, so remove 3×2=6 lights rather than 4×2=8 (which would leave 7 lights and give (47)=35).
Right after each of the first 3 turned-off streetlights, how many working streetlights are forced to act as spacers?
Squeeze out the 2 mandatory working-light spacers right after each of the first 3 turned-off lights. The 4th turned-off light is the last one and needs no spacers after it, so remove 3×2=6 lights rather than 4×2=8 (which would leave 7 lights and give (47)=35). That leaves a free choice of 4 lights out of 15−6=9, which gives (49)=126.
5
200 players enter a single-elimination qualifying tournament with any setup of byes. Play stops as soon as only 16 undefeated players remain to advance to the finals. How many matches are played in the qualifying tournament?
Because play stops when 16 undefeated players remain, subtract all 16 advancing players rather than just 1 champion (which would give 200−1=199).
If you pair every qualifying match with the unique player it eliminates, how many of the 200 players never lose a match during qualifying?
Pairing each match with the unique player it eliminates matches the total qualifying games played to the number of eliminated players. Because play stops when 16 undefeated players remain, subtract all 16 advancing players rather than just 1 champion (which would give 200−1=199), leaving 200−16=184.
6
10 dots are placed around a circle so that no three chords cross at the same interior point, and every pair of dots is connected by a chord. Given one specific dot P on the circle, how many interior crossing points lie on a chord that has P as an endpoint?
Since P already fills 1 of those 4 endpoint spots, choose the other 3 boundary dots from the remaining 9 dots (do not choose 4 from 9 to get (49)=126).
Every interior crossing is locked in by 4 boundary dots. If the crossing lies on a chord from P, what must be true about those 4 dots?
An interior crossing point lies on a chord from P if and only if P is one of the 4 boundary dots whose diagonals form that crossing. Since P already fills 1 of those 4 endpoint spots, choose the other 3 boundary dots from the remaining 9 dots (do not choose 4 from 9 to get (49)=126), which gives (39)=84.