A Plinko board looks chaotic. A ball drops in at the top, bounces off one peg per row, and lands in one of the slots at the bottom. But the slot it lands in follows one of the best-known distributions in probability, and Pascal's triangle is enough to derive it.

This post derives the math, then checks it with a short JavaScript simulation. Every code block below is part of one script: paste them into a single .mjs file in order and node prints exactly the output shown.

The model

A digital Plinko board with n rows of pegs makes n decisions. At each row the ball goes left or right, each with probability ½, independently of every other row.

The slot at the bottom is decided by one number: how many times the ball went right. Zero rights puts it in the leftmost slot, n rights in the rightmost. So an n-row board has n + 1 slots, numbered 0 to n here. (This is the classic off-by-one: 8 rows, 9 slots.)

That is exactly the definition of a binomial random variable. If K is the slot number:

K ~ Binomial(n, ½) P(K = k) = C(n, k) / 2^n 

C(n, k) is the number of different paths with exactly k right bounces, and each of the 2^n paths is equally likely.

A physical board, like the Galton board that is its mathematical ancestor, only approximates this: the ball has momentum and the pegs aren't perfect. A digital board can draw the n bounces as fair coin flips, so for it the formula is exact.

Pascal's triangle is the path count

Row n of Pascal's triangle lists C(n, 0) … C(n, n). Each entry is the sum of the two above it, and that's the same rule as the board: the number of ways to reach a peg is the number of ways to reach the peg above-left plus the number of ways to reach the peg above-right.

You don't need to build the whole triangle to get one row. Each entry follows from the one before it:

C(n, k + 1) = C(n, k) · (n − k) / (k + 1) 
// Row n of Pascal's triangle: C(n, 0) … C(n, n). function pascalRow(n) { const row = [1]; for (let k = 0; k < n; k++) row.push((row[k] * (n - k)) / (k + 1)); return row; } // Slot k (counted from the left, 0 … n) is reached by exactly k right bounces. function slotProbabilities(n) { return pascalRow(n).map((c) => c / 2 ** n); } 

The division is always exact in principle, because C(n, k) · (n − k) is always divisible by k + 1. In practice a JavaScript number holds integers exactly only up to 2^53, and the product row[k] * (n - k) passes that at n = 55, where one entry comes out as 3560597348629859.5. Up to n = 54 every entry is exact; beyond that, use BigInt. Plinko boards are 8 to 16 rows, so plain numbers are fine here.

Simulating the board

The simulation is the model, written out: n coin flips per ball, count the rights.

// Small seeded PRNG (mulberry32), so every run prints the same numbers. function mulberry32(seed) { return function () { seed |= 0; seed = (seed + 0x6d2b79f5) | 0; let t = Math.imul(seed ^ (seed >>> 15), 1 | seed); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; } // Drop `balls` balls down an n-row board and count where they land. function simulate(n, balls, seed = 42) { const random = mulberry32(seed); const counts = new Array(n + 1).fill(0); for (let i = 0; i < balls; i++) { let slot = 0; for (let row = 0; row < n; row++) if (random() < 0.5) slot++; counts[slot]++; } return counts; } 

Math.random() would work just as well for the statistics; the seed only makes the output reproducible.

Exact vs simulated, 8 rows

One million balls on an 8-row board:

const n = 8; const balls = 1_000_000; const paths = pascalRow(n); const exact = slotProbabilities(n); const counts = simulate(n, balls); console.log("slot C(8,k) exact simulated"); exact.forEach((p, k) => { const pct = (x) => (x * 100).toFixed(4).padStart(9) + "%"; console.log(String(k).padStart(4), String(paths[k]).padStart(7), pct(p), pct(counts[k] / balls)); }); 
slot C(8,k) exact simulated 0 1 0.3906% 0.3904% 1 8 3.1250% 3.1268% 2 28 10.9375% 10.9676% 3 56 21.8750% 21.8064% 4 70 27.3438% 27.3793% 5 56 21.8750% 21.8744% 6 28 10.9375% 10.9235% 7 8 3.1250% 3.1418% 8 1 0.3906% 0.3898% 

"Close" isn't a test, so the next step is Pearson's chi-square statistic against the exact distribution:

