> As for the function +/@:(m&p.)@:i , the solution can be found > by using the method described in sections 11B and 11C of Math > for the Layman, only if m&p. is a first degree polynomial. > I am looking at another solution for higher order polynomials.
The solution for +/@:(m&p.)@:i. is actually quite straightforward: Since (+/ c * f i. n) = c * +/ f i. n (+/ (f + g) i. n) = (+/ f i. n) + (+/ g i. n) it is necessary only to solve +/(i.n)^k . But that is a polynomial of degree 1+k. Use linear regression to find the coefficients of the polynomial. csi=: 3 : 0 (+/\_1|.!.0 t^y) %. ^/~t=. i.2x+y ) csi 1 0 _1r2 1r2 csi 2 0 1r6 _1r2 1r3 csi 3 0 0 1r4 _1r2 1r4 ((i.10x)^/i.2+k) +/ .* csi k=: 1 0 0 1 3 6 10 15 21 28 36 +/@(^&k)@i."0 i.10 0 0 1 3 6 10 15 21 28 36 ((i.10x)^/i.2+k) +/ .* csi k=: 2 0 0 1 5 14 30 55 91 140 204 +/@(^&k)@i."0 i.10 0 0 1 5 14 30 55 91 140 204 ((i.10x)^/i.2+k) +/ .* csi k=: 3 0 0 1 9 36 100 225 441 784 1296 +/@(^&k)@i."0 i.10 0 0 1 9 36 100 225 441 784 1296 ((i.10x)^/i.2+k) +/ .* csi k=: 4 0 0 1 17 98 354 979 2275 4676 8772 +/@(^&k)@i."0 i.10 0 0 1 17 98 354 979 2275 4676 8772 ----- Original Message ----- From: "Paul" <[EMAIL PROTECTED]> To: "Programming forum" <[email protected]> Sent: Saturday, May 06, 2006 1:34 PM Subject: Re: [Jprogramming] K. E. Iverson's Math for the Layman, section 11E,exercise 3 Roger, Sorry for the confusion. I did not mean to imply that J should provide the solution to the problems I mentioned. I was so excited to discover that J could express +/@i.n as a 2nd degree polynomial with the t. operator, that I imagined it would be able to do the same for the other examples and exercises of section 11C and 11E of Math for the Layman (by the way, the exercise that started all this is #3 of section 11C, not 11E as indicated in the the Subject of the messages). I just wanted to know if there is a way to define f, g and h below, in such a way that t. would be able to process them. After trying the polynomial expressions of f, g and ), and based on your answer below, I conclude that +/@:f@:i. is the only member of an infinite class recognized by t. ... which is fine with me. The examples you give are probably impossible to express in polynomial form, anyway. As for the function +/@:(m&p.)@:i , the solution can be found by using the method described in sections 11B and 11C of Math for the Layman, only if m&p. is a first degree polynomial. I am looking at another solution for higher order polynomials. For a little more than a month now, that I have downloaded and started studying J, it has inspired me a renewed interest in Math and computer programming. It is mainly due to the possibility J gives to experiment with advanced math concepts, as shown by K.E. Iverson's article. The article itself is a great review of these concepts that helps me understand them better now than when I studied them 30 year ago. I have to thank the designers and maintainers of this unique and fascinating package for the making it available on the net. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
