Welcome to the Bijection Principle!

In H3 Mathematics, counting can sometimes feel like trying to count a swarm of bees—everything is moving, and it’s easy to lose track. The Bijection Principle is your secret weapon. Instead of counting the "hard" thing directly, we find a "twin" problem that is much easier to count and show that they have the exact same number of outcomes. This is the heart of combinatorial reasoning!

Don't worry if this seems a bit abstract at first. We are going to focus on one of its most famous applications: Stars and Bars. By the end of these notes, you’ll be able to distribute identical items into different boxes like a pro.

1. What exactly is a "Bijection"?

Imagine you are at a wedding. You want to know if there are exactly as many chairs as there are guests. You could count every guest and then count every chair, but that’s a lot of work. Instead, you just wait for everyone to sit down. If every guest has exactly one chair and no chairs are empty, you have a bijection.

In math, a bijection is a rule that pairs every element of Set A with exactly one element of Set B, with nothing left over. Because they are perfectly paired, we know that:
Size of Set A = Size of Set B

The Bijection Principle says: To count Set A, find a Set B that is easier to count and establish a bijection between them.

Quick Review: Prerequisite Concepts

Before we move on, let's clarify two terms that often trip students up:
• Indistinguishable (Identical) Objects: Like 10 identical gold coins. If you swap two coins, nothing changes.
• Distinguishable (Distinct) Boxes: Like 3 different people (Alice, Bob, and Charlie). It matters who gets which coin!

2. The Stars and Bars Method

This is the most common way we apply the Bijection Principle in H3. We use it to solve this specific problem: How many ways can we distribute \(n\) indistinguishable objects into \(r\) distinguishable boxes?

The Analogy: The Candy Shop

Imagine you have 7 identical lollipops (the Stars) to give to 3 different children (the Bars).
To separate the lollipops into 3 groups, we don't need 3 dividers; we only need 2 dividers.
If we place the dividers like this: \(* * | * * * | * *\), it means:
• Child 1 gets 2 lollipops.
• Child 2 gets 3 lollipops.
• Child 3 gets 2 lollipops.

Did you know? The number of "Bars" (dividers) is always one less than the number of boxes. If you have \(r\) boxes, you need \(r - 1\) bars.

3. Case 1: Boxes Can Be Empty (\(x_i \ge 0\))

If we are allowed to give a child zero lollipops, the dividers and lollipops can be in any order.
Example: \(| * * * * * * * |\) means Child 2 gets all 7, while Child 1 and 3 get zero.

Step-by-Step Calculation

1. Identify the number of objects: \(n\) (Stars).
2. Identify the number of boxes: \(r\).
3. Calculate the number of dividers needed: \(r - 1\) (Bars).
4. Find the total number of items to arrange: \(n + (r - 1)\).
5. The Formula: We choose the positions for the bars from the total positions:
\( \binom{n+r-1}{r-1} \) or \( \binom{n+r-1}{n} \)

Example: Distribute 10 identical marbles into 4 different bags.
• \(n = 10\)
• \(r = 4\), so Bars = \(4 - 1 = 3\)
• Total positions = \(10 + 3 = 13\)
• Ways = \( \binom{13}{3} = \frac{13 \times 12 \times 11}{3 \times 2 \times 1} = 286 \)

Key Takeaway: When objects are identical and boxes are distinct, think "Stars and Bars" and remember that \(r\) boxes only need \(r-1\) dividers!

4. Case 2: Each Box Must Have At Least One (\(x_i \ge 1\))

Sometimes the problem says "each box must be non-empty." This is actually easier!
If we have 7 lollipops and 3 children, and everyone must get at least one, we can use a simple trick.

The "Pre-delivery" Trick

1. Give one lollipop to each child first.
2. Now you have \(n - r\) lollipops left to distribute freely.
3. Use the Case 1 formula with the remaining lollipops.

Alternative Logic (The Gaps Method):
Imagine the 7 stars in a row: \(* \_ * \_ * \_ * \_ * \_ * \_ *\)
There are 6 gaps between them. To create 3 groups, we just need to pick 2 gaps to place our bars.
The Formula: \( \binom{n-1}{r-1} \)

