Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Binomial Coefficient Visualizer


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.
abababababababstartbbbbbababbaaabbabaaabaaa
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 33 exists because three distinct paths produce indistinguishable products. Learn more about the tree view · All three views







Key Terms

Binomial coefficient — the count (nk)\binom{n}{k} (read "n choose k") of ways to choose kk items from nn distinct items, ignoring order. Equivalently, the coefficient of ankbka^{n-k} b^k in the expansion of (a+b)n(a+b)^n.

Binomial theorem — the identity (a+b)n=k=0n(nk)ankbk(a+b)^n = \sum_{k=0}^{n} \binom{n}{k} a^{n-k} b^k. Expresses any power of a binomial as a polynomial in aa and bb with binomial-coefficient weights.

Pascal's triangle — the triangular array whose row nn, position kk equals (nk)\binom{n}{k}. Each cell is the sum of the two cells immediately above it.

Pascal's rule — the identity (nk)=(n1k1)+(n1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}. The reason every cell in Pascal's triangle equals the sum of the two cells above.

Factorial formula(nk)=n!k!(nk)!\binom{n}{k} = \dfrac{n!}{k! (n-k)!}. The closed-form expression for the binomial coefficient.

Decision tree — a binary tree of choices. The number of leaves with exactly kk "right" branches equals (nk)\binom{n}{k}, giving a combinatorial reading of the formula.

Getting Started

The tool opens with n=3n = 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(a+b)^n displayed for the current value of nn.

• 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 nn from three angles.

• Click any nn 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 nn of Pascal's triangle come from?*

Decision Tree — every path of length nn 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 nn factors (a+b)(a+b), pick either aa or bb. Each of the 2n2^n 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)(n, k) from the top, take nn steps, kk of them going right. The number of ways equals (nk)\binom{n}{k}.

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-nn binary path from a single root. At each level, branches split into an a path (blue) and a b path (amber). After nn levels, the tree has 2n2^n leaves, each labeled with the sequence of choices that led to it.

Each leaf belongs to one of n+1n + 1 groups, color-coded by how many bb's the path contains. Below the tree, group cards summarize each:

• The term the group represents, like a2ba^2 b or b3b^3.

• 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=4n = 4 and watch six different paths light up — that's why the coefficient of a2b2a^2 b^2 is 66, not 11.
abababababababstartaaaaababaabbbaababbbabbbaaapaths landing here: 1a²baab, aba, baapaths landing here: 3ab²abb, bab, bbapaths landing here: 3bbbpaths landing here: 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=3n = 3 tree in full: eight leaves in four color groups, and the group cards doing the counting — 1,3,3,11, 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 33 on a2ba^2b exists because three distinct histories (aabaab, abaaba, baabaa) 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(a+b)^n term by term. At the top, nn factor boxes show the literal a+ba + b that gets multiplied nn times. As the animation runs:

• One pick per factor lights up: for each (a+b)(a+b), either aa or bb is selected (highlighted blue).

• The current product (e.g., aba=a2ba \cdot b \cdot a = a^2 b) is shown below the factor row.

• The product lands as a pellet inside one of the n+1n + 1 buckets 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 2n2^n products are delivered, each bucket holds exactly (nk)\binom{n}{k} pellets. The final expansion box at the bottom lights up to show the resulting polynomial.
a+b·a+b·a+bb · b · b = b³ (8 / 8 delivered)aaacount: 1a²baabababaacount: 3ab²abbbabbbacount: 3bbbcount: 1(a + b)³ = a³ + 3a²b + 3ab² + b³
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=3n = 3: the last product bbbb \cdot b \cdot b locked in the factor boxes, eight pellets sorted 1+3+3+11{+}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 2n2^n 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, aabaab or bbabba), 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 nn 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)(n, k), you take nn steps total, kk of which are right-moves; the number of such paths is exactly (nk)\binom{n}{k}, which is the cell's value.

Two side cards update with the hover:

Selected Cell — shows row, column, the value C(n,k)C(n, k), and the number of highlighted paths.

