# Pascals Triangle

165 views

How can i find all of the numbers in a certain row of pascals triangle, for this example lets say the 11th row, without having to draw out the entire triangle?

In: Mathematics

Each number in Pascal’s Triangle is one of the [Binomial Coefficients](https://en.wikipedia.org/wiki/Binomial_coefficient). You can see there’s a formula for calculating each value. Also if you calculate a value, it’s very easy to calculate the next one.

Use the formula for binomial coefficients, usually written as an n (row of the triangle) over a k (“column” in that row) with parentheses around. The first row of the triangle is n=0 and the first entry in each row is k=0, so if you’re thinking about the literal 11th row in the triangle, you would actually want to calculate binomial(10, k) for k from 0 to 10.

The numbers on pascal’s triangle represent the number of possible paths you could take from the top to that place on the triangle. So it shouldn’t be too surprising that we use the same math to calculate values in pascal’s triangle as we use to calculate combinations (ie all the possible combinations of going left or right to get to a place).

For calculating combinations we use what’s called a choose function. It takes in two values that we’ll call n and k. This can easily be calculated using factorials, where “n choose k” equals n!/(k!*(n-k)!).

You can get all the numbers of a given row on pascals triangle by setting n to the value of the row, and then running through the values of k from 0 to n. (This assumes the top row is 0).

So the values of the 11th row are:

11choose0, 11choose1, 11choose2, …,11choose11

Each layer of pascals triangle maps to coefficients of the basic binomial expansion. The coefficients of (x + y)^ n is the same as the nth layer of pascals triangle.

Example:

(x + y)³ is 1x³ + 3x²y + 3xy² + 1y³. The third layer of pascals triangle is 1, 3, 3, 1

Edit: There are methods that let you quickly work out the coefficients of any binomial expansion. The rated answer [here](https://math.stackexchange.com/questions/508085/binomial-expansion-how-to-do-them-quickly) has one such method

> for this example lets say the 11th row, without having to draw out the entire triangle?

There is a formula using the nCr function: *n! / (n-r)! r!*, which gives you the rth entry in the nth row.

With this rule (and understanding it) it is fairly easy to work out the numbers using a simple process. Let’s use the 11th row [well, technically the 12th row, but we’ll call it the 11th and take the top row to be the 0th row, to make the numbers nicer].

The first term is always 1.

The next term is always the row number. 11

To get the next terms, we do two things; multiply by the next number down, and divide by the next number up from 1. [Technically we did that to get 11, but it is easier to just remember that one.]

So from 11, we multiply by 10 (next number down) and divide by 2 (next number up). 110 / 2 = 55.

And then we repeat. So our next number will be 55 x 9 (next number down) divide by 3 (next number up). It is usually easier to do the division first, so 9/3 = 3, 55 x 3 = 165.

And so on. 165 x 8 / 4 = 165 x 2 = 330.

330 x 7 / 5 = … this is kind of nasty, let’s change it to 330 x 7 x 2 / 10 = 66 x 7 = 60 x 7 + 6 x 7 = 420 + 42 = 462.

462 x 6 / 6 = 462. Oooh!

At this point we have reached the middle of Pascal’s Triangle. And the triangle is symmetric, so the rest of the numbers are going to be 330, 165, 55, 11, 1, giving us the complete row:

> 1, 11, 55, 165, 462, 462, 330, 165, 55, 11, 1