📘 CodingMarble Learn

Yang Hui's (Pascal's) Triangle

Yang Hui's triangle starts with 1 at the top. Every number below is the sum of the two numbers above it, and the edges are all 1. Row n lists the coefficients of (a + b)ⁿ, so row 4 (1 4 6 4 1) gives (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴. Each row is symmetric and adds up to 2ⁿ. The same triangle is called Pascal's triangle in Europe and Meru Prastara in India.

🎬 Step-by-step story

  1. Start with a 1 at the top. Each new row has one more number. The numbers at the two ends are always 1.
  2. The rule: every inside number is the sum of the two numbers above it. Yellow plus yellow gives green: 3 + 3 = 6.
  3. Here is the whole triangle. The left side and the right side match, like a mirror down the middle.
  4. Add up each row: 1, 2, 4, 8, 16, 32. Every total is double the one before. These are powers of 2.
  5. Row n gives the coefficients of (a + b) to the power n. Row 4 is 1 4 6 4 1, so (a + b)⁴ has these numbers in front of its terms.
  6. Now you try. Slide n and watch the row, its total and the expanded form.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why are the edge numbers always 1?

An edge number has only one number above it, and that number is also an edge 1. So it stays 1. In (a + b)ⁿ it is the single term aⁿ or bⁿ.

How do I find a number in a row without writing all the rows above?

Use the adding rule: it needs only the row just above it. For a very big row you will later learn a formula, but the adding rule always works.

Why is the triangle the same on both sides?

In (a + b)ⁿ, a and b play the same part. Swapping them does not change the answer, so the numbers are the same in both directions.

Why do the rows add up to powers of 2?

Each number sends its value down to two blocks, once to the left and once to the right. So each row is double the row above. Put a = 1 and b = 1 in (a + b)ⁿ and you also get 2ⁿ.

Why do the rows match (a + b)ⁿ?

Each time you multiply by (a + b), every new term takes one part from the term above-left (times a) and one from above-right (times b). That is exactly the adding rule.

What about (a − b)ⁿ?

Use the same row of numbers. Because b is negative, the signs go + − + − and so on. Use the slider to read the row and add the signs yourself.

How to build the triangle

Write 1 at the top. This is row 0. Row 1 is 1 1. For every row after that, put a 1 at each end. Each number in the middle is the sum of the two numbers just above it.

Row 2: 1, 1+1, 1 = 1 2 1. Row 3: 1, 1+2, 2+1, 1 = 1 3 3 1. Row 4: 1 4 6 4 1. Row 5: 1 5 10 10 5 1. Row 6: 1 6 15 20 15 6 1. Row 7: 1 7 21 35 35 21 7 1.

The edge numbers are 1 because an edge number has only one number above it, and that number is 1.

Patterns hiding in the triangle

Row n gives the coefficients of (a + b)ⁿ

Multiply out: (a + b)² = a² + 2ab + b². The numbers in front are 1 2 1, which is row 2. Multiply again by (a + b): (a + b)³ = a³ + 3a²b + 3ab² + b³. The numbers are 1 3 3 1, row 3.

Why? When you multiply by (a + b) once more, each new term comes from two old terms: one times a and one times b. So each new coefficient is the sum of two old ones. This is the same adding rule as the triangle.

To expand (a + b)ⁿ: take row n. The power of a goes down from n to 0, the power of b goes up from 0 to n, and the powers in each term add up to n. There are n + 1 terms.

For (a + b)⁴ the row is 1 4 6 4 1: a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴.

For (a − b)ⁿ use the same numbers but the signs go + − + − …: (a − b)³ = a³ − 3a²b + 3ab² − b³. For numbers other than 1, put them in place of a or b, e.g. (x + 2)³ = x³ + 3·x²·2 + 3·x·2² + 2³ = x³ + 6x² + 12x + 8.

One triangle, many names

Yang Hui, a Chinese mathematician of the 13th century, showed this triangle in his book and said it came from an earlier scholar, Jia Xian. That is why it is called Yang Hui's triangle in China. In India it is known as Meru Prastara (the steps of the Mount Meru) from the study of poetry rhythms by Pingala and later by Halayudha. Persian poets and mathematicians knew it too. In Europe it is called Pascal's triangle after Blaise Pascal, who wrote about it in the 17th century. The idea was found in many places over a thousand years.

Try it: coins and paths

Coin trick: Toss 4 coins together 32 times and count how many heads come up each time. Most throws will show 2 heads, and 0 or 4 heads will be rare. The triangle row 1 4 6 4 1 tells you the chances: 6 of the 16 outcomes have 2 heads, and only 1 has 4 heads.

Path counting: Put a pebble on the top block. A pebble can go down-left or down-right. The number on each block is the number of different ways to reach it from the top. Check this for the block 6 in row 4 on a drawing.

In the 3D above: slide n and predict the row before you look.

Key formulas and definitions

Worked examples

1. Write row 5 using row 4 (1 4 6 4 1).

Put 1 at each end. In between: 1 + 4 = 5, 4 + 6 = 10, 6 + 4 = 10, 4 + 1 = 5. Row 5 is 1 5 10 10 5 1.

2. Expand (a + b)⁴.

Row 4 is 1 4 6 4 1. So (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴. Check: the powers in each term add up to 4.

3. Expand (x + 1)⁵.

Row 5 is 1 5 10 10 5 1. The powers of 1 are all 1, so (x + 1)⁵ = x⁵ + 5x⁴ + 10x³ + 10x² + 5x + 1.

4. Expand (a − b)³.

Row 3 is 1 3 3 1. Signs go + − + −. So (a − b)³ = a³ − 3a²b + 3ab² − b³.

5. Expand (x + 2)³.

Row 3 is 1 3 3 1 with a = x and b = 2. Terms: 1·x³ = x³; 3·x²·2 = 6x²; 3·x·4 = 12x; 1·8 = 8. So (x + 2)³ = x³ + 6x² + 12x + 8.

6. Find the sum of the numbers in row 7, and check by adding. How many terms has (a + b)⁹?

Row 7 adds up to 2⁷ = 128. Check: 1 + 7 + 21 + 35 + 35 + 21 + 7 + 1 = 128. (a + b)⁹ has 9 + 1 = 10 terms.

7. Use the triangle to find 11⁴, and to find the coefficient of x³ in (x + 1)⁶.

Row 4 is 1 4 6 4 1, and these are single digits, so 11⁴ = 14641. Row 6 is 1 6 15 20 15 6 1. The terms go x⁶, x⁵, x⁴, x³ … so x³ is the fourth term and its coefficient is 20.

Common mistakes

Practice quiz

1. The row after 1 3 3 1 is:
2. Row 5 adds up to:
3. The coefficients of (a + b)² are:
4. How many terms are there in (a + b)⁶?
5. In (a − b)³ the signs of the four terms are:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is Yang Hui's triangle?

It is a triangle of numbers that starts with 1 at the top. Each number below is the sum of the two above it. The same triangle is called Pascal's triangle in Europe.

How is Pascal's triangle used in algebra?

Row n gives the coefficients when you expand (a + b) to the power n, so you can write the expansion without multiplying it all out.

Why does each row add up to a power of 2?

Every number sends its value to two numbers in the next row, once to each side. So each row has double the total of the one above.

Where this is taught

China八年级(初二)Ch.16 Multiplying polynomials

Learn first

Learn next

Related lessons

All Maths lessons