Counting and Combinatorics

Pascal Triangle and Binomial Outcomes in Games

Use Pascal triangle to count how many ways repeated trials can produce a given number of successes, with coin, dice and attack-roll examples.

On this page
  1. Building the triangle
  2. What the entries count
  3. Why the middle is largest
  4. Adding probabilities when success is not 50 percent
  5. Using the triangle for sums of rows
  6. Limits of the method
  7. When the triangle runs out

Building the triangle

Pascal triangle is a simple pattern of numbers that happens to count things. Start with a 1 at the top. Each row below begins and ends with 1, and every other number is the sum of the two numbers directly above it.

The first rows look like this:

Row Entries
0 1
1 1, 1
2 1, 2, 1
3 1, 3, 3, 1
4 1, 4, 6, 4, 1
5 1, 5, 10, 10, 5, 1
6 1, 6, 15, 20, 15, 6, 1

In row 4, for example, the 6 is the sum of the 3 and 3 above it, and the 4 is the sum of 1 and 3.

What the entries count

The entry in row n at position k (counting from 0) is the number of ways to choose k items from n, usually called “n choose k”. The same number counts the sequences of n trials that contain exactly k successes.

Take four coin flips. Row 4 reads 1, 4, 6, 4, 1. There is 1 sequence with zero heads, 4 with one head, 6 with two heads, 4 with three heads and 1 with four heads. The row adds up to 16, which is 2^4, the total number of sequences. So the chance of exactly two heads is 6/16 = 0.375.

You can see why it works. Choosing which 2 of the 4 flips are heads is the same as choosing a pair from four positions, and there are 6 pairs. The triangle simply stores the answers to every such question.

Why the middle is largest

The numbers in each row rise toward the centre and fall away again. That is why results near the average are more likely than extreme ones. With six coin flips, row 6 gives 1, 6, 15, 20, 15, 6, 1 out of 64 sequences. Exactly three heads can happen in 20 ways, about 31 percent of the time, while all six heads can happen in only one way, about 1.6 percent.

It is a good illustration of why outcomes cluster around their expected value and why extreme runs, while possible, are rare. How strongly they cluster depends on the number of trials, a topic closely tied to the law of large numbers.

Adding probabilities when success is not 50 percent

Real game events are rarely 50/50, so we weight each count. If each trial succeeds with probability p and fails with probability 1 − p, then the chance of exactly k successes in n trials is:

(Pascal entry) × p^k × (1 − p)^(n − k)

The Pascal entry says how many sequences have k successes; the rest is the probability of any one such sequence, found with the multiplication rule.

Example: sixes in five rolls

What is the chance of exactly two sixes in five rolls of a fair die?

  • Pascal entry for row 5, position 2: 10.
  • Probability of one particular sequence with two sixes and three non-sixes: (1/6)^2 × (5/6)^3 = 1/36 × 125/216 = 125/7,776.
  • Multiply: 10 × 125/7,776 = 1,250/7,776, about 0.1607, or roughly 16.1 percent.

Example: three attacks at 50 percent

A character makes three attacks, each hitting half the time, independently. Row 3 is 1, 3, 3, 1 out of 8 sequences.

  • Zero hits: 1/8 = 12.5 percent
  • One hit: 3/8 = 37.5 percent
  • Two hits: 3/8 = 37.5 percent
  • Three hits: 1/8 = 12.5 percent

The chance of at least two hits is (3 + 1)/8 = 4/8 = 50 percent. The numbers are symmetric because success and failure are equally likely here. If the hit chance were 70 percent, the same counts would apply but the weights would shift toward more hits, and the symmetry would be lost.

Using the triangle for sums of rows

A few facts speed up calculations:

  • Each row sums to 2^n. This is the total number of success/failure sequences with n trials.
  • Rows are symmetric, so getting k successes is as numerous as getting n − k successes.
  • Adding the first few entries of a row counts “at most” cases, such as the number of ways to get no more than one hit.

This is also how you can build a quick table for dice pools, where you roll a handful of dice and count how many beat a target number. Each die is a success-or-fail trial, and the binomial weights give the whole distribution of successes.

Limits of the method

The binomial counting assumes three things:

  1. A fixed number of trials.
  2. Each trial has only two outcomes, success or failure.
  3. The probability of success is the same on every trial, and trials are independent.

If any assumption fails, the result changes. Drawing cards without replacement breaks independence, and the right model there is the hypergeometric distribution rather than the binomial one. A game that shifts your odds after each attempt breaks the constant-probability assumption.

When the triangle runs out

Pascal triangle is practical up to a dozen rows or so. Beyond that, people use the formula for “n choose k” or a spreadsheet function. To find the chance of a certain number of crits among many attacks, for instance, you would usually work out the table once and reuse it. The ideas remain the same at any size: count the sequences, weight each by its probability, and add up the cases you want.

The complete guide to counting and combinatorics

Counting Outcomes: A Beginner Guide to Combinatorics for Games
Read the guide

Keep exploring

Guides from other topics

All topics →