Example: Find the number of positive integer solutions to \(x_1 + x_2 + x_3 = 10\).
• Here, \(n = 10\) and \(r = 3\).
• Since they are positive integers, \(x_i \ge 1\).
• Ways = \( \binom{10-1}{3-1} = \binom{9}{2} = 36 \).

5. Common Mistakes to Avoid

• Mixing up \(n\) and \(r\): Always ask yourself: "What is being divided (stars)?" and "Who/What is receiving them (boxes)?"
• Using the wrong formula for "at least 1": If the question says "non-negative," use the \(n+r-1\) formula. If it says "positive" or "at least one," use the \(n-1\) formula.
• Forgetting the bijection: Remember that we are counting sequences of stars and bars because there is a 1-to-1 mapping between those sequences and the ways to fill the boxes.

6. Summary Quick Review

The Scenario: Distributing \(n\) identical items into \(r\) distinct boxes.
The Method: Stars and Bars.
• If boxes can be empty: Ways = \( \binom{n+r-1}{r-1} \)
• If boxes cannot be empty: Ways = \( \binom{n-1}{r-1} \)
• Why it works: We are creating a bijection between the distribution of items and a string of symbols (\(*\) and \(|\)).

Keep practicing! Combinatorics is all about seeing the pattern. Once you "see" the stars and bars in a problem, the math becomes a simple calculation.


Welcome to the Inclusion-Exclusion Principle!

Hello! Today we are diving into one of the most powerful tools in combinatorics: the Inclusion-Exclusion Principle (IEP). At its heart, this principle is just a very organized way of counting things without accidentally counting the same thing twice. Whether you are figuring out how many students study certain subjects or solving complex probability problems, IEP is your best friend. Don't worry if it looks like a lot of symbols at first—we'll break it down step-by-step!

1. The Core Idea: Stop Double-Counting!

Imagine you are organizing a party. You have 10 friends who like pizza and 8 friends who like burgers. How many friends like at least one of these?
If you just add them (\(10 + 8 = 18\)), you might be wrong! Why? Because some friends might like both pizza and burgers. If you just add the totals, you’ve counted those "both" friends twice.
To get the right answer, you take the total of both groups and subtract the people you counted twice. This is the simplest form of the Inclusion-Exclusion Principle.

The Two-Set Formula

For two sets, \(A\) and \(B\), the number of elements in their union (the "at least one" group) is:
\(|A \cup B| = |A| + |B| - |A \cap B|\)

Quick Review: What do these symbols mean?
1. \(|A|\): The number of elements in set \(A\).
2. \(\cup\) (Union): Think "OR" (Elements in A, B, or both).
3. \(\cap\) (Intersection): Think "AND" (Elements in both A and B).

Example: In a class of H3 students, 15 like Calculus and 12 like Number Theory. If 5 students like both, how many students like at least one of these topics?
Solution: \(|C \cup N| = 15 + 12 - 5 = 22\) students.

Key Takeaway: When adding two groups, always subtract the overlap to keep your count accurate!

2. Leveling Up: Three Sets

What happens if we have three groups? Let's say: Calculus (\(A\)), Number Theory (\(B\)), and Geometry (\(C\)).
The formula gets a bit longer, but it follows a very specific rhythm: Add, Subtract, Add.

The Three-Set Formula

\(|A \cup B \cup C| = (|A| + |B| + |C|) - (|A \cap B| + |A \cap C| + |B \cap C|) + |A \cap B \cap C|\)

Why does this work?
1. Add: We add all individual sets. (Now we’ve over-counted the overlaps).
2. Subtract: We subtract the intersections of every pair. (But now we’ve subtracted the middle part, where all three meet, one too many times!)
3. Add: We add back the triple intersection to balance it out.

Memory Aid: The "Accordion" Method
Think of the formula like an accordion. You pull it out (Add), push it in (Subtract), and pull it out again (Add). You alternate signs every time you increase the number of sets in the intersection.

