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







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.

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).

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.

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.

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.

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.

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*.

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.

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: (nk1,k2,,km)\binom{n}{k_1, k_2, \dots, k_m} counts ways to split nn items into groups of given sizes. Appears in the expansion of (x1+x2++xm)n(x_1 + x_2 + \dots + x_m)^n.

Combinations and permutations — the two foundational counting concepts. Binomial coefficients are exactly combinations: (nk)=C(n,k)\binom{n}{k} = C(n, k).

Polynomial multiplication — binomial expansion is a special case. The multiplication grid for (a+b)(a+b)(a + b) \cdot (a + b) has four cells; for (a+b)n(a + b)^n the grid is nn-dimensional, and the diagonals collect like terms.

Probability — binomial coefficients drive the binomial distribution: P(X=k)=(nk)pk(1p)nkP(X = k) = \binom{n}{k} p^k (1 - p)^{n-k}. The same (nk)\binom{n}{k} that appears in (a+b)n(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(a + b)^n at arbitrary nn, see the binomial expansion calculator in the algebra calculators section.