Where do binomial coefficients come from? Three views of the same idea: a decision tree that counts choice paths, a distribution that watches products land in buckets, and Pascal's triangle as a path counter. Flip between them — they all answer the same question.
n =
(a + b)3
(a + b)3 means multiplying 3 copies of (a + b). Each factor contributes either an a or a b — a binary choice. The tree shows all 23 = 8 ways to make those choices. Leaves group by how many b's they contain — group size = coefficient.
a3
aaa
paths landing here: 1
a2b
aab, aba, baa
paths landing here: 3
ab2
abb, bab, bba
paths landing here: 3
b3
bbb
paths landing here: 1
Multiplication never adds — it enumerates: the coefficient 3 exists because three distinct paths produce indistinguishable products. Learn more about the tree view · All three views
Binomial coefficient — the count (kn) (read "n choose k") of ways to choose k items from n distinct items, ignoring order. Equivalently, the coefficient of an−kbk in the expansion of (a+b)n.
Binomial theorem — the identity (a+b)n=∑k=0n(kn)an−kbk. Expresses any power of a binomial as a polynomial in a and b with binomial-coefficient weights.
Pascal's triangle — the triangular array whose row n, position k equals (kn). Each cell is the sum of the two cells immediately above it.
Pascal's rule — the identity (kn)=(k−1n−1)+(kn−1). The reason every cell in Pascal's triangle equals the sum of the two cells above.
Factorial formula — (kn)=k!(n−k)!n!. The closed-form expression for the binomial coefficient.
Decision tree — a binary tree of choices. The number of leaves with exactly k "right" branches equals (kn), giving a combinatorial reading of the formula.
Getting Started
The tool opens with n=3 loaded and the Decision Tree view active. The top of the workspace has three controls:
• View switcher — three tabs at the top: Decision Tree, Distribution, Pascal Paths. Each tab is a different lens on the same idea.
• n picker — a row of buttons numbered 1 through 5 with the formula (a+b)n displayed for the current value of n.
• Below the controls, the active view fills the workspace with its own visualization.
To explore quickly:
• Click between the three view tabs to see the same n from three angles.
• Click any n value to update all three views simultaneously.
• In the Decision Tree, hover any leaf or group card to highlight the matching paths.
• In the Distribution view, press Step or Auto-expand to fill the buckets one product at a time.
• In the Pascal Paths view, hover any cell to see every path from the top that lands there.
The Three Views
The same binomial coefficients are computed three different ways. Each view answers the question *where do the numbers in row n of Pascal's triangle come from?*
• Decision Tree — every path of length n in a binary tree corresponds to one term in the expansion. Leaves with the same b-count belong to the same like-term group. Group size equals the coefficient.
• Distribution — animates the actual multiplication. For each of the n factors (a+b), pick either a or b. Each of the 2n choice sequences produces one product. Products with the same exponents fall into the same bucket; the bucket count is the coefficient.
• Pascal Paths — Pascal's triangle reinterpreted as a path-counting grid. To reach cell (n,k) from the top, take n steps, k of them going right. The number of ways equals (kn).
The pedagogical payoff is the same coefficients appear in all three pictures — binomial coefficients are simultaneously a count, a polynomial coefficient, and a path count.
Decision Tree View
The Decision Tree view draws every length-n binary path from a single root. At each level, branches split into an a path (blue) and a b path (amber). After n levels, the tree has 2n leaves, each labeled with the sequence of choices that led to it.
Each leaf belongs to one of n+1groups, color-coded by how many b's the path contains. Below the tree, group cards summarize each:
• The term the group represents, like a2b or b3.
• The list of all paths landing in this group.
• A count: *paths landing here: N* — that's the coefficient.
Interaction:
• Hover a leaf to highlight the path from root to that leaf and dim every other leaf.
• Hover a group card to highlight all leaves and paths in that group at once.
The big insight: hover the middle group when n=4 and watch six different paths light up — that's why the coefficient of a2b2 is 6, not 1.
Decision Tree, n = 3, frozen
Eight leaves in four color groups, the group cards counting 1, 3, 3, 1 — coefficients as populations of paths.
The frozen frame above captures the default n=3 tree in full: eight leaves in four color groups, and the group cards doing the counting — 1,3,3,1. The deeper point the tree makes is about why multiplication produces coefficients at all: algebra never adds anything during expansion, it only enumerates. The coefficient 3 on a2b exists because three distinct histories (aab, aba, baa) produce indistinguishable products, and the tree is the only view where those histories remain visually separate.
The degenerate end of this picture — a tree with a single split — is worth a look of its own: the base case n = 1. And the same 8 histories reappear as delivery pellets in the Distribution view, collapsed into buckets the moment they land.
Distribution View
The Distribution view animates the actual multiplication of (a+b)n term by term. At the top, n factor boxes show the literal a+b that gets multiplied n times. As the animation runs:
• One pick per factor lights up: for each (a+b), either a or b is selected (highlighted blue).
• The current product (e.g., a⋅b⋅a=a2b) is shown below the factor row.
• The product lands as a pellet inside one of the n+1buckets below, grouped by the resulting term.
Three controls drive the animation:
• Step ▶ — deliver one product at a time. Useful for slow walkthroughs.
• Auto-expand / ⏸ Pause / Replay — continuous play at about 540 ms per product.
• ↺ Reset — clear the buckets and start over.
By the time all 2n products are delivered, each bucket holds exactly (kn) pellets. The final expansion box at the bottom lights up to show the resulting polynomial.
Distribution, n = 3, complete
All eight products delivered: the last pick b·b·b locked in the factors, pellets sorted into buckets, expansion lit.
The frame above freezes the finished run at n=3: the last product b⋅b⋅b locked in the factor boxes, eight pellets sorted 1+3+3+1 into their buckets, and the expansion line lit. Where the tree shows the choice structure, this view shows the choice process — the same 2n sequences arriving one at a time, which is exactly what "multiplying out the brackets" means when done honestly.
The pellets keep their identity inside the buckets (each is labeled with its history, aab or bba), so the frozen frame doubles as a proof that no product was lost or double-counted: eight sequences in, eight pellets out. The Pascal Paths view then abandons the products entirely and keeps only the counting.
Pascal Paths View
The Pascal Paths view renders rows 0 through n of Pascal's triangle as a graph: cells are circles labeled with the binomial coefficient values, and gray lines connect each cell to the two cells below.
The interaction is the key feature: hover any cell and the tool draws every path from the apex to that cell. To reach cell (n,k), you take n steps total, k of which are right-moves; the number of such paths is exactly (kn), which is the cell's value.
Two side cards update with the hover:
• Selected Cell — shows row, column, the value C(n,k), and the number of highlighted paths.
• Why C(n, k)? — explains that the path count equals n!/(k!⋅(n−k)!) — choosing which k of the n steps go right.
Below the triangle, a note reminds you that every cell's value equals the sum of the two cells above — that's Pascal's rule, which is the same as saying *paths arriving here = paths from the left parent + paths from the right parent*.
Pascal Paths, cell (3, 1) engaged
Three amber routes from the apex to the value 3 — the coefficient counted as paths, letters gone entirely.
The frozen frame engages the hover the way a visitor would: cell (3,1) selected, its three paths fanned out in amber from the apex, the touched cells tinted. Three paths, coefficient 3 — the same number the tree counted as leaves and the distribution counted as pellets, now counted as routes.
This is the most abstract of the three views, and the most powerful: the letters a and b are gone entirely, leaving pure combinatorics. Every left-move is "choose a", every right-move "choose b" — the correspondence that makes all three views one theorem. For the triangle at full size, with C(5,2)=10 paths crowding the frame, see the fifth row.
Adjusting n
The n picker offers five values:
• n = 1: (a+b)1=a+b. Two terms, two leaves, a one-row Pascal triangle (after the apex) — the base case.
• n = 2: (a+b)2=a2+2ab+b2. Four leaves, three groups, classic FOIL.
• n = 3: (a+b)3=a3+3a2b+3ab2+b3. Eight leaves, four groups. The default load.
• n = 4: (a+b)4 has 16 leaves and five groups with coefficients 1,4,6,4,1.
• n = 5: (a+b)5 has 32 leaves and six groups with coefficients 1,5,10,10,5,1. The most complex view the tool supports visually — the fifth row.
Changing n resets all three views simultaneously. The formula readout in the top-right of the n-picker bar updates to (a+b)n for the new value. The visual cap at n=5 keeps the decision tree and Pascal triangle readable; the underlying coefficients can be computed for any n using the factorial formula.
The Base Case n = 1
Set n=1 in the Decision Tree view and the whole apparatus shrinks to its atom: one split, two leaves (a and b), two groups of size one, and the expansion (a+b)1=a+b.
Decision Tree, n = 1, frozen
The atom of the whole tool: one split, two leaves, coefficients 1, 1 — every claim checkable by eye.
Trivial cases earn their sections by calibrating everything else. Here the tree is one binary choice, so every claim the tool makes becomes checkable by eye: 21=2 leaves, coefficients 1,1 matching row 1 of Pascal's triangle, and group size equal to path count because each group holds exactly one path.
The base case is also the induction seed the other frames grow from: the n=3 tree is this split repeated at every node, three levels deep. Read them in sequence — this frame, then the full Decision Tree view — and the doubling 2→4→8 that produces the 2n law is visible as pure branching.
The Fifth Row
The other extreme: n=5 in the Pascal Paths view, frozen with cell (5,2) engaged — ten amber paths converging on the value 10, the largest coefficient the tool displays.
Pascal Paths, cell (5, 2) engaged
Ten overlapping routes converge on 10 — the point where enumeration fails the eye and the factorial formula takes over.
Ten paths is where counting by eye starts to fail, which is precisely the frame's point: the coefficient 10 is no longer surveyable as a picture, but it is still computable as C(5,2)=5!/(2!⋅3!) — the moment the formula earns its keep over enumeration. The fan of overlapping routes conveys the growth honestly: rows sum to 2n, and by row five that is already 32.
The frame also shows why the tool caps at n=5: another row would double the path counts again and the visualization would stop informing. The cap is not a limitation of the mathematics — the factorial formula continues indefinitely — but an honest boundary of what pictures can teach. Beyond it, the Pascal Paths view's ideas carry on symbolically.
Reading the Coefficients
Across all three views, the coefficient sequence for (a+b)n is the same: row n of Pascal's triangle. Reading from k=0 to k=n:
• Row 0: 1
• Row 1: 1,1
• Row 2: 1,2,1
• Row 3: 1,3,3,1
• Row 4: 1,4,6,4,1
• Row 5: 1,5,10,10,5,1
The symmetry (kn)=(n−kn) shows up as left-right symmetry in every row. The end values are always (0n)=(nn)=1, because there's exactly one path with no b's (all a's) and one with all b's.
The sum of each row equals 2n, the total number of leaves in the decision tree. This is the identity ∑k=0n(kn)=2n — visible directly as "total leaves = sum of group sizes."
What Are Binomial Coefficients
Binomial coefficients are the numbers (kn) that appear when you expand (a+b)n. They have three equivalent definitions, each emphasized by one of the tool's views.
Combinatorial.(kn) counts the number of ways to choose a subset of size k from a set of n distinct items, ignoring order. Equivalently, the number of length-n binary strings with exactly k ones.
Algebraic.(kn) is the coefficient of an−kbk in the expansion of (a+b)n. The binomial theorem states:
(a+b)n=k=0∑n(kn)an−kbk
Recursive.(kn) equals the sum of (k−1n−1) and (kn−1), with boundary values (0n)=(nn)=1. This is Pascal's rule, which gives the triangle its construction.
All three definitions agree because they all count the same thing: ways to mark k slots out of n.
For deeper coverage, see the binomial theorem section in the algebra theory pages.
C(n,k) Formula and Pascal's Rule
The closed-form formula for the binomial coefficient is:
(kn)=k!(n−k)!n!
The factorial n! counts ordered arrangements of all n items. Dividing by k! removes the order within the chosen group; dividing by (n−k)! removes the order within the unchosen group. What remains is the count of unordered subsets of size k.
Pascal's rule gives a recursive shortcut:
(kn)=(k−1n−1)+(kn−1)
The combinatorial reading: to choose k items from n, either include the last item (then choose k−1 from the first n−1) or exclude it (then choose k from the first n−1). The path-counting reading: to reach cell (n,k), arrive from the left parent (n−1,k−1) or the right parent (n−1,k).
The triangle's rows are built up using this rule alone: start with (00)=1, and every row below is generated by adjacent sums.
Related Concepts
Binomial theorem — the identity that names the coefficients. Generalizes to non-integer and negative exponents through the generalized binomial series.
Multinomial coefficients — generalize to more than two terms: (k1,k2,…,kmn) counts ways to split n items into groups of given sizes. Appears in the expansion of (x1+x2+⋯+xm)n.
Combinations and permutations — the two foundational counting concepts. Binomial coefficients are exactly combinations: (kn)=C(n,k).
Polynomial multiplication — binomial expansion is a special case. The multiplication grid for (a+b)⋅(a+b) has four cells; for (a+b)n the grid is n-dimensional, and the diagonals collect like terms.
Probability — binomial coefficients drive the binomial distribution: P(X=k)=(kn)pk(1−p)n−k. The same (kn) that appears in (a+b)n counts the success patterns.
Catalan numbers and other combinatorial sequences — many counting sequences are built from binomial coefficients via simple combinations.
Algebra calculator — for symbolic expansions of (a+b)n at arbitrary n, see the binomial expansion calculator in the algebra calculators section.