Did you know? This principle is often attributed to Abraham de Moivre, but it’s also known as the Sieve Formula because it "sifts" through the data to find the correct total!

Key Takeaway: For three sets, the pattern is: (Sum of singles) - (Sum of pairs) + (The triple).

3. The General Case (For Any Number of Sets)

In H3 Mathematics, you might encounter problems with \(n\) sets. Don't panic! The "Accordion" pattern continues forever.
To find the number of elements in the union of \(n\) sets \(A_1, A_2, ..., A_n\):
1. Add the sizes of all individual sets.
2. Subtract the sizes of all possible pairs.
3. Add the sizes of all possible triples.
4. Subtract the sizes of all possible quadruples... and so on.

The general formula is written as:
\(|\cup_{i=1}^n A_i| = \sum |A_i| - \sum |A_i \cap A_j| + \sum |A_i \cap A_j \cap A_k| - ... + (-1)^{n-1} |A_1 \cap ... \cap A_n|\)

Common Mistake to Avoid: The most common error is getting the final sign (\(+\) or \(-\)) wrong. Just remember:
- If you are dealing with an odd number of sets (like 1, 3, 5...), that term is added.
- If you are dealing with an even number of sets (like 2, 4, 6...), that term is subtracted.

Key Takeaway: The Principle of Inclusion-Exclusion is an alternating sum. Always check your signs!

4. Using IEP for "None" (The Complement)

Sometimes, the question doesn't ask for "at least one." It asks for "none."
For example: "How many ways can we arrange things so that no item is in its original place?" (This is called a Derangement).
In these cases, we use the Complement Rule from H2 Math:

Number of "None" = (Total Universe) - (Number of "At Least One")

Let \(S\) be the total set of all possibilities. The number of elements that belong to none of the sets \(A_1, A_2, ..., A_n\) is:
\(|S| - |A_1 \cup A_2 \cup ... \cup A_n|\)

Example: You have 3 letters and 3 addressed envelopes. How many ways can you stuff them so that no letter goes into the right envelope?
1. Total ways (\(S\)): \(3! = 6\)
2. Let \(A_i\) be the set where letter \(i\) is correct.
3. Use IEP to find \(|A_1 \cup A_2 \cup A_3|\) (At least one correct).
4. Subtract that from 6 to find the "None" cases.

Key Takeaway: If a problem asks for "exactly zero" or "none," calculate the "at least one" union first, then subtract it from the total.

5. Step-by-Step Strategy for Solving Problems

When you see a counting problem that looks like it needs IEP, follow these steps:

Step 1: Define your sets. Clearly state what property \(A_1, A_2,\) etc., represent. Usually, they represent "Requirement 1 is met," "Requirement 2 is met," etc.
Step 2: Identify what the question wants. Is it asking for "at least one" (\(\cup\)) or "none"?
Step 3: Calculate the individual pieces. Find the sum of singles, then the sum of pairs, then triples, etc.
Step 4: Plug into the alternating formula. Watch your plus and minus signs!
Step 5: Final adjustment. If you needed "none," subtract your result from the total possible arrangements (\(S\)).

Don't worry if this seems tricky at first! The hardest part is often identifying what the "intersections" represent. In most H3 problems, the intersections are symmetrical, meaning all pairs have the same size, and all triples have the same size, which makes the math much faster.

6. Quick Summary & Final Tips

Summary Checklist:
- Do I have overlapping groups? Use IEP!
- Two sets: \(A + B - \text{Both}\)
- Three sets: \(A + B + C - (\text{Pairs}) + \text{Triple}\)
- Signs: Alternate (\(+, -, +, -, ...\))
- "None" problems: Total minus "At least one."

Final Tip: Always draw a Venn diagram for 2 or 3 sets if you get stuck. It helps you visualize why we are adding and subtracting certain areas!

Well done! You've just mastered the logic behind the Inclusion-Exclusion Principle. Keep practicing with different types of objects (people, numbers, letters), and you'll see the pattern everywhere!