Fundamental Counting Principles
Product Rule (Multiplication Principle)
If a procedure has steps where:
- Step 1 can be done in ways
- Step 2 can be done in ways
- ...
- Step can be done in ways
Then the total number of ways to do the procedure is:
Example: How many 3-letter codes can be made from 26 letters?
Sum Rule (Addition Principle)
If a task can be done in ways OR ways (mutually exclusive):
Example: Choose a president from 10 men OR 8 women:
Subtraction Rule (Inclusion-Exclusion for 2 Sets)
If we count some items multiple times:
Example: Bit strings of length 8 starting with 1 OR ending with 00:
- Starting with 1:
- Ending with 00:
- Both:
- Answer:
Division Rule
If a procedure counts each outcome times:
Example: Seating people around a circular table: (Rotations are considered the same)
Bijection Principle
If there's a bijection between sets and :
Counting one set by counting another equivalent set.
Example: Binary strings of length with ones ways to choose positions from
Counting with Constraints
"At least one" Problems
Often easier to use complement:
Example: Bit strings of length 10 with at least one 1: (Subtract the all-zeros string)
"At most" Problems
Or use complement:
Common Counting Patterns
Bit Strings
| Description | Count |
|---|---|
| Bit strings of length | |
| Bit strings of length with ones | |
| Bit strings of length starting with 1 | |
| Bit strings with even number of ones |
Strings from Alphabet
For alphabet of size :
| Description | Count |
|---|---|
| Strings of length | |
| Strings of length with distinct characters | |
| Strings of length |
Subsets
| Description | Count |
|---|---|
| Subsets of -element set | |
| -element subsets | |
| Subsets of even size | |
| Subsets of odd size |
Tree Diagrams
Visualize sequential choices with a tree:
- Each path from root to leaf is one outcome
- Total outcomes = number of leaves
Complementary Counting
Count what you DON'T want and subtract:
Example: Integers from 1 to 1000 NOT divisible by 5 or 7:
- Total: 1000
- Divisible by 5:
- Divisible by 7:
- Divisible by both (35):
- Not divisible by 5 or 7:
Double Counting
Count the same thing two different ways to establish an identity.
Example: Prove
Method 1: Sum counts all subsets of an -set. Method 2: Each element is in or out: subsets.
Therefore:
Counting Functions
| Type | Count (for , , ) | |------|-------------------------------------------| | All functions | | | Injections (one-to-one) | | | Surjections (onto) | Complex formula using inclusion-exclusion | | Bijections | (only when ) |
Counting Proofs
Algebraic Proof
Use algebraic manipulation to prove identities.
Combinatorial Proof
Show both sides count the same thing.
Example: Prove
Combinatorial proof:
- Left: ways to choose elements to include
- Right: ways to choose elements to exclude
- Both count the same subsets!