Why C(n, k)? — explains that the path count equals n!/(k!(nk)!)n! / (k! \cdot (n-k)!) — choosing which kk of the nn 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*.
1111211331C(3, 1) = 3 — 3 paths from the top
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)(3, 1) selected, its three paths fanned out in amber from the apex, the touched cells tinted. Three paths, coefficient 33 — 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 aa and bb are gone entirely, leaving pure combinatorics. Every left-move is "choose aa", every right-move "choose bb" — the correspondence that makes all three views one theorem. For the triangle at full size, with C(5,2)=10C(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(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(a+b)^2 = a^2 + 2ab + b^2. Four leaves, three groups, classic FOIL.

n = 3: (a+b)3=a3+3a2b+3ab2+b3(a+b)^3 = a^3 + 3a^2 b + 3ab^2 + b^3. Eight leaves, four groups. The default load.

n = 4: (a+b)4(a+b)^4 has 16 leaves and five groups with coefficients 1,4,6,4,11, 4, 6, 4, 1.

n = 5: (a+b)5(a+b)^5 has 32 leaves and six groups with coefficients 1,5,10,10,5,11, 5, 10, 10, 5, 1. The most complex view the tool supports visually — the fifth row.

Changing nn resets all three views simultaneously. The formula readout in the top-right of the n-picker bar updates to (a+b)n(a+b)^n for the new value. The visual cap at n=5n = 5 keeps the decision tree and Pascal triangle readable; the underlying coefficients can be computed for any nn using the factorial formula.

The Base Case n = 1

Set n=1n = 1 in the Decision Tree view and the whole apparatus shrinks to its atom: one split, two leaves (aa and bb), two groups of size one, and the expansion (a+b)1=a+b(a+b)^1 = a + b.
abstartabaapaths landing here: 1bbpaths landing here: 1
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=22^1 = 2 leaves, coefficients 1,11, 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=3n = 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 2482 \to 4 \to 8 that produces the 2n2^n law is visible as pure branching.

The Fifth Row

The other extreme: n=5n = 5 in the Pascal Paths view, frozen with cell (5,2)(5, 2) engaged — ten amber paths converging on the value 1010, the largest coefficient the tool displays.
11112113311464115101051C(5, 2) = 10 — 10 paths from the top
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 1010 is no longer surveyable as a picture, but it is still computable as C(5,2)=5!/(2!3!)C(5,2) = 5!/(2! \cdot 3!) — the moment the formula earns its keep over enumeration. The fan of overlapping routes conveys the growth honestly: rows sum to 2n2^n, and by row five that is already 3232.

The frame also shows why the tool caps at n=5n = 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(a+b)^n is the same: row nn of Pascal's triangle. Reading from k=0k = 0 to k=nk = n:

Row 0: 11

Row 1: 1,11, 1

Row 2: 1,2,11, 2, 1

Row 3: 1,3,3,11, 3, 3, 1

Row 4: 1,4,6,4,11, 4, 6, 4, 1

Row 5: 1,5,10,10,5,11, 5, 10, 10, 5, 1

The symmetry (nk)=(nnk)\binom{n}{k} = \binom{n}{n-k} shows up as left-right symmetry in every row. The end values are always (n0)=(nn)=1\binom{n}{0} = \binom{n}{n} = 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 2n2^n, the total number of leaves in the decision tree. This is the identity k=0n(nk)=2n\sum_{k=0}^{n} \binom{n}{k} = 2^n — visible directly as "total leaves = sum of group sizes."

What Are Binomial Coefficients

Binomial coefficients are the numbers (nk)\binom{n}{k} that appear when you expand (a+b)n(a+b)^n. They have three equivalent definitions, each emphasized by one of the tool's views.

Combinatorial. (nk)\binom{n}{k} counts the number of ways to choose a subset of size kk from a set of nn distinct items, ignoring order. Equivalently, the number of length-nn binary strings with exactly kk ones.

Algebraic. (nk)\binom{n}{k} is the coefficient of ankbka^{n-k} b^k in the expansion of (a+b)n(a+b)^n. The binomial theorem states:

(a+b)n=k=0n(nk)ankbk(a+b)^n = \sum_{k=0}^{n} \binom{n}{k} \, a^{n-k} \, b^k


Recursive. (nk)\binom{n}{k} equals the sum of (n1k1)\binom{n-1}{k-1} and (n1k)\binom{n-1}{k}, with boundary values (n0)=(nn)=1\binom{n}{0} = \binom{n}{n} = 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 kk slots out of nn.

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:

(nk)=n!k!(nk)!\binom{n}{k} = \frac{n!}{k! \, (n - k)!}


The factorial n!n! counts ordered arrangements of all nn items. Dividing by k!k! removes the order within the chosen group; dividing by (nk)!(n - k)! removes the order within the unchosen group. What remains is the count of unordered subsets of size kk.

Pascal's rule gives a recursive shortcut:

(nk)=(n1k1)+(n1k)\binom{n}{k} = \binom{n - 1}{k - 1} + \binom{n - 1}{k}


The combinatorial reading: to choose kk items from nn, either include the last item (then choose k1k - 1 from the first n1n - 1) or exclude it (then choose kk from the first n1n - 1). The path-counting reading: to reach cell (n,k)(n, k), arrive from the left parent (n1,k1)(n - 1, k - 1) or the right parent (n1,k)(n - 1, k).

The triangle's rows are built up using this rule alone: start with (00)=1\binom{0}{0} = 1, and every row below is generated by adjacent sums.