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