text: The answer x+2y+z is indeed the correct one if a wall with just three numbers at the bottom is considered, but the general principle can be expanded to a wall with any number of starting values. To see how, just extend the analysis a little:-\n\nFor a wall with one starting value, a, the overall total is clearly a.\n\nFor two start values, a and b, the total is a+b.\n\nFor three values, a b & c, the total is a+2b+c as already stated.\n\nThings start to get messy with four values, but bear with me! The second-row totals are a+b, b+c, c+d, giving third-row totals of a+2b+c and b+2c+d, and thus an overall total of a+3b+3c+d.\n\nJust one more example will help us to derive the general formula so here goes. Starting with abcde the successive totals are a+b, b+c, c+d, d+e then a+2b+c, b+2c+d, c+2d+e then a+3b+3c+d, b+3c+3d+e to give a final total of a+4b+6c+4b+e.\n\nStill with me? Well, if we now consider the numbers in front of the letters (called the co-efficients) and arrange them in a triangle we get:-\n\n....1\n...1 1\n..1 2 1\n.1 3 3 1\n1 4 6 4 1\n\nNotice anything about the numbers? Yes - each is the sum of the two above it. With this principle in mind we can now say that the next row will be 1 5 10 10 5 1.\n\nTo use the triangle to solve our original problem, we just need to find the row that has the same number of values as the number of starting numbers in the wall. We then construct an equation using the values in that row of the triangle as co-efficients, substitute the actual starting values from the wall and then work out the final result - easy! For example, if the wall started 1,2,3,4,5,6 we would take the row containing 6 co-efficients (the one we worked out after deriving the general principle) to give us the equation:-\n1x1 + 5x2 + 10x3 + 10x4 + 5x5 + 1x6 = 112\n\nThe above triangle was discovered long ago and is usually called Pascal's Triangle. It has importance in something called the binomial theorem, which you can find all about in Wikipedia (search for Binomial Theorem or Pascal's Triangle).\n\nGood luck with your wall building (but do tell your teacher how you found the answer!)