// Pearson's chi-square statistic against the exact distribution. const chi2 = exact.reduce((s, p, k) => s + (counts[k] - balls * p) ** 2 / (balls * p), 0); console.log(`chi-square = ${chi2.toFixed(2)} on ${n} degrees of freedom`); 
chi-square = 4.55 on 8 degrees of freedom 

With 9 slots there are 8 degrees of freedom. The statistic's expected value is then 8, and the 5% critical value is about 15.51, so 4.55 is unremarkable: the simulation is consistent with the formula.

What the formula tells you about the board

A Binomial(n, ½) variable has mean n/2 and variance n/4, so its standard deviation is √n / 2. Computing those from the slot probabilities:

for (const rows of [8, 12, 16]) { const p = slotProbabilities(rows); const mean = p.reduce((s, q, k) => s + q * k, 0); const sd = Math.sqrt(p.reduce((s, q, k) => s + q * (k - mean) ** 2, 0)); // Share of balls within two standard deviations of the middle slot. const within = p.reduce((s, q, k) => s + (Math.abs(k - mean) <= 2 * sd ? q : 0), 0); console.log( `${rows} rows: ${rows + 1} slots, mean ${mean}, sd ${sd.toFixed(4)}, ` + `edge slot 1 in ${2 ** rows}, within 2 sd ${(within * 100).toFixed(2)}%`, ); } 
8 rows: 9 slots, mean 4, sd 1.4142, edge slot 1 in 256, within 2 sd 92.97% 12 rows: 13 slots, mean 6, sd 1.7321, edge slot 1 in 4096, within 2 sd 96.14% 16 rows: 17 slots, mean 8, sd 2.0000, edge slot 1 in 65536, within 2 sd 97.87% 

A few things fall out of this:

  • The edge slots get rare fast. Each edge needs every bounce to go the same way: 1 in 2^n. Going from 8 to 16 rows makes each edge slot 256 times rarer.
  • The spread grows more slowly than the board. The standard deviation grows with √n while the number of slots grows with n. On 16 rows, two standard deviations is exactly 4 slots, so the window is slots 4 to 12 (9 of the 17), and it catches about 98% of balls.
  • "Within 2 sd" isn't the 95.45% of a normal curve. The distribution is discrete, so the window grows a whole slot at a time. On 8 rows, 2 sd is 2.83 slots, the window is slots 2 to 6, and it holds 92.97%; 16 rows overshoots because its window edge falls exactly on a slot. The share keeps jumping around 95.45% and settles only for much larger n.

A pay table is a dot product

Many Plinko games put a multiplier under each slot. Once you have the slot probabilities, the expected value of a table is a weighted sum, Σ P(k) · m_k. Here's a symmetric 8-row table:

// One multiplier per slot, left to right. const payTable = [3.8, 1.6, 1.0, 1.0, 0.6, 1.0, 1.0, 1.6, 3.8]; const expected = slotProbabilities(8).reduce((s, p, k) => s + p * payTable[k], 0); console.log(`floating point: ${expected}`); // The same sum in integers: multipliers in tenths, probabilities in 256ths. const tenths = payTable.map((m) => Math.round(m * 10)); const sum = pascalRow(8).reduce((s, c, k) => s + c * tenths[k], 0); console.log(`integers: ${sum} / ${256 * 10} = ${sum / 2560}`); 
floating point: 0.9500000000000001 integers: 2432 / 2560 = 0.95 

The floating-point sum is off in the 16th digit, which is why the integer version is worth having: 2432 / 2560 is exactly 0.95. Whoever designs a table picks the multipliers; the binomial weights decide what they average to. Raising the edge multipliers and lowering the center ones can keep that average fixed while changing how often a ball lands on a slot worth more than 1×.

That table is the 8-row Low table from a free Plinko demo that runs in the browser, which our small team built. Its page lists the tables for 8, 12 and 16 rows with each slot's chance next to it, so you can check them against slotProbabilities.

Takeaways

  • An n-row board has n + 1 slots, and slot k has probability C(n, k) / 2^n.
  • One row of Pascal's triangle takes O(n) with C(n, k + 1) = C(n, k) · (n − k) / (k + 1), exact in plain numbers up to n = 54.
  • A simulation checks the math; a chi-square test tells you whether "close" is close enough.
  • A pay table's expected value is its dot product with that row.