Number Triangle pattern

69 Views Asked by At

I have a number triangle as follows:

$$\begin{array}{|c|c|c|} \hline 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ \hline 0 & 0 & 1 & 1 & 1 & 0 & 0 \\ \hline 0 & 2 & 4 & 6 & 4 & 2 & 0 \\ \hline 4 & 16 & 40 & 48 & 40 & 16 & 4 \\ \hline \end{array}$$ Assuming the top middle cell is $(x=0,y=0)$ can anyone explain the following description to me? (also as we go down $y$ goes up i.e. second row has $y=1$ and third row has $y=2$ and ...)

The sum of all incoming paths to a node is defined as the sum of the values of all possible paths from the root node $(x,y)=(0,0)$ to the node under consideration, where at each node $(x,y)$ a path can either continue diagonally down and left $(x-1,y+1)$, straight down $(x,y+1)$, or diagonally down and right $(x+1),y+1)$. The value of a path to a node is defined as the sum of all the nodes along that path up to, but not including, the node under conideration.

I really can't see how the last row numbers are calculated. I just want to understand these initial numbers (Specially can't see how 40 and 48 are determined).

1

There are 1 best solutions below

3
On BEST ANSWER

It looks like a cell is determined by the sum of the numbers from all possible paths to that cell. Starting from the top row to the fourth row, to get from 1 to 40, you could have done
1-1-2-40
1-1-4-40
1-1-6-40
1-1-4-40
1-1-6-40
1-1-6-40
If you add up all of those numbers, excluding the 40's, you get 1+1+2+1+1+4+1+1+6+1+1+4+1+1+6+1+1+6 = 6*(1+1)+1*2+2*4+3*6 = 40.

For the 48, the possible paths you could have taken are: 1-1-4-48
1-1-6-48
1-1-4-48
1-1-6-48
1-1-4-48
1-1-6-48
1-1-4-48
Adding up all the numbers except the 48, you get 7*(1+1) + 4*4 + 3*6 = 48