The Partial Derivative Puzzle
Solution


There are several ways to think about this question. It's a little scary to think about counting all the "relatives" of say fxxyyyz.

A recursive approach might suggest itself, by thinking that all 6th order derivatives are created from 5th order derivatives, but the thing that stops you there is that there are several different 5th order derivatives that produce the same 6th order derivative. And the number of 5th order ancestors a 6th order derivative can have will vary depending on the form of the derivative.

So to think about this puzzle, perhaps we should look at the simplest cases.

For one variable, the problem is trivial. There is 1 first-order derivative, 1 second-order derivative, and so on. So our first bit of evidence is
N\K012345
1111111
and our formula is

pd(1,k) = 1

For two variables, the problem is simple. There are k+1 distinct partial derivatives of order k. For example, when k=4, we have:

fxxxx fxxxy fxxyy fxyyy fyyyy

If we had to, we could use Pascal's triangle to keep track of the derivatives:

                        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
          1   7  21  35  35  21   7   1
        1   8  28  56  70  56  28   8   1
      

By convention, the rows and columns of Pascal's triangle are numbered beginning with 0. Thus row k of Pascal's triangle has k+1 entries, which we can symbolize by P(k,0) through P(k,k). The entries in row k can be thought of as corresponding to the various partial derivatives of order k. In fact, the actual value of Pascal's triangle there gives us the number of different ways of arriving at the given partial derivative by varying the order of differentiating by x and by y.

If our variables are x and y, and we represent differentiation by powers, then our Pascal triangle looks like this:

                   1
                 x    y
               x2  xy  y2
             x3  x2y  xy2  y3
      
and now our table is
N\K012345
1111111
2123456
and our formula is
pd(2,k) = k + 1

If we keep Pascal's triangle in mind, we can easily go to three variables. Pascal's pyramid can organize partial derivatives with respect to x, y, z. For example, the level for k=3 of the pyramid would look like

                   x3
                 x2y  x2z
               xy2  xyz  xz2
             y3  y2z  yz2  z3
      
The number of items on any one level will be a triangular number,
        1, 3, 6, 15, ...
      
generated by the formula
pd(3,k) = ( k + 2 ) * ( k + 1 ) / 2
and now our table is
N\K012345
1111111
2123456
3136101521

We don't quite have enough data to see what to do with four variables. We could certainly sit down and write out the possibilities and count them. But instead, let's come at the problem from a different angle.

Suppose I told you that I had 10 pennies and 5 match sticks, and that they were lined up in some order. Could you tell me how many different ways that could be done? If we symbolize pennies by "0" and matchsticks by "1", a typical pattern might be

        0 0 1 0 1 0 0 0 0 1 1 0 0 1
      
The number of different sequences of 10 0's and 5 1's that can be made is simply 15! / ( 10! 5!). We can think of this as the 15! ways that 15 distinct objects can be ordered, divided by 10! to account for the 10 identical pennies, and by 5! to account for the 5 identical matchsticks.

But we can relate this problem to the one we have. The matchsticks can be thought of as dividers that separate the pennies into groups. To count the number of tenth-order derivatives in four variables, we need three matches to use as dividers, and 10 pennies. Thus, the derivative that we might write as

w3x2z5
would be symbolized in matchsticks and pennies by
        000 1 00 1 1 00000
      
Every such derivative has a corresponding symbolic representation, and vice versa, and the relationship is one-to-one; so if we can count penny and matchstick symbols, we can count partial derivatives.

But the general formula is simple. If we have m identical matchsticks and p identical pennies, then the number of arrangements is

#(m,p) = (p+m)! / ( m! p! )
In our correspondence, we said that we need one fewer matchstick than we have variables, so our formula for the number of partial derivatives of order k in n variables is
pd(n,k) = (k+n-1)! / ( (n-1)! k! )
In particular,
pd(1,k) = (k+1-1)! / ( (1-1)! k! ) = 1
pd(2,k) = (k+2-1)! / ( (2-1)! k! ) = k+1
pd(3,k) = (k+3-1)! / ( (3-1)! k! ) = (k+2) * (k+1) / 2
pd(4,k) = (k+4-1)! / ( (4-1)! k! ) = (k+3) * (k+2) * (k+1) / 6
thus confirming our results and giving us the next one, and now our table is
N\K012345
1111111
2123456
3136101521
41410203556

Now we see that the array follows its own sort of simple rule. Note that

Thus, the data follows an addition rule:
pd(n,k) = pd(n,k-1) + pd(n-1,k)
as well as the obvious multiplication rule:
pd(n,k) = pd(n,k-1) * (k+n-1) / k
which means that we get row 4 by multiplying 1 by 4, then by 5/2, then by 6/3, then by 7/4, and so on.


Now if you look at the table at a 45 degree angle, you realize that we are staring at Pascal's triangle again!. The rows of the table are diagonals of Pascal's triangle. If you think about it for a minute, you will see that the entries of row 4 of our table, which we would write as

pd(4,1), pd(4,2), pd(4,3), pd(4,4), pd(4,5), ...
correspond to the Pascal triangle entries
P(3,0), P(4,1), P(5,2), P(6,3), P(7,4), ...
and in general,
pd(i,j) = P(i+j-2,j-1)

But we have a formula for the values of P:

P(i,j) = i!/ ( j! * ( i - j )! )
and hence
pd(i,j) = P(i+j-2,j-1) = (i+j-2)!/ ( ( j - 1 )! * ( i - 1 )! )
For example, pd(4,5) = 7! / ( 3! * 4! ) = 35


Last revised on 30 January 2005