Pascal's triangle is one of the most useful patterns in mathematics: a simple triangular array built by addition that quietly encodes binomial coefficients, combinations, and even the coin-flip probability distribution. This calculator generates the triangle to any number of rows, looks up a single entry exactly, and confirms that every row sums to a power of two.
How the triangle is built
Pascal's triangle starts with a single 1 in row 0. Every row after that begins and ends with 1, and every interior entry is the sum of the two entries diagonally above it in the previous row. Row 1 is 1, 1. Row 2 is 1, 2, 1 (2 = 1+1). Row 3 is 1, 3, 3, 1 (each 3 = 1+2). This addition rule is equivalent to the binomial coefficient formula C(n,k) = C(nβ1,kβ1) + C(nβ1,k), which is exactly Pascal's rule.
This calculator does not rely on repeated addition to build large rows β it computes each entry directly as C(row, position) using an exact BigInt multiplicative formula, so generating row 29 is just as precise as generating row 2.
Why the binomial coefficient matters
C(n,k), read "n choose k," counts the number of ways to select an unordered group of k items from n distinct items. It shows up constantly: in probability (the odds of getting exactly k heads in n coin flips), in algebra (the coefficients of a binomial expansion like (x+y)βΏ), and in combinatorics problems like counting lottery tickets, poker hands, or committee assignments.
Because C(n,k) can be computed with a plain factorial formula n!/(k!(nβk)!), it's tempting to implement it with floating-point factorials β but factorials overflow past about 170! in standard double-precision math. This calculator avoids that entirely by using BigInt integer arithmetic throughout, so results for n in the hundreds stay exact rather than silently becoming Infinity or losing precision.
Limits and edge cases
The Triangle tab is capped at 30 rows to keep the grid legible β beyond that, entries get so large that the triangle becomes unreadable even though the underlying math stays exact. The Single Entry and Row Sums tabs accept much larger n since they only need to display one or a handful of values; very large results are shown truncated (headβ¦tail with a digit count) rather than as an unreadable wall of digits.
k must always be between 0 and n inclusive β C(n,k) is defined to be 0 outside that range, but this calculator flags it as an invalid input instead of silently returning zero, since an out-of-range k is almost always a typo.