Pascal's triangle
Pascal's triangle is a triangular array of numbers in which each interior entry is the sum of the two entries directly above it.
Statistics Every Programmer Needs
Pascal's triangle is a triangular array of numbers in which each interior entry is the sum of the two entries directly above it.
- How it is used
- Uses a triangular lookup structure to count combinations without replacement in probability and combinatorics.
- How deep it goes
- Explains construction, row properties, positional lookup, and one worked count without developing a formal proof.
- Examples
- Demonstrates the sixth-row, fourth-position lookup for five choose three, producing 10 combinations.
- What you can do after
- Apply it to count combinations without replacement from n possibilities when selecting r items.
Read how Statistics Every Programmer Needs explains Pascal's triangle →
Learn C++ by Example
Pascal’s triangle is a triangular arrangement of numbers in which each interior entry is the sum of the two entries above it and the n-th row contains n numbers.
- How it is used
- Uses a mathematical pattern as a practical C++ exercise for vectors, ranges, output, and testing.
- How deep it goes
- Explains construction, combinations, vector-based generation, numeric limits, and property tests without developing deeper mathematics.
- Examples
- Uses coin-toss outcomes, adjacent-row calculations, C++ generation functions, and assertions over row properties.
- What you can do after
- Build it from scratch in C++ using vectors, generate rows, display results, and diagnose errors through assertions.
Related concepts
- combinationequivalent to · A combination is a selection of elements in which the order of selection does not matter.
- assertionmeasured by · A software assertion is an executable check of an expected condition or property that signals failure when the check does not hold.
- vectorused by · A vector is an ordered, indexed sequence of elements, often numerical, represented as a mathematical quantity or a computational collection.
- ranges APIused by · The C++ ranges API is a standard-library facility providing ranges, views, adaptors, and algorithms for processing sequences without explicit iterator pairs.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

