n = 0 n = 1 n = 2 n = 3 n = 4 n = 5 n = 6 1 1 1 1 2 1 1 3 3 1 1 4 6 C(4, 2) 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 ROW 4 = COEFFICIENTS OF (a + b)⁴ (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴
C(4,2) = C(3,1) + C(3,2)
Combinatorics Basics: Counting Rules & Scenarios › The Binomial Coefficient
C(x, 2) as a curve through the counts C(n, 2) −1 0 1 2 3 4 2 4 6 8 x C(x, 2) = x(x − 1)/2 C(2,2) = 1 C(3,2) = 3 C(4,2) = 6 x = −1: value 1 x = 5/2: value 15/8 x = n, a whole number: the count of 2-element subsets of n items any other x: the same polynomial, no longer a count One polynomial through the counts
Binomial Coefficient Formula & Identities › Definition
n = 0 n = 1 n = 2 n = 3 n = 4 n = 5 n = 6 n = 7 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 C(7, 2) 35 35 21 7 1 ROW 7 = COEFFICIENTS OF (a + b)⁷ (a + b)⁷ = a⁷ + 7a⁶b + 21a⁵b² + 35a⁴b³ + 35a³b⁴ + 21a²b⁵ + 7ab⁶ + b⁷ C(7,2) = C(7,5) = 21
Binomial Coefficient Formula & Identities › Pascal's Triangle
The 8 picks from (a + b)(a + b)(a + b), grouped by the number of b’s pick a or b from each factor of (a + b)(a + b)(a + b) 8 = 2 × 2 × 2 picks in all, sorted by how many b’s they take no b a a a 1 pick = C(3,0) a³ + one b a a b a b a b a a 3 picks = C(3,1) 3a²b + two b’s a b b b a b b b a 3 picks = C(3,2) 3ab² + three b’s b b b 1 pick = C(3,3) b³ (a + b)³ = a³ + 3a²b + 3ab² + b³
Every pick, sorted by its b's
Binomial Theorem Formula, Proof, Examples › The Theorem
n = 0 n = 1 n = 2 n = 3 n = 4 sum = 16 = 2⁴ n = 5 n = 6 1 1 1 1 2 1 1 3 3 1 1 4 6 C(4, 2) 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 ROW 4 = COEFFICIENTS OF (a + b)⁴ (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴
Row 4 sums to 16 = 2⁴
Binomial Theorem Formula, Proof, Examples › Special Cases
4!/(2! · 1! · 1!) = 12 Complete · 12 / 12 SOURCE (n = 4) 1 2 3 4 BUILD BOXES (2+1+1) BOX A (2) BOX B (1) BOX C (1) COMPLETED 12 / 12 → Box A 1 2 3 4 1 2 4 3 1 3 2 4 1 3 4 2 1 4 2 3 1 4 3 2 → Box B 2 3 1 4 2 4 1 3 3 4 1 2 → Box C 2 3 4 1 2 4 3 1 3 4 2 1
Four items into boxes of 2, 1 and 1
Binomial Theorem Formula, Proof, Examples › The Multinomial Theorem
Three shirts times two trousers: a tree of six outfits step 1: shirt 3 choices step 2: trousers 2 choices each outfit P₁ S₁P₁ P₂ S₁P₂ S₁ P₁ S₂P₁ P₂ S₂P₂ S₂ P₁ S₃P₁ P₂ S₃P₂ S₃ 3 × 2 = 6 outfits: every path through the tree is one outfit
Three choices, then two
Counting Principles in Combinatorics › The Multiplication Rule
3⁴ = 81 Complete · 81 / 81 ITEMS TO PLACE (n = 4) 1 2 3 4 CELLS (k = 3) Cell 1 Cell 2 Cell 3 assignment: ( ? , ? , ? , ? ) (item 1 → cell c₁, item 2 → cell c₂, …) Each of n = 4 items independently picks 1 of k = 3 cells: 3⁴ = 3 × 3 × 3 × 3 = 81 COMPLETED 81 / 81 item 1 → Cell 1 1 2 3 4 (1,1,1,1) 1 2 3 4 (1,1,1,2) 1 2 3 4 (1,1,1,3) 1 2 4 3 (1,1,2,1) 1 2 3 4 (1,1,2,2) 1 2 3 4 (1,1,2,3) 1 2 4 3 (1,1,3,1) 1 2 4 3 (1,1,3,2) 1 2 3 4 (1,1,3,3) 1 3 4 2 (1,2,1,1) 1 3 2 4 (1,2,1,2) 1 3 2 4 (1,2,1,3) 1 4 2 3 (1,2,2,1) 1 2 3 4 (1,2,2,2) 1 2 3 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4 1 3 (3,2,3,2) 2 1 3 4 (3,2,3,3) 3 4 1 2 (3,3,1,1) 3 4 1 2 (3,3,1,2) 3 1 2 4 (3,3,1,3) 4 3 1 2 (3,3,2,1) 3 4 1 2 (3,3,2,2) 3 1 2 4 (3,3,2,3) 4 1 2 3 (3,3,3,1) 4 1 2 3 (3,3,3,2) 1 2 3 4 (3,3,3,3)
4 items into 3 cells: 3⁴ = 81 ways
Counting Principles in Combinatorics › The Pigeonhole Principle
30 students: 18 take French, 15 take Spanish, 7 take both French F: 18 Spanish S: 15 11 French only 7 both in 18 and in 15 8 Spanish only U: 30 students 4 take neither |F| + |S| = 18 + 15 = 33 counts the 7 in both twice |F ∪ S| = 18 + 15 − 7 = 26 = 11 + 7 + 8
The overlap, counted twice
Inclusion-Exclusion Formula & Examples › Two Sets
After the three subtractions
Inclusion-Exclusion Formula & Examples › Three Sets
U A B
Outside every set
Inclusion-Exclusion Formula & Examples › The Complementary Form
The six permutations of 1, 2, 3 and how many of the sets A1, A2, A3 each one is in position 1 2 3 in how many Aᵢ perm. 1 1 2 3 3 perm. 2 1 3 2 1 perm. 3 2 1 3 1 perm. 4 2 3 1 0 perm. 5 3 1 2 0 perm. 6 3 2 1 1 element i in position i: the permutation is in Aᵢ !3 = 3!(1 − 1 + 1/2 − 1/6) = 2 In none of A₁, A₂, A₃: 6 − 3·2! + 3·1! − 0! = 2
Permutations of 1, 2, 3 and the sets Aᵢ
Inclusion-Exclusion Formula & Examples › Application: Counting Derangements
P(3) = 3! = 6 Complete · 6 / 6 SOURCE (n = 3) 1 2 3 BUILD AREA #1 #2 #3 COMPLETED 6 / 6 1 1 2 3 1 3 2 2 2 1 3 2 3 1 3 3 1 2 3 2 1
All 3! = 6 arrangements of three items
Permutations: Types, Formulas, Examples › Permutation (Full)
Six ways to hand back three hats; two leave no guest with their own guest A B C own hats order 1 A B C 3 order 2 A C B 1 order 3 B A C 1 order 4 B C A 0 order 5 C A B 0 order 6 C B A 1 a guest gets their own hat !3 = 3!(1 − 1 + 1/2 − 1/6) = 2 2 of the 3! = 6 orders give nobody their own hat: !3 = 2
Three guests, three hats
Permutations: Types, Formulas, Examples › Derangement
P(3) = 3! = 6 Press Play or Step to begin SOURCE (n = 3) 1 2 3 BUILD AREA #1 #2 #3
n = 3, idle, frozen
Full Permutation Visualizer › Getting Started
P(3) = 3! = 6 Step 2 (Blue): 0 / 2 SOURCE (n = 3) 1 2 3 BUILD AREA #1 #2 #3 2 1 COMPLETED 2 / 6 1 1 2 3 1 3 2 2
Mid-build, frozen
Full Permutation Visualizer › The Build Area
P(4) = 4! = 24 Complete · 24 / 24 SOURCE (n = 4) 1 2 3 4 BUILD AREA #1 #2 #3 #4 COMPLETED 24 / 24 1 1 2 3 4 1 2 4 3 1 3 2 4 1 3 4 2 1 4 2 3 1 4 3 2 2 2 1 3 4 2 1 4 3 2 3 1 4 2 3 4 1 2 4 1 3 2 4 3 1 3 3 1 2 4 3 1 4 2 3 2 1 4 3 2 4 1 3 4 1 2 3 4 2 1 4 4 1 2 3 4 1 3 2 4 2 1 3 4 2 3 1 4 3 1 2 4 3 2 1
n = 4 complete, frozen
Full Permutation Visualizer › Adjusting n
P(3) = 3! = 6 Complete · 6 / 6 SOURCE (n = 3) 1 2 3 BUILD AREA #1 #2 #3 COMPLETED 6 / 6 1 1 2 3 1 3 2 2 2 1 3 2 3 1 3 3 1 2 3 2 1
n = 3 complete, frozen
Full Permutation Visualizer › Grouping by First Item
P(5) = 5! = 120 Complete · 120 / 120 SOURCE (n = 5) 1 2 3 4 5 BUILD AREA #1 #2 #3 #4 #5 COMPLETED 120 / 120 1 1 2 3 4 5 1 2 3 5 4 1 2 4 3 5 1 2 4 5 3 1 2 5 3 4 1 2 5 4 3 1 3 2 4 5 1 3 2 5 4 1 3 4 2 5 1 3 4 5 2 1 3 5 2 4 1 3 5 4 2 1 4 2 3 5 1 4 2 5 3 1 4 3 2 5 1 4 3 5 2 1 4 5 2 3 1 4 5 3 2 1 5 2 3 4 1 5 2 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Full Permutation Visualizer › Deriving n! Step by Step
3!/(2! · 1!) = 3 Press Play or Step to begin SOURCE — MULTISET AAB (n = 3) 1 1 2 BUILD AREA #1 #2 #3
AAB, idle, frozen
Permutation with Identical Items Visualizer › Getting Started
3!/(2! · 1!) = 3 Group Red: 1 / 2 SOURCE — MULTISET AAB (n = 3) 1 1 2 BUILD AREA #1 #2 #3 1 2 COMPLETED 1 / 3 1 1 1 2
AAB mid-build, frozen
Permutation with Identical Items Visualizer › The Build Area
3!/(2! · 1!) = 3 Complete · 3 / 3 SOURCE — MULTISET AAB (n = 3) 1 1 2 BUILD AREA #1 #2 #3 COMPLETED 3 / 3 1 1 1 2 1 2 1 2 2 1 1
AAB complete, frozen
Permutation with Identical Items Visualizer › AAB: The Smallest Multiset
4!/(3! · 1!) = 4 Complete · 4 / 4 SOURCE — MULTISET AAAB (n = 4) 1 1 1 2 BUILD AREA #1 #2 #3 #4 COMPLETED 4 / 4 1 1 1 1 2 1 1 2 1 1 2 1 1 2 2 1 1 1
AAAB complete, frozen
Permutation with Identical Items Visualizer › AAAB: Placing the Single B
5!/(3! · 2!) = 10 Complete · 10 / 10 SOURCE — MULTISET AAABB (n = 5) 1 1 1 2 2 BUILD AREA #1 #2 #3 #4 #5 COMPLETED 10 / 10 1 1 1 1 2 2 1 1 2 1 2 1 1 2 2 1 1 2 1 1 2 1 2 1 2 1 1 2 2 1 1 2 2 1 1 1 2 2 1 1 2 1 2 1 2 1 1 2 2 1 1 1
AAABB complete, frozen
Permutation with Identical Items Visualizer › AAABB: Two Letters, Ten Arrangements
5!/(2! · 2! · 1!) = 30 Complete · 30 / 30 SOURCE — MULTISET AABBC (n = 5) 1 1 2 2 3 BUILD AREA #1 #2 #3 #4 #5 COMPLETED 30 / 30 1 1 1 2 2 3 1 1 2 3 2 1 1 3 2 2 1 2 1 2 3 1 2 1 3 2 1 2 2 1 3 1 2 2 3 1 1 2 3 1 2 1 2 3 2 1 1 3 1 2 2 1 3 2 1 2 1 3 2 2 1 2 2 1 1 2 3 2 1 1 3 2 2 1 2 1 3 2 1 2 3 1 2 1 3 1 2 2 1 3 2 1 2 2 1 1 3 2 2 1 3 1 2 2 3 1 1 2 3 1 1 2 2 3 1 2 1 2 3 2 1 1 3 3 1 1 2 2 3 1 2 1 2 3 1 2 2 1 3 2 1 1 2 3 2 1 2 1 3 2 2 1 1
AABBC complete, frozen
Permutation with Identical Items Visualizer › AABBC: The Longest Run
4!/(2! · 1! · 1!) = 12 Complete · 12 / 12 SOURCE — MULTISET AABC (n = 4) 1 1 2 3 BUILD AREA #1 #2 #3 #4 COMPLETED 12 / 12 1 1 1 2 3 1 1 3 2 1 2 1 3 1 2 3 1 1 3 1 2 1 3 2 1 2 2 1 1 3 2 1 3 1 2 3 1 1 3 3 1 1 2 3 1 2 1 3 2 1 1
AABC complete, frozen
Permutation with Identical Items Visualizer › Grouping by Distinct First Item
4!/(2! · 2!) = 6 Complete · 6 / 6 SOURCE — MULTISET AABB (n = 4) 1 1 2 2 BUILD AREA #1 #2 #3 #4 COMPLETED 6 / 6 1 1 1 2 2 1 2 1 2 1 2 2 1 2 2 1 1 2 2 1 2 1 2 2 1 1
AABB complete, frozen
Permutation with Identical Items Visualizer › Why Divide by k!
P(3, 2) = 6 Press Play or Step to begin SOURCE (n = 3) 1 2 3 BUILD AREA (r = 2) #1 #2
(n, r) = (3, 2), idle, frozen
Partial Permutation Visualizer › Getting Started
P(3, 2) = 6 Step 2 (Blue): 0 / 2 SOURCE (n = 3) 1 2 3 BUILD AREA (r = 2) #1 #2 2 1 COMPLETED 2 / 6 1 1 2 1 3 2
(3, 2) mid-build, frozen
Partial Permutation Visualizer › The Build Area
P(3, 2) = 6 Complete · 6 / 6 SOURCE (n = 3) 1 2 3 BUILD AREA (r = 2) #1 #2 COMPLETED 6 / 6 1 1 2 1 3 2 2 1 2 3 3 3 1 3 2
P(3, 2) complete, frozen
Partial Permutation Visualizer › Grouping by First Item
P(4, 4) = 24 Complete · 24 / 24 SOURCE (n = 4) 1 2 3 4 BUILD AREA (r = 4) #1 #2 #3 #4 COMPLETED 24 / 24 1 1 2 3 4 1 2 4 3 1 3 2 4 1 3 4 2 1 4 2 3 1 4 3 2 2 2 1 3 4 2 1 4 3 2 3 1 4 2 3 4 1 2 4 1 3 2 4 3 1 3 3 1 2 4 3 1 4 2 3 2 1 4 3 2 4 1 3 4 1 2 3 4 2 1 4 4 1 2 3 4 1 3 2 4 2 1 3 4 2 3 1 4 3 1 2 4 3 2 1
P(4, 4) complete, frozen
Partial Permutation Visualizer › When r = n: The Full Permutation Limit
P(4, 1) = 4 Complete · 4 / 4 SOURCE (n = 4) 1 2 3 4 BUILD AREA (r = 1) #1 COMPLETED 4 / 4 1 1 2 2 3 3 4 4
P(4, 1) complete, frozen
Partial Permutation Visualizer › When r = 1: A Single Choice
P(5, 3) = 60 Complete · 60 / 60 SOURCE (n = 5) 1 2 3 4 5 BUILD AREA (r = 3) #1 #2 #3 COMPLETED 60 / 60 1 1 2 3 1 2 4 1 2 5 1 3 2 1 3 4 1 3 5 1 4 2 1 4 3 1 4 5 1 5 2 1 5 3 1 5 4 2 2 1 3 2 1 4 2 1 5 2 3 1 2 3 4 2 3 5 2 4 1 2 4 3 2 4 5 2 5 1 2 5 3 2 5 4 3 3 1 2 3 1 4 3 1 5 3 2 1 3 2 4 3 2 5 3 4 1 3 4 2 3 4 5 3 5 1 3 5 2 3 5 4 4 4 1 2 4 1 3 4 1 5 4 2 1 4 2 3 4 2 5 4 3 1 4 3 2 4 3 5 4 5 1 4 5 2 4 5 3 5 5 1 2 5 1 3 5 1 4 5 2 1 5 2 3 5 2 4 5 3 1 5 3 2 5 3 4 5 4 1 5 4 2 5 4 3
P(5, 3) complete, frozen
Partial Permutation Visualizer › Deriving P(n,r) Step by Step
3^2 = 9 Press Play or Step to begin SOURCE (n = 3) — UNLIMITED SUPPLY 1 2 3 BUILD AREA (r = 2) #1 #2
(n, r) = (3, 2), idle, frozen
Permutation with Repetition Visualizer › Getting Started
3^2 = 9 Step 1 (Red): 0 / 3 SOURCE (n = 3) — UNLIMITED SUPPLY 1 2 3 BUILD AREA (r = 2) #1 #2 1 1 COMPLETED 0 / 9 1
(3, 2) mid-build, frozen
Permutation with Repetition Visualizer › The Build Area
3^2 = 9 Complete · 9 / 9 SOURCE (n = 3) — UNLIMITED SUPPLY 1 2 3 BUILD AREA (r = 2) #1 #2 COMPLETED 9 / 9 1 1 1 1 2 1 3 2 2 1 2 2 2 3 3 3 1 3 2 3 3
3² complete, frozen
Permutation with Repetition Visualizer › Grouping by First Item
3^3 = 27 Complete · 27 / 27 SOURCE (n = 3) — UNLIMITED SUPPLY 1 2 3 BUILD AREA (r = 3) #1 #2 #3 COMPLETED 27 / 27 1 1 1 1 1 1 2 1 1 3 1 2 1 1 2 2 1 2 3 1 3 1 1 3 2 1 3 3 2 2 1 1 2 1 2 2 1 3 2 2 1 2 2 2 2 2 3 2 3 1 2 3 2 2 3 3 3 3 1 1 3 1 2 3 1 3 3 2 1 3 2 2 3 2 3 3 3 1 3 3 2 3 3 3
3³ complete, frozen
Permutation with Repetition Visualizer › Sequences versus Permutations: 27 against 6
3^4 = 81 Complete · 81 / 81 SOURCE (n = 3) — UNLIMITED SUPPLY 1 2 3 BUILD AREA (r = 4) #1 #2 #3 #4 COMPLETED 81 / 81 1 1 1 1 1 1 1 1 2 1 1 1 3 1 1 2 1 1 1 2 2 1 1 2 3 1 1 3 1 1 1 3 2 1 1 3 3 1 2 1 1 1 2 1 2 1 2 1 3 1 2 2 1 1 2 2 2 1 2 2 3 1 2 3 1 1 2 3 2 1 2 3 3 1 3 1 1 1 3 1 2 1 3 1 3 1 3 2 1 1 3 2 2 1 3 2 3 1 3 3 1 1 3 3 2 1 3 3 3 2 2 1 1 1 2 1 1 2 2 1 1 3 2 1 2 1 2 1 2 2 2 1 2 3 2 1 3 1 2 1 3 2 2 1 3 3 2 2 1 1 2 2 1 2 2 2 1 3 2 2 2 1 2 2 2 2 2 2 2 3 2 2 3 1 2 2 3 2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4 5 3 4 5 4 4 5 5 5 5 1 1 5 1 2 5 1 3 5 1 4 5 1 5 5 2 1 5 2 2 5 2 3 5 2 4 5 2 5 5 3 1 5 3 2 5 3 3 5 3 4 5 3 5 5 4 1 5 4 2 5 4 3 5 4 4 5 4 5 5 5 1 5 5 2 5 5 3 5 5 4 5 5 5
5³ complete, frozen
Permutation with Repetition Visualizer › Deriving n^r
(3−1)! = 2 Press Play or Step to begin SOURCE (n = 3) 1 2 3 BUILD RING FIXED #2 #3 1
n = 3, idle, frozen
Circular Permutation Visualizer › Getting Started
(3−1)! = 2 Complete · 2 / 2 SOURCE (n = 3) 1 2 3 BUILD RING FIXED #2 #3 1 COMPLETED 2 / 2 1 2 3 1 3 2
n = 3 complete, frozen
Circular Permutation Visualizer › The Anchor
(4−1)! = 6 Complete · 6 / 6 SOURCE (n = 4) 1 2 3 4 BUILD RING FIXED #2 #3 #4 1 COMPLETED 6 / 6 1 2 3 4 1 2 4 3 1 3 2 4 1 3 4 2 1 4 2 3 1 4 3 2
n = 4 complete, frozen
Circular Permutation Visualizer › Adjusting n
(3−1)! = 2 Arrangements: 1 / 2 SOURCE (n = 3) 1 2 3 BUILD RING FIXED #2 #3 1 3 2 COMPLETED 1 / 2 1 2 3
n = 3 mid-build, frozen
Circular Permutation Visualizer › The Build Ring
(5−1)! = 24 Complete · 24 / 24 SOURCE (n = 5) 1 2 3 4 5 BUILD RING FIXED #2 #3 #4 #5 1 COMPLETED 24 / 24 1 2 3 4 5 1 2 3 5 4 1 2 4 3 5 1 2 4 5 3 1 2 5 3 4 1 2 5 4 3 1 3 2 4 5 1 3 2 5 4 1 3 4 2 5 1 3 4 5 2 1 3 5 2 4 1 3 5 4 2 1 4 2 3 5 1 4 2 5 3 1 4 3 2 5 1 4 3 5 2 1 4 5 2 3 1 4 5 3 2 1 5 2 3 4 1 5 2 4 3 1 5 3 2 4 1 5 3 4 2 1 5 4 2 3 1 5 4 3 2
n = 5 complete, frozen
Circular Permutation Visualizer › The Completed Grid
C(3, 2) = 3 Press Play or Step to begin SOURCE (n = 3) 1 2 3 BUILD SET (size r = 2)
(n, r) = (3, 2), idle, frozen
Simple Combination Visualizer › Getting Started
C(3, 2) = 3 Group Blue: 0 / 1 SOURCE (n = 3) 1 2 3 BUILD SET (size r = 2) 2 3 COMPLETED 2 / 3 1 1 2 1 3 2
(3, 2) mid-build, frozen
Simple Combination Visualizer › The Build Set
C(5, 2) = 10 Complete · 10 / 10 SOURCE (n = 5) 1 2 3 4 5 BUILD SET (size r = 2) COMPLETED 10 / 10 1 1 2 1 3 1 4 1 5 2 2 3 2 4 2 5 3 3 4 3 5 4 4 5
C(5, 2) complete, frozen
Simple Combination Visualizer › Adjusting n and r
C(5, 3) = 10 Complete · 10 / 10 SOURCE (n = 5) 1 2 3 4 5 BUILD SET (size r = 3) COMPLETED 10 / 10 1 1 2 3 1 2 4 1 2 5 1 3 4 1 3 5 1 4 5 2 2 3 4 2 3 5 2 4 5 3 3 4 5
C(5, 3) complete, frozen
Simple Combination Visualizer › Grouping by Smallest Item
C(5, 5) = 1 Complete · 1 / 1 SOURCE (n = 5) 1 2 3 4 5 BUILD SET (size r = 5) COMPLETED 1 / 1 1 1 2 3 4 5
C(5, 5) complete, frozen
Simple Combination Visualizer › When r = n: One Subset
C(3, 2) = 3 Complete · 3 / 3 SOURCE (n = 3) 1 2 3 BUILD SET (size r = 2) COMPLETED 3 / 3 1 1 2 1 3 2 2 3
C(3, 2) complete, frozen
Simple Combination Visualizer › Deriving C(n,r)
4!/(2! · 2!) = 6 Press Play or Step to begin SOURCE (n = 4) 1 2 3 4 BUILD BOXES (2+2) BOX A (2) BOX B (2)
2+2, idle, frozen
Partition into Groups Visualizer › Getting Started
4!/(2! · 2!) = 6 Item 1 in Box A: 1 / 3 SOURCE (n = 4) 1 2 3 4 BUILD BOXES (2+2) BOX A (2) BOX B (2) 1 3 2 COMPLETED 1 / 6 → Box A 1 2 3 4
2+2 mid-build, frozen
Partition into Groups Visualizer › The Build Boxes
4!/(3! · 1!) = 4 Complete · 4 / 4 SOURCE (n = 4) 1 2 3 4 BUILD BOXES (3+1) BOX A (3) BOX B (1) COMPLETED 4 / 4 → Box A 1 2 3 4 1 2 4 3 1 3 4 2 → Box B 2 3 4 1
3+1 complete, frozen
Partition into Groups Visualizer › 3+1: A Combination in Disguise
5!/(4! · 1!) = 5 Complete · 5 / 5 SOURCE (n = 5) 1 2 3 4 5 BUILD BOXES (4+1) BOX A (4) BOX B (1) COMPLETED 5 / 5 → Box A 1 2 3 4 5 1 2 3 5 4 1 2 4 5 3 1 3 4 5 2 → Box B 2 3 4 5 1
4+1 complete, frozen
Partition into Groups Visualizer › 4+1: Choosing Who Stands Alone
5!/(3! · 2!) = 10 Complete · 10 / 10 SOURCE (n = 5) 1 2 3 4 5 BUILD BOXES (3+2) BOX A (3) BOX B (2) COMPLETED 10 / 10 → Box A 1 2 3 4 5 1 2 4 3 5 1 2 5 3 4 1 3 4 2 5 1 3 5 2 4 1 4 5 2 3 → Box B 2 3 4 1 5 2 3 5 1 4 2 4 5 1 3 3 4 5 1 2
3+2 complete, frozen
Partition into Groups Visualizer › 3+2: The Team Split
5!/(3! · 1! · 1!) = 20 Complete · 20 / 20 SOURCE (n = 5) 1 2 3 4 5 BUILD BOXES (3+1+1) BOX A (3) BOX B (1) BOX C (1) COMPLETED 20 / 20 → Box A 1 2 3 4 5 1 2 3 5 4 1 2 4 3 5 1 2 4 5 3 1 2 5 3 4 1 2 5 4 3 1 3 4 2 5 1 3 4 5 2 1 3 5 2 4 1 3 5 4 2 1 4 5 2 3 1 4 5 3 2 → Box B 2 3 4 1 5 2 3 5 1 4 2 4 5 1 3 3 4 5 1 2 → Box C 2 3 4 5 1 2 3 5 4 1 2 4 5 3 1 3 4 5 2 1
3+1+1 complete, frozen
Partition into Groups Visualizer › 3+1+1: Equal Boxes and the Labeled Convention
5!/(2! · 2! · 1!) = 30 Complete · 30 / 30 SOURCE (n = 5) 1 2 3 4 5 BUILD BOXES (2+2+1) BOX A (2) BOX B (2) BOX C (1) COMPLETED 30 / 30 → Box A 1 2 3 4 5 1 2 3 5 4 1 2 4 5 3 1 3 2 4 5 1 3 2 5 4 1 3 4 5 2 1 4 2 3 5 1 4 2 5 3 1 4 3 5 2 1 5 2 3 4 1 5 2 4 3 1 5 3 4 2 → Box B 2 3 1 4 5 2 3 1 5 4 2 4 1 3 5 2 4 1 5 3 2 5 1 3 4 2 5 1 4 3 3 4 1 2 5 3 4 1 5 2 3 5 1 2 4 3 5 1 4 2 4 5 1 2 3 4 5 1 3 2 → Box C 2 3 4 5 1 2 4 3 5 1 2 5 3 4 1 3 4 2 5 1 3 5 2 4 1 4 5 2 3 1
2+2+1 complete, frozen
Partition into Groups Visualizer › 2+2+1: The Largest Run
4!/(2! · 1! · 1!) = 12 Complete · 12 / 12 SOURCE (n = 4) 1 2 3 4 BUILD BOXES (2+1+1) BOX A (2) BOX B (1) BOX C (1) COMPLETED 12 / 12 → Box A 1 2 3 4 1 2 4 3 1 3 2 4 1 3 4 2 1 4 2 3 1 4 3 2 → Box B 2 3 1 4 2 4 1 3 3 4 1 2 → Box C 2 3 4 1 2 4 3 1 3 4 2 1
2+1+1 complete, frozen
Partition into Groups Visualizer › Grouping by Item-1 Destination
4!/(2! · 2!) = 6 Complete · 6 / 6 SOURCE (n = 4) 1 2 3 4 BUILD BOXES (2+2) BOX A (2) BOX B (2) COMPLETED 6 / 6 → Box A 1 2 3 4 1 3 2 4 1 4 2 3 → Box B 2 3 1 4 2 4 1 3 3 4 1 2
2+2 complete, frozen
Partition into Groups Visualizer › Deriving the Multinomial Coefficient
3³ = 27 Press Play or Step to begin ITEMS TO PLACE (n = 3) 1 2 3 CELLS (k = 3) Cell 1 Cell 2 Cell 3 assignment: ( ? , ? , ? ) (item 1 → cell c₁, item 2 → cell c₂, …) Each of n = 3 items independently picks 1 of k = 3 cells: 3³ = 3 × 3 × 3 = 27
(n, k) = (3, 3), idle, frozen
Distribution into Cells Visualizer › Getting Started
3³ = 27 Cell 1: 1 / 9 ITEMS TO PLACE (n = 3) 1 2 3 CELLS (k = 3) Cell 1 Cell 2 Cell 3 1 2 3 assignment: ( 1 , 1 , ? ) (item 1 → cell c₁, item 2 → cell c₂, …) Each of n = 3 items independently picks 1 of k = 3 cells: 3³ = 3 × 3 × 3 = 27 COMPLETED 1 / 27 item 1 → Cell 1 1 2 3 (1,1,1)
(3, 3) mid-build, frozen
Distribution into Cells Visualizer › The Cells
3³ = 27 Complete · 27 / 27 ITEMS TO PLACE (n = 3) 1 2 3 CELLS (k = 3) Cell 1 Cell 2 Cell 3 assignment: ( ? , ? , ? ) (item 1 → cell c₁, item 2 → cell c₂, …) Each of n = 3 items independently picks 1 of k = 3 cells: 3³ = 3 × 3 × 3 = 27 COMPLETED 27 / 27 item 1 → Cell 1 1 2 3 (1,1,1) 1 2 3 (1,1,2) 1 2 3 (1,1,3) 1 3 2 (1,2,1) 1 2 3 (1,2,2) 1 2 3 (1,2,3) 1 3 2 (1,3,1) 1 3 2 (1,3,2) 1 2 3 (1,3,3) item 1 → Cell 2 2 3 1 (2,1,1) 2 1 3 (2,1,2) 2 1 3 (2,1,3) 3 1 2 (2,2,1) 1 2 3 (2,2,2) 1 2 3 (2,2,3) 3 1 2 (2,3,1) 1 3 2 (2,3,2) 1 2 3 (2,3,3) item 1 → Cell 3 2 3 1 (3,1,1) 2 3 1 (3,1,2) 2 1 3 (3,1,3) 3 2 1 (3,2,1) 2 3 1 (3,2,2) 2 1 3 (3,2,3) 3 1 2 (3,3,1) 3 1 2 (3,3,2) 1 2 3 (3,3,3)
3³ complete, frozen
Distribution into Cells Visualizer › Grouping by Item 1's Destination
2³ = 8 Complete · 8 / 8 ITEMS TO PLACE (n = 3) 1 2 3 CELLS (k = 2) Cell 1 Cell 2 assignment: ( ? , ? , ? ) (item 1 → cell c₁, item 2 → cell c₂, …) Each of n = 3 items independently picks 1 of k = 2 cells: 2³ = 2 × 2 × 2 = 8 COMPLETED 8 / 8 item 1 → Cell 1 1 2 3 (1,1,1) 1 2 3 (1,1,2) 1 3 2 (1,2,1) 1 2 3 (1,2,2) item 1 → Cell 2 2 3 1 (2,1,1) 2 1 3 (2,1,2) 3 1 2 (2,2,1) 1 2 3 (2,2,2)
2³ complete, frozen
Distribution into Cells Visualizer › Two Cells: Binary Choices
4² = 16 Complete · 16 / 16 ITEMS TO PLACE (n = 2) 1 2 CELLS (k = 4) Cell 1 Cell 2 Cell 3 Cell 4 assignment: ( ? , ? ) (item 1 → cell c₁, item 2 → cell c₂, …) Each of n = 2 items independently picks 1 of k = 4 cells: 4² = 4 × 4 = 16 COMPLETED 16 / 16 item 1 → Cell 1 1 2 (1,1) 1 2 (1,2) 1 2 (1,3) 1 2 (1,4) item 1 → Cell 2 2 1 (2,1) 1 2 (2,2) 1 2 (2,3) 1 2 (2,4) item 1 → Cell 3 2 1 (3,1) 2 1 (3,2) 1 2 (3,3) 1 2 (3,4) item 1 → Cell 4 2 1 (4,1) 2 1 (4,2) 2 1 (4,3) 1 2 (4,4)
4² complete, frozen
Distribution into Cells Visualizer › More Cells Than Items
3⁴ = 81 Complete · 81 / 81 ITEMS TO PLACE (n = 4) 1 2 3 4 CELLS (k = 3) Cell 1 Cell 2 Cell 3 assignment: ( ? , ? , ? , ? ) (item 1 → cell c₁, item 2 → cell c₂, …) Each of n = 4 items independently picks 1 of k = 3 cells: 3⁴ = 3 × 3 × 3 × 3 = 81 COMPLETED 81 / 81 item 1 → Cell 1 1 2 3 4 (1,1,1,1) 1 2 3 4 (1,1,1,2) 1 2 3 4 (1,1,1,3) 1 2 4 3 (1,1,2,1) 1 2 3 4 (1,1,2,2) 1 2 3 4 (1,1,2,3) 1 2 4 3 (1,1,3,1) 1 2 4 3 (1,1,3,2) 1 2 3 4 (1,1,3,3) 1 3 4 2 (1,2,1,1) 1 3 2 4 (1,2,1,2) 1 3 2 4 (1,2,1,3) 1 4 2 3 (1,2,2,1) 1 2 3 4 (1,2,2,2) 1 2 3 4 (1,2,2,3) 1 4 2 3 (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 4 (3,2,3,3) 3 4 1 2 (3,3,1,1) 3 4 1 2 (3,3,1,2) 3 1 2 4 (3,3,1,3) 4 3 1 2 (3,3,2,1) 3 4 1 2 (3,3,2,2) 3 1 2 4 (3,3,2,3) 4 1 2 3 (3,3,3,1) 4 1 2 3 (3,3,3,2) 1 2 3 4 (3,3,3,3)
3⁴ complete, frozen
Distribution into Cells Visualizer › Deriving k^n
C(6, 2) = 15 Press Play or Step to begin BARS TO PLACE (k − 1 = 2) STRIP (n + k − 1 = 6 cells) 1 2 3 4 5 6 1 1 1 1 x₁ = ? x₂ = ? x₃ = ? composition: ( ? , ? , ? ) ⇔ bar positions: { ? , ? } Choose k − 1 = 2 bar positions out of n + k − 1 = 6 cells: C(6, 2) = 6!/(2! · 4!) = 720/(2·24) = 15
(n, k) = (4, 3), idle, frozen
Weak Composition Visualizer › Getting Started
C(6, 2) = 15 x₁ = 0: 1 / 5 BARS TO PLACE (k − 1 = 2) STRIP (n + k − 1 = 6 cells) 1 2 3 4 5 6 1 1 1 1 x₁ = 0 x₂ = ? x₃ = ? composition: ( 0 , ? , ? ) ⇔ bar positions: { 1 , ? } Choose k − 1 = 2 bar positions out of n + k − 1 = 6 cells: C(6, 2) = 6!/(2! · 4!) = 720/(2·24) = 15 COMPLETED 1 / 15 x₁ = 0 1 1 1 1 (0, 0, 4)
(4, 3) mid-build, frozen
Weak Composition Visualizer › The Strip and Bars
C(6, 2) = 15 Complete · 15 / 15 BARS TO PLACE (k − 1 = 2) STRIP (n + k − 1 = 6 cells) 1 2 3 4 5 6 1 1 1 1 x₁ = 4 x₂ = 0 x₃ = 0 composition: ( 4 , 0 , 0 ) ⇔ bar positions: { 5 , 6 } Choose k − 1 = 2 bar positions out of n + k − 1 = 6 cells: C(6, 2) = 6!/(2! · 4!) = 720/(2·24) = 15 COMPLETED 15 / 15 x₁ = 0 1 1 1 1 (0, 0, 4) 1 1 1 1 (0, 1, 3) 1 1 1 1 (0, 2, 2) 1 1 1 1 (0, 3, 1) 1 1 1 1 (0, 4, 0) x₁ = 1 1 1 1 1 (1, 0, 3) 1 1 1 1 (1, 1, 2) 1 1 1 1 (1, 2, 1) 1 1 1 1 (1, 3, 0) x₁ = 2 1 1 1 1 (2, 0, 2) 1 1 1 1 (2, 1, 1) 1 1 1 1 (2, 2, 0) x₁ = 3 1 1 1 1 (3, 0, 1) 1 1 1 1 (3, 1, 0) x₁ = 4 1 1 1 1 (4, 0, 0)
C(6, 2) complete, frozen
Weak Composition Visualizer › Grouping by First-Bin Count
C(8, 3) = 56 Complete · 56 / 56 BARS TO PLACE (k − 1 = 3) STRIP (n + k − 1 = 8 cells) 1 2 3 4 5 6 7 8 1 1 1 1 1 x₁ = 5 x₂ = 0 x₃ = 0 x₄ = 0 composition: ( 5 , 0 , 0 , 0 ) ⇔ bar positions: { 6 , 7 , 8 } Choose k − 1 = 3 bar positions out of n + k − 1 = 8 cells: C(8, 3) = 8!/(3! · 5!) = 40320/(6·120) = 56 COMPLETED 56 / 56 x₁ = 0 1 1 1 1 1 (0, 0, 0, 5) 1 1 1 1 1 (0, 0, 1, 4) 1 1 1 1 1 (0, 0, 2, 3) 1 1 1 1 1 (0, 0, 3, 2) 1 1 1 1 1 (0, 0, 4, 1) 1 1 1 1 1 (0, 0, 5, 0) 1 1 1 1 1 (0, 1, 0, 4) 1 1 1 1 1 (0, 1, 1, 3) 1 1 1 1 1 (0, 1, 2, 2) 1 1 1 1 1 (0, 1, 3, 1) 1 1 1 1 1 (0, 1, 4, 0) 1 1 1 1 1 (0, 2, 0, 3) 1 1 1 1 1 (0, 2, 1, 2) 1 1 1 1 1 (0, 2, 2, 1) 1 1 1 1 1 (0, 2, 3, 0) 1 1 1 1 1 (0, 3, 0, 2) 1 1 1 1 1 (0, 3, 1, 1) 1 1 1 1 1 (0, 3, 2, 0) 1 1 1 1 1 (0, 4, 0, 1) 1 1 1 1 1 (0, 4, 1, 0) 1 1 1 1 1 (0, 5, 0, 0) x₁ = 1 1 1 1 1 1 (1, 0, 0, 4) 1 1 1 1 1 (1, 0, 1, 3) 1 1 1 1 1 (1, 0, 2, 2) 1 1 1 1 1 (1, 0, 3, 1) 1 1 1 1 1 (1, 0, 4, 0) 1 1 1 1 1 (1, 1, 0, 3) 1 1 1 1 1 (1, 1, 1, 2) 1 1 1 1 1 (1, 1, 2, 1) 1 1 1 1 1 (1, 1, 3, 0) 1 1 1 1 1 (1, 2, 0, 2) 1 1 1 1 1 (1, 2, 1, 1) 1 1 1 1 1 (1, 2, 2, 0) 1 1 1 1 1 (1, 3, 0, 1) 1 1 1 1 1 (1, 3, 1, 0) 1 1 1 1 1 (1, 4, 0, 0) x₁ = 2 1 1 1 1 1 (2, 0, 0, 3) 1 1 1 1 1 (2, 0, 1, 2) 1 1 1 1 1 (2, 0, 2, 1) 1 1 1 1 1 (2, 0, 3, 0) 1 1 1 1 1 (2, 1, 0, 2) 1 1 1 1 1 (2, 1, 1, 1) 1 1 1 1 1 (2, 1, 2, 0) 1 1 1 1 1 (2, 2, 0, 1) 1 1 1 1 1 (2, 2, 1, 0) 1 1 1 1 1 (2, 3, 0, 0) x₁ = 3 1 1 1 1 1 (3, 0, 0, 2) 1 1 1 1 1 (3, 0, 1, 1) 1 1 1 1 1 (3, 0, 2, 0) 1 1 1 1 1 (3, 1, 0, 1) 1 1 1 1 1 (3, 1, 1, 0) 1 1 1 1 1 (3, 2, 0, 0) x₁ = 4 1 1 1 1 1 (4, 0, 0, 1) 1 1 1 1 1 (4, 0, 1, 0) 1 1 1 1 1 (4, 1, 0, 0) x₁ = 5 1 1 1 1 1 (5, 0, 0, 0)
C(8, 3) complete, frozen
Weak Composition Visualizer › Three Bars, Fifty-Six Ways
C(5, 1) = 5 Complete · 5 / 5 BARS TO PLACE (k − 1 = 1) STRIP (n + k − 1 = 5 cells) 1 2 3 4 5 1 1 1 1 x₁ = 4 x₂ = 0 composition: ( 4 , 0 ) ⇔ bar positions: { 5 } Choose k − 1 = 1 bar positions out of n + k − 1 = 5 cells: C(5, 1) = 5!/(1! · 4!) = 120/(1·24) = 5 COMPLETED 5 / 5 x₁ = 0 1 1 1 1 (0, 4) x₁ = 1 1 1 1 1 (1, 3) x₁ = 2 1 1 1 1 (2, 2) x₁ = 3 1 1 1 1 (3, 1) x₁ = 4 1 1 1 1 (4, 0)
C(5, 1) complete, frozen
Weak Composition Visualizer › The Stars-and-Bars Argument
C(4, 2) = 6 Press Play or Step to begin BARS TO PLACE (k − 1 = 2) ITEMS (n = 5) · GAPS (n − 1 = 4) 1 2 3 4 1 1 1 1 1 x₁ = ? x₂ = ? x₃ = ? composition: ( ? , ? , ? ) ⇔ chosen gaps: { ? , ? } Choose k − 1 = 2 gaps out of n − 1 = 4 gaps between items: C(4, 2) = 4!/(2! · 2!) = 24/(2·2) = 6
(n, k) = (5, 3), idle, frozen
Strong Composition Visualizer › Getting Started
C(4, 2) = 6 x₁ = 1: 1 / 3 BARS TO PLACE (k − 1 = 2) ITEMS (n = 5) · GAPS (n − 1 = 4) 1 2 3 4 1 1 1 1 1 x₁ = 1 x₂ = ? x₃ = ? composition: ( 1 , ? , ? ) ⇔ chosen gaps: { 1 , ? } Choose k − 1 = 2 gaps out of n − 1 = 4 gaps between items: C(4, 2) = 4!/(2! · 2!) = 24/(2·2) = 6 COMPLETED 1 / 6 x₁ = 1 1 1 1 1 1 (1, 1, 3)
(5, 3) mid-build, frozen
Strong Composition Visualizer › Items and Gaps
C(4, 2) = 6 Complete · 6 / 6 BARS TO PLACE (k − 1 = 2) ITEMS (n = 5) · GAPS (n − 1 = 4) 1 2 3 4 1 1 1 1 1 x₁ = 3 x₂ = 1 x₃ = 1 composition: ( 3 , 1 , 1 ) ⇔ chosen gaps: { 3 , 4 } Choose k − 1 = 2 gaps out of n − 1 = 4 gaps between items: C(4, 2) = 4!/(2! · 2!) = 24/(2·2) = 6 COMPLETED 6 / 6 x₁ = 1 1 1 1 1 1 (1, 1, 3) 1 1 1 1 1 (1, 2, 2) 1 1 1 1 1 (1, 3, 1) x₁ = 2 1 1 1 1 1 (2, 1, 2) 1 1 1 1 1 (2, 2, 1) x₁ = 3 1 1 1 1 1 (3, 1, 1)
C(4, 2) complete, frozen
Strong Composition Visualizer › Grouping by First-Bin Count
C(4, 1) = 4 Complete · 4 / 4 BARS TO PLACE (k − 1 = 1) ITEMS (n = 5) · GAPS (n − 1 = 4) 1 2 3 4 1 1 1 1 1 x₁ = 4 x₂ = 1 composition: ( 4 , 1 ) ⇔ chosen gaps: { 4 } Choose k − 1 = 1 gaps out of n − 1 = 4 gaps between items: C(4, 1) = 4!/(1! · 3!) = 24/(1·6) = 4 COMPLETED 4 / 4 x₁ = 1 1 1 1 1 1 (1, 4) x₁ = 2 1 1 1 1 1 (2, 3) x₁ = 3 1 1 1 1 1 (3, 2) x₁ = 4 1 1 1 1 1 (4, 1)
C(4, 1) complete, frozen
Strong Composition Visualizer › Two Bins, One Divider
C(6, 3) = 20 Complete · 20 / 20 BARS TO PLACE (k − 1 = 3) ITEMS (n = 7) · GAPS (n − 1 = 6) 1 2 3 4 5 6 1 1 1 1 1 1 1 x₁ = 4 x₂ = 1 x₃ = 1 x₄ = 1 composition: ( 4 , 1 , 1 , 1 ) ⇔ chosen gaps: { 4 , 5 , 6 } Choose k − 1 = 3 gaps out of n − 1 = 6 gaps between items: C(6, 3) = 6!/(3! · 3!) = 720/(6·6) = 20 COMPLETED 20 / 20 x₁ = 1 1 1 1 1 1 1 1 (1, 1, 1, 4) 1 1 1 1 1 1 1 (1, 1, 2, 3) 1 1 1 1 1 1 1 (1, 1, 3, 2) 1 1 1 1 1 1 1 (1, 1, 4, 1) 1 1 1 1 1 1 1 (1, 2, 1, 3) 1 1 1 1 1 1 1 (1, 2, 2, 2) 1 1 1 1 1 1 1 (1, 2, 3, 1) 1 1 1 1 1 1 1 (1, 3, 1, 2) 1 1 1 1 1 1 1 (1, 3, 2, 1) 1 1 1 1 1 1 1 (1, 4, 1, 1) x₁ = 2 1 1 1 1 1 1 1 (2, 1, 1, 3) 1 1 1 1 1 1 1 (2, 1, 2, 2) 1 1 1 1 1 1 1 (2, 1, 3, 1) 1 1 1 1 1 1 1 (2, 2, 1, 2) 1 1 1 1 1 1 1 (2, 2, 2, 1) 1 1 1 1 1 1 1 (2, 3, 1, 1) x₁ = 3 1 1 1 1 1 1 1 (3, 1, 1, 2) 1 1 1 1 1 1 1 (3, 1, 2, 1) 1 1 1 1 1 1 1 (3, 2, 1, 1) x₁ = 4 1 1 1 1 1 1 1 (4, 1, 1, 1)
C(6, 3) complete, frozen
Strong Composition Visualizer › Twenty Ways: The Largest Run
C(3, 3) = 1 Complete · 1 / 1 BARS TO PLACE (k − 1 = 3) ITEMS (n = 4) · GAPS (n − 1 = 3) 1 2 3 1 1 1 1 x₁ = 1 x₂ = 1 x₃ = 1 x₄ = 1 composition: ( 1 , 1 , 1 , 1 ) ⇔ chosen gaps: { 1 , 2 , 3 } Choose k − 1 = 3 gaps out of n − 1 = 3 gaps between items: C(3, 3) = 3!/(3! · 0!) = 6/(6·1) = 1 COMPLETED 1 / 1 x₁ = 1 1 1 1 1 (1, 1, 1, 1)
k = n complete, frozen
Strong Composition Visualizer › When k = n: The Forced Composition
n = 0 n = 1 n = 2 n = 3 n = 4 n = 5 n = 6 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 ROW 0 = COEFFICIENTS OF (a + b)⁰ (a + b)⁰ = 1
No selection, frozen
Pascal's Triangle Visualizer › Clicking Cells and Focus
n = 0 n = 1 n = 2 n = 3 n = 4 n = 5 n = 6 1 1 1 1 2 1 1 3 3 1 1 4 6 C(4, 2) 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 ROW 4 = COEFFICIENTS OF (a + b)⁴ (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴
Pascal’s identity on C(4, 2), frozen
Pascal's Triangle Visualizer › Mode 1 — Pascal's Identity
n = 0 n = 1 n = 2 n = 3 n = 4 n = 5 n = 6 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 C(5, 2) 10 5 1 1 6 15 20 15 6 1 ROW 5 = COEFFICIENTS OF (a + b)⁵ (a + b)⁵ = a⁵ + 5a⁴b + 10a³b² + 10a²b³ + 5ab⁴ + b⁵ Hockey stick on C(5, 2), frozen
Pascal's Triangle Visualizer › Mode 2 — Hockey Stick
n = 0 n = 1 n = 2 n = 3 n = 4 sum = 16 = 2⁴ n = 5 n = 6 1 1 1 1 2 1 1 3 3 1 1 4 6 C(4, 2) 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 ROW 4 = COEFFICIENTS OF (a + b)⁴ (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴
Row sum on row 4, frozen
Pascal's Triangle Visualizer › Mode 3 — Row Sum
n = 0 n = 1 n = 2 n = 3 n = 4 n = 5 n = 6 n = 7 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 C(7, 2) 35 35 21 7 1 ROW 7 = COEFFICIENTS OF (a + b)⁷ (a + b)⁷ = a⁷ + 7a⁶b + 21a⁵b² + 35a⁴b³ + 35a³b⁴ + 21a²b⁵ + 7ab⁶ + b⁷ Symmetry on C(7, 2), frozen
Pascal's Triangle Visualizer › Mode 4 — Symmetry