Professional Documents
Culture Documents
1
This paper was originally delivered at ACM’79, Detroit,
October 29 1979, when the 1979 Turing Award was
presented to Kenneth E. Iverson. The paper was later
published in Communications of the ACM, Volume 23:8,
August 1980, pp.444-465, © 1980 ACM 0001-
0782/80/0800-0444.
2.3 Derivative of a Polynomial with Respect Jotting down the matrix of coefficients and
to Its Roots performing the indicated matrix product provides a
If R is a vector of three elements, then the quick and reliable way to organize the otherwise
derivatives of the polynomial ×/X-R with respect to messy manual calculation of expansions.
each of its three roots are -(X-R[2])×(X-R[3]), If B is the appropriate matrix of binomial
and -(X-R[1])×(X-R[3]), and -(X-R[1])× coefficients, then D½B+.×C, and the expansion
(X-R[2]). More generally, the derivative of function is clearly linear in the coefficients C.
×/X-R with respect to R[J] is simply Moreover, expansion for Y=ý1 must be given by the
-(X-R)×.*J≠ìæR, and the vector of derivatives inverse matrix ’B, which will be seen to contain the
with respect to each of the roots is alternating binomial coefficients. Finally, since:
-(X-R)×.*Iø.≠I½ìæR. C P X+(K+1) ½¸ C P (X+K)+1 ½¸
The expression ×/X-R for a polynomial with (B+.×C) P (X+K)
roots R applies only to a scalar X, the more general it follows that the expansion for positive integer
expression being ×/Xø.-R. Consequently, the values of Y must be given by products of the form:
general expression for the matrix of derivatives (of B+.×B+.×B+.×B+.×C
the polynomial evaluated at X[i] with respect to
where the B occurs Y times.
root R[J]) is given by:
Because +.× is associative, the foregoing can be
-(Xø.-R)×.*Iø.≠I½ìæR B.3
written as M+.×C, where M is the product of Y
2.4 Expansion of a Polynomial occurrences of B. It is interesting to examine the
Binomial expansion concerns the development successive powers of B, computed either manually
of an identity in the form of a polynomial in X for or by machine execution of the following inner
product power function:
the expression (X+Y)*N. For the special case of
Y=1 we have the well-known expression in terms of IPP:à+.×à IPP ù-1:ù=0:Jø.=J½ý1+ì1ÆæC
the binomial coefficients of order N: Comparison of B IPP K with B for a few
(X+1)*N ½¸ ((0,N)!N)P X values of K shows an obvious pattern which may be
expressed as:
By extension we speak of the expansion of a B IPP K ½¸ B×K*0©-Jø.-J½ý1+ì1ÆæB
polynomial as a matter of determining coefficients D The interesting thing is that the right side of this
such that: identity is meaningful for non-integer values of K,
C P X+Y ½¸ D P X and, in fact, provides the desired expression for the
general expansion C P X+Y:
The coefficients D are, in general, functions of Y. If C P X+Y ½¸
Y=1 they again depend only on binomial (((Jø.!J)×Y*0©-Jø.-J½ý1+ìæC)+.×C P X B.4
coefficients, but in this case on the several binomial
6 5 3 6 5 3 6
1 4 1 4 1 4 1 Transformations between this representation and
3 6 5 3 6 5 3 the direct form are given by:
5 3 6 5 3 6 5
7 7 7 7 7 7 7 DFR:ù[1],X+ù[1]óX½DFR 1Çù:0=æù:ù
RFD:ù[1],RFD X-ù[1]óX½1Çù:0=æù:ù
If M½POW Dø.+,0, then the cycle
representation of D may be obtained by selecting Some of the characteristics of this alternate
from M only "standard" rows which begin with their representation are perhaps best displayed by
smallest elements (SSR), by arranging these modifying DFR to apply to all columns of a matrix
remaining rows in descending order on their leading argument, and applying the modified function MF to
elements (DOL), and then catenating the cycles in the result of the function RR:
these rows (CIR). Thus:
MF:ù[,1;],[1]X+ù[(1 æX)æ1;]óX½MF.1 0Çù:0=1Ææù:ù
MF RR 4
CFD:CIR DOL SSR POW ùø.+,0 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4
2 2 3 3 4 4 1 1 3 3 4 4 1 1 2 2 4 4 1 1 2 2 3 3
SSR:(^/M=1èM½¾\ù)ðù 3 4 2 4 2 3 3 4 1 4 1 3 2 4 1 4 1 2 2 3 1 3 1 2
4 3 4 2 3 2 4 3 4 1 3 1 4 2 4 1 2 1 3 2 3 1 2 1
DOL:ù[üù[;1];]
CIR:(,1,^\0 1Çùô¾\ù)/,ù
DFC C½7,3 6 5,2,1 4
The direct permutations in the columns of this result
occur in lexical order (that is, in ascending order on
4 2 6 1 3 5 7
the first element in which two vectors differ); this is
CFD DFC C
true in general, and the alternate representation
7 3 6 5 2 1 4
therefore provides a convenient way for producing
direct representations in lexical order.
In the definition of DOL, indexing is applied to The alternate representation also has the useful
matrices. The indices for successive coordinates are property that the parity of the direct permutation D is
separated by semicolons, and a blank entry for any
given by 2|+/ý1+RFD D, where M|N represents
axis indicates that all elements along it are selected.
the residue of N modulo M. The parity of a direct
Thus M[;1] selects column 1 of M.
representation can also be determined by the
The cycle representation is convenient for function:
determining the number of cycles in the permutation
represented (NC:+/ù=¾\ù), the cycle lengths PAR:2|+/,(Iø.>I½ìæù)^ùø.>ù
(CL:X-0,ý1ÇX½(1èù=¾\ù)/ìæù), and the
power of the permutation (PP:LCM CL ù). On the
other hand, it is awkward for composition and
3.4 Directed Graphs
inversion.
The !N column vectors of the matrix A simple directed graph is defined by a set of K
(èìN)˜ý1+ì!N are all distinct, and therefore nodes and a set of directed connections from one to
TC:TC Z:^/,ù=Z½ùëùë.^ù:Z
V+.õM ½¸ ((KÆV)+.õ(K,1ÇæM)ÆM)+
(KÇV)+.õ(K,0)ÇM D.1 The identity corresponding to D.5 is:
(I,J)ÇA+.õV ½¸ ((I,J,0)ÇA)+.õV D.2
F V ½¸ (F ON V)+.õOS V D.8
+/S+ðT N ½¸ (0,ìN)!N
N:(ëð<\ùø.=ù)/ù D.3
S:(Nù)ø.=ù D.4
In words, the sums of the rows of the summarization
A½3 3 1 4 1 matrix of the column sums of the subset matrix of
C½10 20 30 40 50
order N is the vector of binomial coefficients of
order N.
N A S A (S A)+.õC
3 1 4 1 1 0 0 0 30 80 40 4.4 Distributivity
0 0 1 0 1 The distributivity of one function over another is
0 0 0 1 0 an important notion in mathematics, and we will
now raise the question of representing this in a
The function N selects from a vector argument general way. Since multiplication distributes to the
right over addition we have aõ(b+q)½¸ab+aq ,
its nub, that is, the set of distinct elements it
and since it distributes to the left we have
contains. The expression S A gives a Boolean
"summarization matrix" which relates the elements
Thus:
For example, if M is a matrix, then
2 1 íM ½¸ íM and 1 1 íM is the diagonal of M;
W[K]
if T is a rank three array, then 1 2 2 íT is a
(I,J,K)SF 1 3 3 2 íMø.õN
matrix "diagonal section" of T produced by running
(I,J,K)[1 3 3 2]SF Mø.õN D.12
together the last two axes, and the vector 1 1 1 íT
is the principal body diagonal of T. (I,K,K,J)SF Mø.õN Def of indexing
M[I;K]õN[K;J] Def of Outer product
The following identity will be used in the
V[K]
sequel:
I SF JíKíA
(I[J]) SF KíA Definition of í (D.11)
Proof:
((I[J])[K]) SF A Definition of í
M+.õ(N+P)
(I[(J[K])]) SF A Indexing is associative
+/(J½ 1 3 3 2)íMø.õN+P D.13
I SF(J[K])íA Definition of í
+/Jí(Mø.õN)+(Mø.õP) õ distributes over +
+/(JíMø.õN)+(JíMø.õP) í distributes over +
(+/JíMø.õN)+(+/JíMø.õP) + is assoc and comm
(M+.õN)+(M+.õP) D.13
Proof: We first reduce each of the sides to sums over 4.9 Derivative of a Polynomial
sections of an outer product, and then compare the Because of their ability to approximate a host of
sums. Annotation of the second reduction is left to useful functions, and because they are closed under
the reader: addition, multiplication, composition,
differentiation, and integration, polynomial functions
M+.õ(N+.õP) are very attractive for use in introducing the study of
M+.õ+/1 3 3 2íNø.õP D.12 calculus. Their treatment in elementary calculus is,
+/1 3 3 2íMø.õ+/1 3 3 2íNø.õP D.12 however, normally delayed because the derivative of
+/1 3 3 2í+/Mø.õ1 3 3 2íNø.õP õ distributes over + a polynomial is approached indirectly, as indicated
+/1 3 3 2í+/1 2 3 5 5 4íMø.õNø.õP Note 1 in Section 2, through a sequence of more general
+/+/1 3 3 2 4 í1 2 3 5 5 4íMø.õNø.õP Note 2
results.
+/+/1 3 3 4 4 2íMø.õNø.õP D.12
+/+/1 3 3 4 4 2í(Mø.õN)ø.õP õ is associative The following presents a derivation of the
+/+/1 4 4 3 3 2í(Mø.õN)ø.õP + is associative and commutative derivative of a polynomial directly from the
(M+.õN)+.õP expression for the slope of the secant line through
(+/1 3 3 2íMø.õN)+.õP the points X, F X and (X+Y),F(X+Y):
+/1 3 3 2í(+/1 3 3 2íMø.õN)ø.õP
+/1 3 3 2í+/1 5 5 2 3 4í(Mø.õN)ø.õP
((C P X+Y)-(C P X))öY
+/+/1 3 3 2 4í1 5 5 2 3 4í(Mø.õN)ø.õP ((C P X+Y)-(C P X+0))öY
+/+/1 4 4 3 3 2í(Mø.õN)ø.õP ((C P X+Y)-((0*J)+.õ(A½DS Jø.!J½ý1+ìæC)+.õC) P X)öY B.6
((((Y*J)+.õM) P X)-((0*J)+.õM½A+.õC) P X)öY B.6
Note 1: +/Mø.õJíA ½¸ +/((ìææM),J+ææM)íMø.õA ((((Y*J)+.õM)-(0*J)+.õM) P X)öY P dist over -
((((Y*J)-0*J)+.õM) P X)öY +.õ dist over -
∑ j•2
j =1
−j
1
1 • 2 • 3 + 2 • 3 • 4 + K n terms ←→ n(n + 1)(n + 2)(n + 3)
4
1
1 • 2 • 3 • 4 + 2 • 3 • 4 • 5 + K n terms ←→ n(n + 1)(n + 2 )(n + 3)(n + 4)
5
−q
x − a
N N −1
Γ( j − q ) x − a
Γ(− q )
∑ Γ( j + 1) f x − j
N
j =0
Sec. V ½¸ 2 3 5 M ½¸ 1 2 3
Ref. 4 5 6
Integers 1 ì5 ½¸ 1 2 3 4 5
Shape 1 æV ½¸ 3 æM ½¸ 2 3 2 3æì6 ½¸ M 2æ4 ½¸ 4 4
Catenation 1 V,V ½¸ 2 3 5 2 3 5 M,M ½¸ 1 2 3 1 2 3
4 5 6 4 5 6
Ravel 1 ,M ½¸ 1 2 3 4 5 6
Indexing 1 V[3 1] ½¸ 5 2 M[2;2] ½¸ 5 M[2;] ½¸ 4 5 6
Compress 3 1 0 1/V ½¸ 2 5 0 1ðM ½¸ 4 5 6
Take, Drop 1 2ÆV ½¸ 2 3 ý2ÆV ½¸ 1ÇV ½¸ 3 5
Reversal 1 èV ½¸ 5 3 2
Rotate 1 2èV ½¸ 5 2 3 ý2èV ½¸ 3 5 2
Transpose 1,4 íù reverses axes àíù permutes axes
Grade 3 û3 2 6 2 ½¸ 2 4 1 3 ü3 2 6 2 ½¸ 3 1 2 4
Base value 1 10]1 ½¸ 235 V]V ½¸ 50
& inverse 1 10 10 10˜235 ½¸ 2 3 5 V˜50 ½¸ 2 3 5
Membership 3 Vî3 ½¸ 0 1 0 Vî5 2 ½¸ 1 0 1
Inverse 2,5 ’ù is matrix inverse à’ù ½¸ (’ù)+.õà
Reduction 1 +/V ½¸ 10 +/M ½¸ 6 15 +ðM ½¸ 5 7 9
Scan 1 +\V ½¸ 2 5 10 +\M ½¸ 2 3æ1 3 6 4 9 15
Inner prod 1 +.õ is matrix product
Outer prod 1 0 3ø.+1 2 3 ½¸ M
Axis 1 F[I] applies F along axis I