The correct way is to compute all the terms in the expression and then
multiply them together. Something like
   n* > *&.>/ >:@i.&.> n->:i.k
However, the expressions you gave will return length errors, since (>:i.n-2)
is patently not the same length as (>:i.n-1). What exactly are you trying to
compute?

Marshall

On Wed, Oct 19, 2011 at 10:39 AM, David Vaughan <
[email protected]> wrote:

> I couldn't really think of an appropriate title for this. My issue is that
> I want to compute an expression that has a different number of terms
> depending on y.
>
>   +/(>:i.n-1)*n NB. for all n, y >: n > 1
>   +/(>:i.n-2)*(>:i.n-1)*n NB. for all n, y >: n > 2
>
> and so on, so that:
>
>   lim =. <:<.y%2
>
> and we carry on the style of expression above until we are doing it for all
> n, y >: n > lim.
>
> So in the case for y=.5, lim=.1 and we only do the first of the lines
> above. For y=.7, we would do the second one as well. For y=.9 we would do
> the same as the second but with a (>:i.n-3) multiplied with it all as well.
> I guess/hope there is some way of achieving this with power?
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to