Combinatorics
Combinatorics is the study of enumeration and arrangement.
Counting Principles
Sum Rule
Given two mutually exclusive events, where the first event can occur in distinct ways and the second event in distinct ways, the total number of occurrences () for either event is . This extends to mutually exclusive events:
Examples
- There is theme parks and water parks in the area, the number choices to attending one of them only would be
Product Rule
Given two independent sequential events, where the first event has outcomes and the second has outcomes, the total number of compound outcomes () is . This extends to independent sequential choices:
Examples
- 4-digit PIN with options per digit yields combinations
- A 16-input AND gate with binary inputs has possible input
- Restaurant offers appetizers, entrees, desserts. There are distinct meal combinations
Arrangements
Permutations
A permutation is an ordered arrangement of distinct objects. Since objects choice cannot be repeated, the number of choice decrease by one every time a object is chosen in a permutation, therefore the total permutation of distinct objects is given by the factorial function:
When selecting number of objects from distinct objects, the number of choice for each selection therefore decreases by one similarly, but only down to the last position needed, therefore the permutation is:
Examples
- Number of ways you can put people in a queue from a class of people,
- runners distributed across gold/silver/bronze positions: arrangements
- 7 teams assigned to 7 distinct time slots: distinct schedules
Combinations
A combination is a selection of objects from distinct objects where order is irrelevant. Since the number of ways to permute the given selection is (), the combination () can multiply to obtain the permutation ():
Examples
- Number of ways you can put people in a group from a class of people,
- 5 members chosen from 20 candidates:
Arrangements of Non-Distinct Objects
Given a objects with types (type has quantity where ), the total permutation () according to the size of the finite set can be over the unique arrangements. Since the permutation () of objects in repetitive position gives the number of arrangements that leaves the arrangement of the whole trial unchanged, the distinct permutations () are given by the multinomial coefficient.
Examples
- Arranging "TRIGGER" (7 letters: T,R,I,G,G,E,R):
, , , others unique distinct sequences.
Non-negative Integer solutions
In a case where , , the possible number of solutions () can be thought of using the stars and bars method. This method imagine a number of bars as separations between each share of distributed to each , due to the discrete behavior of the separations, can be thought of as a number of stars. The total state the three bars are allowed in is therefore , therefore the possible number of solutions would be the combination of the bars, hence:
Examples
-
- There are stars : , bars to separate
- One possible state would be : , equal to
Wrap-up Questions
-
Question: How many 8-character passwords exist if they must contain at least one uppercase letter, one lowercase letter, one digit, and one symbol (from 10 symbols), with no repeated characters?
Answer
- Total permutations of 8 distinct characters from 62 options (26 uppercase, 26 lowercase, 10 digits, 10 symbols): .
- Subtract invalid cases using inclusion-exclusion:
-
Question: You have 10 books: 4 distinct mathematics books, 3 identical physics books, and 2 identical chemistry books. How many distinct ways can they be arranged on a shelf?
Answer
- Account for identical books: .
-
Question: From 10 people, select a committee of 5 with roles: president, vice-president, and 3 indistinct members. How many ways can this be done?
Answer
- Choose president and vice-president (ordered): .
- Choose 3 indistinct members from remaining: .
- Total: .
-
Question: 6 people queue for a bus, but 2 refuse to stand next to each other. How many valid permutations exist?
Answer
- Total permutations: .
- Subtract permutations where the two are adjacent: .
- Valid: .
-
Question: An exam has sections with questions each. How many ways can you choose questions if you must pick from each section?
Answer
- Use inclusion-exclusion: (Note: , ).
-
Question: Divide 10 students into two groups of 5, but Alice and Bob cannot be in the same group. How many unique arrangements can be made?
Answer
- Total ways to partition into unlabeled groups: .
- Subtract cases where Alice and Bob are together: (since fixes them together).
-
Question: How many 4-letter words can be formed from "MISSISSIPPI" with no repeated letters?
Answer
- Only 4 distinct letters (M,I,S,P) in the multiset. Impossible to form words with no repeats: .
-
Question: A pizza place offers 10 distinct toppings (6 meat, 4 vegetable). How many pizzas can be made with 3-5 toppings, including at least one meat and one vegetable?
Answer
- For toppings (): (exclude all-meat/all-vegetable).
- Sum: .
-
Question: A student must choose 4 courses from 7 morning and 5 afternoon offerings, with 1 morning and 2 afternoon courses. How many ways?
Answer
- Cases: (1 morning, 3 afternoon) or (2 morning, 2 afternoon).
- .
-
Question: A license plate has 3 distinct letters (A-Z) followed by 3 distinct digits (0-9). How many plates exist if the number formed by the digits is even?
Answer
- Letters: .
- Digits: Choose last digit (even: 0,2,4,6,8; 5 options), then arrange first two from remaining 9 digits: .
- Total: .
-
Question: A bag has 6 identical red, 4 identical blue, and 5 identical green marbles. How many distinct ways can you draw 4 marbles?
Answer
- Nonnegative integer solutions to : .
-
Question: How many 5-card poker hands contain at least one card from each suit?
Answer
- Choose suit with two cards: .
- Choose 2 cards from that suit: .
- Choose 1 card from each other suit: .
- Total: .
-
Question: Arrange 5 distinct math and 4 distinct history books on a shelf such that no two math books are adjacent.
Answer
- Arrange history books (creates 5 gaps): .
- Place math books in gaps (one per gap): .
- Total: .
-
Question: How many positive integers have digits summing to ?
Answer
- Represent numbers as 3-digit strings (allow leading zeros).
- Nonnegative solutions to with : (subtract cases where a digit 10).
-
Question: A family (parents, two children) and 3 friends are seated in a row. Parents must sit together, and children must be separated by at least one adult. How many arrangements?
Answer
- Treat parents as a block: internal arrangements.
- Total with parents together: .
- Subtract cases where children are adjacent (treat as a block): .
- Valid: .
-
Question: Assign 10 distinct gifts to 3 distinct children such that each gets 2 gifts.
Answer
- Total assignments: .
- Subtract cases where a child gets gifts (inclusion-exclusion):
-
Question: Pair 5 men and 5 women for a dance. Two men (A,B) refuse to dance with a particular woman (X). How many valid pairings?
Answer
- Total pairings: .
- Subtract pairings where A or B is paired with X: .
-
Question: How many distinct 4-digit numbers can be formed from 6 with each digit used times?
Answer
- Case 1 (all distinct): .
- Case 2 (one digit twice, two once): .
- Case 3 (two digits twice): .
- Total: .
-
Question: A coin is flipped 10 times. How many outcomes have between 3 and 5 heads (inclusive)?
Answer
- Sum: .
-
Question: A bakery has 8 types of donuts. How many ways to buy a dozen (12) if you must buy of each type?
Answer
- First take one of each type. Distribute remaining 4 donuts freely: .