In article
<4de20ca0-f5e8-44ee-be1e-43ce7b422eaf@[EMAIL PROTECTED]
>,
Jimmy Miller <CaptainThunder@[EMAIL PROTECTED]
> wrote:
>I'm a complete beginner to APL, and I had the following question:
>
>Suppose I have a 16x16 matrix of values. How would I set each value
>in the matrix (starting in the second row) equal to the sum of the
>matrix element directly above it, and the element to the top-left of
>it? Essentially,
>
>m[x;y]=m[x;y-1]+m[x-1;y-1]
>
>But I'm not sure how to express that in APL.
Two possibilities:
1. In a modern APL, something like 16 {x + 0, -1 <drop> x} \ topvector
2. In primitive APL (e.g. APL\360), some thinking shows that there's a
magic matrix M, where the result is M +.* topvector. Analysis gets
M as a form of Pascal's Triangle, so it can be generated as a
1-liner.
Seth


|