Counting Principles
485 words
2 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Counting Principles ## 🎯 Learning Objectives - Apply the **product rule** and **sum rule** for counting - Compute **permutations** ($P(n,k)$) and **combinations** ($C(n,k)$) - Understand **binomial coefficients** and Pascal's identity - Distinguish permutations with vs. without repetition - Solve counting problem...

Counting Principles
🎯 Learning Objectives
- Apply the product rule and sum rule for counting
- Compute permutations (P(n,k)) and combinations (C(n,k))
- Understand binomial coefficients and Pascal's identity
- Distinguish permutations with vs. without repetition
- Solve counting problems with multiple cases
1.1 Intuition: Counting Without Listing
Counting is the oldest mathematical art. The key insight: we can count things without listing them by understanding the structure of choices.
🔑 Key Insight: Most counting problems reduce to: "How many ways to make a sequence of choices?"
1.2 Basic Rules
Product Rule
If task A can be done in m ways and task B in n ways, then A AND B can be done in m×n ways.
Example: How many 2-letter words? 26×26=676.
Sum Rule
If task A can be done in m ways and task B in n ways, and they are disjoint, then A OR B can be done in m+n ways.
Example: Choosing a vowel (5) or a consonant (21) from alphabet: 5+21=26.
1.3 Permutations
Permutation: An ordered arrangement of distinct objects.
Example: Number of ways to award gold, silver, bronze to 10 athletes: P(10,3)=10×9×8=720.
Permutations with Repetition
nk — choose from n options, k times, with repetition allowed.
Example: Number of 4-digit PINs: 104=10000.
1.4 Combinations
Combination: An unordered selection of distinct objects.
Example: Number of ways to choose a 3-person committee from 10: (310)=120.
Relationship
P(n,k)=C(n,k)×k!1.5 Binomial Coefficients
(x+y)n=k=0∑n(kn)xn−kykPascal's Identity
(kn)=(k−1n−1)+(kn−1)📊 Formula Summary
| Concept | Formula |
|---|---|
| Permutations | P(n,k)=(n−k)!n! |
| Combinations | C(n,k)=(kn)=k!(n−k)!n! |
| Permutations with repetition | nk |
| Binomial theorem | (x+y)n=∑(kn)xn−kyk |
✅ Practice Questions
Q1: How many ways to arrange the letters in "MATH"?
Solution4 distinct letters: 4!=24 arrangements. Q2: How many 5-card poker hands from a 52-card deck? Solution(552)=5!47!52!=2,598,960. Q3: How many ways to choose a president, VP, and secretary from 12 people? SolutionP(12,3)=12×11×10=1320. Q4: Prove C(n,k)=C(n,n−k) combinatorially. SolutionChoosing k elements to include is equivalent to choosing n−k elements to exclude. So (kn)=(n−kn). Q5: How many bit strings of length 8 contain exactly three 1s? Solution