Sub topic 1
Counting Basics: Addition and Multiplication Principles
Prerequisites
You should be comfortable with basic arithmetic, simplifying fractions, exponents, factorial-style products, and translating word problems into conditions. Basic set ideas such as union and intersection help but are not required.
The Two Core Principles
The addition principle applies when a task splits into cases that cannot happen together. If you can travel by 3 buses or 2 trains, you have 3 + 2 = 5 options.
The multiplication principle applies when a task splits into steps that happen one after another. If you pick a shirt from 4 options and then pants from 3, you have 4 × 3 = 12 outfits.
Factorials and Arranging n Distinct Objects
The factorial n! is the product n × (n − 1) × ... × 1, with 0! = 1. Arranging n distinct objects in a row gives n! ways. Four books can be arranged in 4! = 24 ways.
Permutations: Arrangements When Order Matters
The permutation nPr = n! / (n − r)! counts ordered selections of r items from n. For example, 5P3 = 5! / 2! = 60.
Combinations: Selections When Order Does Not Matter
The combination nCr = n! / (r! × (n − r)!) counts unordered selections. For example, 5C3 = 10. Each combination corresponds to r! permutations, so nPr = nCr × r!.
Useful nCr Properties: Symmetry and Pascal's Identity
Symmetry states that nCr = nC(n − r). Pascal's identity states that nCr = (n − 1)C(r − 1) + (n − 1)Cr. The following code checks both rules and the nPr relation.
import math
print(math.perm(5, 3)) # 60
print(math.comb(5, 3)) # 10
print(math.perm(5, 3) == math.comb(5, 3) * math.factorial(3)) # True
print(math.comb(5, 3) == math.comb(5, 2)) # True (symmetry)
print(math.comb(8, 3) == math.comb(7, 2) + math.comb(7, 3)) # True (Pascal)Exercise
How many committees of 2 can be chosen from 6 people?
Show answer
6C2 = 6! / (2! × 4!) = 15. Order does not matter in a committee, so use a combination.