Skip to content

Resource · Guide or article

Pascal's Triangle

Explains how Pascal's triangle is built from binomial coefficients and how to compute one row efficiently, a pattern that shows up in combinatorics coding questions.

Reviewed

Open the original: Pascal's Triangle (opens the original site in a new tab)

Add to a roadmap

Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.

Source content: English

In mathematics, Pascal's triangle is a triangular array of the binomial coefficients. The rows of Pascal's triangle are conventionally enumerated starting with row n = 0 at the top (the 0th row). The entries in each row are numbered from the left beginning with k = 0 and are usually staggered relative to the numbers in the adjacent rows. The triangle may be constructed in the following manner: In row 0 (the topmost row), there is a unique nonzero entry 1. Each entry of each subsequent row is constructed by adding the number above and to the left with the number above and to the right, treating blank entries as 0. For example, the initial number in the first (or any other) row is 1 (the sum of 0 and 1), whereas the numbers 1 and 3 in the third row are added to produce the number 4 in the fourth row. The entry in the nth row and kth column of Pascal's triangle is denoted . For example, the unique nonzero entry in the topmost row is .

PrepKit overview

PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.

Suited to
The source does not state a level
Format
Reference

What it covers

  • Construction rule: each entry is the sum of the two entries above it, with blanks treated as 0.
  • Formula section linking entries to binomial coefficients.
  • Calculating triangle entries in O(n) time: deriving C(n, i) from C(n, i - 1) in O(1) per step.

How to use it

PrepKit study advice, not a claim made by the source.

Generate row 10 two ways, by summing the previous row and by the C(n, i - 1) recurrence, and confirm both match.

Scope and limitations

Formulas appear as rendered images, and the page leans on Wikipedia and GeeksForGeeks links. No exercises.

Access and format

Read on GitHub; English README from the MIT-licensed trekhleb/javascript-algorithms project.

Reviewed by PrepKit on Oct 2, 2026. Listing source commit: 85293e3e2b88

Evidence behind this overview
  • src/algorithms/math/pascal-triangle/README.md

Pages that include this

Get the PrepKit newsletter

Optional. You don't need it to use PrepKit.

How we handle your email