A Pascal's triangle calculator builds the rows of Pascal's triangle, finds a single entry, and expands a binomial such as (x + y)⁶ using the numbers in a row. Choose what you want, enter how many rows or which row, and press the button. The entries are exact whole numbers, so even row 100 comes out right. The work is done in your browser.
How to use the Pascal's triangle calculator
- Choose The first rows, One row, One entry or Expand (x + y)ⁿ.
- Enter the number of rows, or n, and for an entry also k.
- Press Build.
How the triangle is built
The Wikipedia article on Pascal's triangle says that each number is the sum of the two numbers directly above it. The topmost row, with a single 1, is row 0, and rows and entries are numbered from 0.[1] The first rows are 1; 1 1; 1 2 1; 1 3 3 1; 1 4 6 4 1; 1 5 10 10 5 1; 1 6 15 20 15 6 1; and 1 7 21 35 35 21 7 1. Row 4 has the entries 1, 4, 6, 4 and 1, and row 6 has 1, 6, 15, 20, 15, 6 and 1, which you can check in the calculator. The edges are always 1, because each edge number has only one number above it.
Entries are binomial coefficients
The entry in row n at position k is the binomial coefficient, written n choose k, and it is equal to n! ÷ (k!(n − k)!).[1] The page calls the rule that each entry is the sum of the two above it Pascal's rule: C(n, k) = C(n − 1, k − 1) + C(n − 1, k).[1] The entry C(10, 3) is 10! ÷ (3! × 7!) = 120. The entry C(52, 5) is 2,598,960, which is the number of five-card hands that can be dealt from a deck of 52 cards. The entry mode of the calculator shows the formula it used.
The sum of a row
The page states that the sum of the elements of row n is 2ⁿ.[1] Row 5 is 1, 5, 10, 10, 5 and 1, and its sum is 32 = 2⁵. Row 10 sums to 1,024. This is because the two numbers below each entry both include it, so each row has twice the total of the row above it. The calculator shows the row sum with every row and entry, as a quick check on your own work.
The binomial theorem
The page explains that Pascal's triangle determines the coefficients that arise in binomial expansions: for (x + y)ⁿ, the coefficients are exactly the numbers in row n.[1] For n = 4, row 4 is 1, 4, 6, 4, 1, so (x + y)⁴ = x⁴ + 4x³y + 6x²y² + 4xy³ + y⁴. The powers of x go down from n to 0 and the powers of y go up from 0 to n, and the coefficients follow the row. The expand mode writes the whole expansion for n up to 15. If you need (x − y)ⁿ, alternate the signs of the terms, starting with a plus.
Patterns in the triangle
The page lists several patterns in the diagonals. The diagonals along the left and right edges contain only 1s. The next diagonals hold the natural numbers in order, and moving inwards the next pair of diagonals contain the triangular numbers in order.[1] In row 6, for example, the entries next to the edge are 6, and the entries after those are 15, which is the triangular number for 5. Looking for such patterns in the calculator's rows is a good way to learn how the triangle works.
Uses in counting and probability
Because each entry is a number of combinations, the triangle answers questions such as how many ways there are to choose 3 items from 10 (120). In probability, the entries of row n give the number of ways to get k heads in n coin flips, and dividing by 2ⁿ turns them into probabilities. In row 4 the entries 1, 4, 6, 4, 1 out of 16 say that two heads in four flips has a probability of 6 ÷ 16 = 37.5 percent.
Worked examples
To expand (x + y)⁶, use row 6, which is 1, 6, 15, 20, 15, 6, 1. The expansion is x⁶ + 6x⁵y + 15x⁴y² + 20x³y³ + 15x²y⁴ + 6xy⁵ + y⁶. To find how many ways there are to pick 2 people from a group of 8 for a committee, look up C(8, 2). Row 8 is 1, 8, 28, 56, 70, 56, 28, 8, 1, so the entry at position 2 is 28. The same number is C(8, 6), because each row reads the same forwards and backwards.
Large rows and exact numbers
The entries grow fast. Row 30 has a middle entry of 155,117,520, and row 100 has entries with more than 29 digits. Because the calculator uses exact whole numbers and not decimals, it shows every digit. Row 1,000 is allowed in the single entry mode. The row mode shows the first 30 entries of long rows with an ellipsis, so the screen stays readable, and the sum 2ⁿ stays exact.
The triangle in algebra and programming
Pascal's triangle appears in algebra whenever a binomial is raised to a power, and in programming whenever you need to count combinations without computing large factorials. The rule that each entry is the sum of two above it gives a fast way to fill a table by dynamic programming, using only additions. The calculator builds each row from the multiplicative formula instead, which is exact with whole numbers and does not need the earlier rows, so it can jump straight to row 500 or to any single entry.
Common mistakes
- Counting from 1. The top row is row 0, and the first entry of each row is position 0.
- Mixing up n and k. The entry C(n, k) needs k from 0 to n.
- Forgetting the signs in (x − y)ⁿ. The terms alternate in sign.
- Adding the wrong numbers. Each entry is the sum of the two directly above it.
What next
Use this often? Add Pascal's Tri to your Home screen.
Frequently asked questions
What is a Pascal's triangle calculator?
A tool that builds the rows of Pascal's triangle, finds individual entries, which are binomial coefficients, and expands binomials using a row.
How is Pascal's triangle built?
Start with a 1 at the top. Each number below is the sum of the two numbers directly above it, and the edges are all 1.
What is the entry in row 10 at position 3?
It is C(10, 3) = 10! ÷ (3! × 7!) = 120. Rows and positions are counted from 0.
What is the sum of row n?
It is 2ⁿ. Row 5 is 1, 5, 10, 10, 5, 1, which sums to 32.
How do I expand (x + y)⁴ with the triangle?
Use row 4, which is 1, 4, 6, 4, 1: x⁴ + 4x³y + 6x²y² + 4xy³ + y⁴.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.