Neural Sync Active
Week 5: Counting Principles & Combinatorics
Registry Synced
Week 5: Counting Principles & Combinatorics
3003 words
15 min read
2026-09-12
Reading compass
Now · TL;DR
Statistics for Data Science I — Week 5: Counting Principles & Combinatorics
IITM’s Week 5 moves into counting methods and factorials, beginning the transition from descriptive statistics toward probability.
TL;DR
Probability often starts with:
when outcomes are equally likely.
So before probability, we need to answer:
How many possible outcomes are there?
The core Week 5 ideas are:
- addition principle
- multiplication principle
- factorial
- ordered arrangements
- counting without listing everything
- avoiding overcounting
- complementary counting intuition
1. Why counting matters
Suppose a password has:
- 2 letters
- followed by 3 digits
How many possible passwords exist?
Listing them manually is absurd.
Counting principles let us compute the answer directly.
This becomes essential for probability.
2. Addition principle
If one task can happen in:
ways and another mutually exclusive task can happen in:
ways, then either task can happen in:
ways.
3. Example
Suppose you can travel from A to B by:
- 3 bus routes
- 2 train routes
If you choose either a bus or train, total choices:
So:
ways.
4. Why mutual exclusivity matters
The addition rule works directly when the options do not overlap.
If some outcome belongs to both groups, simply adding counts double-counts it.
This leads later to inclusion-exclusion ideas.
5. Multiplication principle
If a process has multiple stages:
- stage 1 has m choices
- for each choice, stage 2 has n choices
then total outcomes:
This is also called the fundamental counting principle.
6. Example
Suppose:
- 4 shirts
- 3 pairs of trousers
An outfit consists of one shirt and one trouser.
Total outfits:
So:
7. Multi-stage version
If stages have:
choices, total outcomes:
provided each stage proceeds for every earlier valid choice.
8. Example: PIN
A 4-digit PIN uses digits:
If repetition is allowed, each position has:
choices.
Therefore:
9. Example: no repetition
Suppose a 4-digit code uses digits 0–9 with no repeated digit.
Choices:
First:
Second:
Third:
Fourth:
Total:
Thus:
10. Leading-zero trap
A 4-digit number is different from a 4-digit code.
For a 4-digit number:
- first digit cannot be 0
So if repetition is allowed:
First digit:
choices:
Remaining three digits:
choices each.
Total:
11. Factorial
For a positive integer n:
Examples:
12. Zero factorial
By definition:
This may look strange initially, but it makes combinatorial formulas work consistently.
13. Factorial recursion
A useful identity:
Example:
This is often useful for simplification.
14. Simplifying factorial expressions
Example:
Since:
we get:
Do not expand everything unless necessary.
15. Arranging distinct objects
Suppose there are:
distinct objects.
How many ways can they be arranged in a line?
First position:
choices.
Second:
Continue until:
Therefore:
16. Example
Arrange four distinct books:
Number of arrangements:
17. Why order matters
Compare:
and:
If arrangements are being counted, these are different outcomes.
So whenever order matters, counting is usually larger.
18. Counting ordered selections
Suppose we choose:
- president
- vice-president
- secretary
from 10 people.
These roles are different.
Choices:
President:
Vice-president:
Secretary:
Total:
Order/role matters.
19. General ordered selection
Choose and arrange r objects from n distinct objects.
The count is:
This can be written:
This is the permutation formula, which Week 6 develops more explicitly.
20. Example
Choose gold, silver and bronze medalists from 8 finalists.
Gold:
Silver:
Bronze:
Total:
21. Repetition allowed vs forbidden
This distinction is crucial.
Suppose we create a 3-letter string from 26 letters.
Repetition allowed
Each position:
choices.
Total:
No repetition
Choices:
Total:
22. Decision question
Before counting, ask:
Can an object be used again?
If yes:
If no:
This single question prevents many errors.
23. Ordered vs unordered
Another essential question:
Does order matter?
Compare selecting Alice and Bob:
with arranging:
and:
For selection:
For order-sensitive outcomes:
24. Counting tree intuition
For a multi-stage problem, a tree can help.
Suppose first choice:
and second choice:
Then:
textstart / \ A B / | \ / | \ 1 2 3 1 2 3
There are:
leaves/outcomes.
The multiplication principle is essentially compressed tree counting.
25. Addition vs multiplication
A common distinction:
"OR"
Often suggests addition.
"AND / then"
Often suggests multiplication.
But do not mechanically rely on words alone; inspect whether options overlap and whether stages are sequential.
26. Example
A student can choose:
- one of 4 mathematics electives
- or one of 3 physics electives
Total:
But if they must choose:
- one mathematics elective
- and one physics elective
total:
27. Complementary counting
Sometimes it is easier to count what you do not want.
General idea:
This becomes especially useful in probability.
28. Example
How many 3-digit strings over digits 0–9 contain at least one zero?
Total strings:
Strings with no zero:
Each position has:
choices:
So:
Therefore strings with at least one zero:
Thus:
29. "At least one" mental shortcut
Questions involving:
- at least one
- not all
- at least one success
often become easier through complements.
Instead of directly counting many overlapping cases:
30. Inclusion-exclusion intuition
Suppose:
and:
are two sets of outcomes.
If we add:
anything in both is counted twice.
So:
This is the basic two-set inclusion-exclusion principle.
31. Example
In a group:
- 20 know Python
- 15 know Java
- 8 know both
How many know at least one?
So:
32. Why subtract the intersection?
People in both groups were counted:
- once in Python
- once in Java
So they were counted twice.
Subtract once to leave exactly one count.
33. Three-set inclusion-exclusion intuition
For three sets:
the pattern is:
The final triple intersection is added back because it gets over-subtracted.
34. Distinct vs identical objects
Suppose three balls are:
They are distinct.
But if all three balls are physically identical, rearranging them does not create new distinguishable outcomes.
Counting depends on what counts as a different outcome.
This is one of the deepest recurring combinatorics questions.
35. Repeated objects
Consider arranging letters:
If all letters were treated distinct:
But the two A's are identical.
Actual distinct arrangements:
So:
arrangements.
The general repeated-object formula comes naturally in permutations.
36. Why naive 3! overcounts
Imagine temporarily labeling A's:
Then:
and:
look different under labels.
But after removing labels both become:
So each actual arrangement was counted:
times.
Thus:
37. General repeated-object arrangement
If there are n objects with repeated groups:
where:
then distinct arrangements:
This is useful even if permutations are formally emphasized next week.
38. Example: MISSISSIPPI-style logic
Suppose the word is:
Total letters:
A appears twice.
Distinct arrangements:
39. Circular arrangement intuition
Linear arrangements:
are different positions in a row.
But around a circle, rotations may represent the same arrangement.
For n distinct people around a round table:
because we can fix one person's position and arrange everyone else relative to them.
Treat this as supplementary unless your Week 5 lectures explicitly emphasize circular counting.
40. Example: round table
Five people around a circular table:
In a line:
Different because rotating everyone together does not create a new circular seating.
41. Counting with restrictions
Many problems impose conditions.
Example:
How many 4-digit numbers contain no repeated digits?
First digit:
choices.
Second digit:
choices because 0 becomes allowed but the first digit is unavailable.
Third:
Fourth:
Total:
So:
42. Restriction-first strategy
When restrictions exist, often count the most constrained position first.
Example:
Arrange 5 people if Alice must sit first.
Alice's position fixed:
way.
Remaining four:
ways.
So:
43. "Together" problems intuition
Suppose A and B must stay together in a row with C, D, E.
Treat:
as one block.
Then objects are:
which gives:
arrangements.
Within the block:
or:
gives:
orders.
Total:
44. "Not together" strategy
Often:
Again, complementary counting simplifies the problem.
45. Example
Five distinct people arranged in a row.
Total:
A and B together:
Therefore A and B not together:
46. Slots method intuition
Suppose vowels/consonants must alternate.
Instead of trying random arrangements, draw position types first.
Example for:
- 3 consonants
- 2 vowels
possible structure:
textC V C V C
Then arrange consonants in their slots and vowels in theirs.
This slot method is useful for restriction problems.
47. Factorial growth
Factorials grow extremely quickly.
Examples:
This is why brute-force enumeration becomes impossible surprisingly fast.
48. Counting and probability
Suppose all outcomes are equally likely.
Then:
where:
- S = sample space
- E = event
Counting lets us calculate both numerator and denominator.
Formal probability arrives later, but this is the bridge.
49. Example: die
A standard die has:
possible outcomes.
Even outcome set:
contains:
So:
Here counting is trivial.
For cards/passwords/selections, combinatorics makes the same logic feasible.
50. Sample space
The sample space is the set of all possible outcomes.
Notation commonly:
or:
Example: two coin tosses:
Therefore:
51. Counting two coin tosses
Each toss has:
possibilities.
Two tosses:
For n independent binary choices:
possible sequences.
52. Example: three coin tosses
23=8possible ordered sequences.
These are:
Common mistake: adding sequential choices
Suppose:
- 5 shirts
- 4 trousers
Outfits are not:
You choose one of each, so:
Common mistake: multiplying alternatives
If you may choose either:
- one of 4 buses
- or one of 3 trains
you do not multiply:
You choose only one mode:
Common mistake: forgetting order
Choosing two students for a committee:
is usually the same committee as:
But choosing:
- president = A
- vice-president = B
is different from swapping roles.
Always ask:
Common mistake: repetition assumption
A password problem may allow repetition unless stated otherwise.
A "choose 3 different students" problem explicitly forbids repetition.
Do not assume one convention for every question.
Common mistake: code vs number
Code:
may be perfectly valid.
Four-digit number:
is actually:
not a 4-digit number.
So the first-position rule differs.
Common mistake: factorial arithmetic
does not mean:
It means:
Also:
Common mistake: expanding huge factorials
To simplify:
do not calculate 100!.
Cancel:
So:
Common mistake: double counting
Suppose you count outcomes under two categories and those categories overlap.
Adding directly counts intersection twice.
Use:
Common mistake: directly counting "at least one"
"At least one" often creates many overlapping cases.
Try the complement first:
Usually much cleaner.
62. Counting-problem workflow
For almost every Week 5 counting problem, ask in this order:
text1. What counts as one outcome? 2. Are there stages? 3. Is this OR or AND? 4. Does order matter? 5. Is repetition allowed? 6. Are there restrictions? 7. Are cases mutually exclusive? 8. Would complement be easier? 9. Am I double-counting anything?
This is more useful than memorizing isolated formulas.
63. Formula sheet
Addition principle
For mutually exclusive alternatives:
Multiplication principle
For sequential choices:
Factorial
n!=n(n−1)⋯1Zero factorial
0!=1Arrange n distinct objects
n!Ordered selection of r from n
(n−r)!n!Repeated symbols
n1!n2!⋯nk!n!Two-set inclusion-exclusion
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣64. Mental classification map
textCOUNTING PROBLEM │ ├── alternatives? │ └── add │ ├── sequential stages? │ └── multiply │ ├── arrange all distinct objects? │ └── n! │ ├── choose/order only some? │ └── n!/(n-r)! │ ├── repeated objects? │ └── divide duplicate permutations │ └── "at least one" / "not"? └── consider complement
65. Weeks 4 → 5 transition
Weeks 1–4 mostly dealt with observed data.
Week 5 starts asking about possible outcomes, whether or not they have occurred.
That is the bridge to probability:
66. What you should actually master
By the end of Stats 1 Week 5, you should be able to:
- Use the addition principle.
- Use the multiplication principle.
- Recognize when to add vs multiply.
- Calculate and simplify factorials.
- Know: 0!=1.
- Count arrangements of distinct objects.
- Count ordered multi-stage choices.
- Distinguish order-sensitive from order-insensitive settings conceptually.
- Distinguish repetition allowed vs forbidden.
- Handle leading-zero restrictions.
- Use complementary counting for "at least one."
- Avoid double counting.
- Use basic inclusion-exclusion.
- Count arrangements with repeated identical objects.
- Translate a verbal counting problem into a structured sequence of choices.
If those are comfortable, Stats 1 Week 5 is under control.
Quick Recall & Flashcards
Test your active recall before proceeding to practice problems. Format:
Question :: Answer.- Week 5 Diagnostic: A cafeteria offers 4 soups, 5 main courses, and 3 desserts. How many distinct meal combinations (1 soup, 1 main, 1 dessert) can a student choose? :: Answer: 60 — By the Rule of Product: 4 * 5 * 3 = 60.
- Week 5 Diagnostic: If 13 pigeons fly into 12 pigeonholes, at least one pigeonhole must contain at least how many pigeons? :: Answer: 2 — By the Pigeonhole Principle, ceil(13 / 12) = 2.
Practice & Self-Check
Attempt these diagnostic questions to verify your operational understanding.
1
Question 1
A cafeteria offers 4 soups, 5 main courses, and 3 desserts. How many distinct meal combinations (1 soup, 1 main, 1 dessert) can a student choose?
NAT
3 Unit Assessment
2
Question 2
If 13 pigeons fly into 12 pigeonholes, at least one pigeonhole must contain at least how many pigeons?
NAT
3 Unit Assessment