The following was written by Ken Iverson in 1966
http://www.jsoftware.com/papers/EvalOrder.htm
and is relevant to your example.

For this example, comparing J (or APL) to
conventional mathematical notation (CMN) 
can make J look clumsier, because CMN is 
optimized for writing polynomials.  However,
there are things you can do to improve the J.
For example, instead of +/(y-ym)^2 , write
+/ *: y-ym

+/((y-f)-(ym-f))^2
+/ *: (y-f) - (ym-f)

(+/(y-f)^2)+(+/(f-ym)^2)+2*+/(y-f)*(f-ym)
(+/*:y-f) + (+/*:f-ym) + +: +/ (y-f) * (f-ym)

etc.

Another advantage of J notation over CMN,
is that you can begin by assigning typical
values for y, ym, and f, and as you are evolving
the line you can enter each line into the 
computer and verify that they give the same
results from line to line.



----- Original Message -----
From: Johann Hibschman <[email protected]>
Date: Friday, July 15, 2011 8:04
Subject: [Jchat] j notation for pencil&paper math
To: [email protected]

> I've experimented a bit with using J- or APL-like notation for pencil
> and paper math, with some mixed success.  Has anyone else 
> tried this
> much?
> 
> I found my most recent experiment unsatisfying.  I was just 
> workingthrough (for the nth time) the RSS=TSS+ESS decomposition 
> of the
> sum-of-squares in fit residuals, which involve splitting 
> something like:
> 
>   +/(y-ym)^2
> 
> into
> 
>   +/((y-f)-(ym-f))^2
>   (+/(y-f)^2)+(+/(f-ym)^2)+2*+/(y-f)*(f-ym)
>   (+/(y-f)^2)+(+/(f-ym)^2)+2*+/(y*f)+(f*ym)-(y*ym)+f*f
>   etc.
> 
> This starts to feel "noisy" to me, compared to the more "classical"
> version of:
> 
>   sum ((y-f)-(ym-f))^2
>   (sum (y-f)^2)+(sum (f-y)^2)+2*sum (y*f-y*ym-f^2+f*ym)
> 
> where really I'm using sigmas and superscripts and dots.
> 
> Mostly this boils down to the traditional order-of-operations being
> optmized for polynomials.  I found that it took more 
> thinking than it
> should to turn (a-b)*(c-d) into (a*c)+(b*d)-(a*d)+(b*c), since 
> it cuts
> across the grain of my usual mental ordering.
> 
> Writing (a*c)-(a*d)+(b*c)-b*d is a little brain-twisting.
> "(a*c)+(a*-d)+(-b*c)+(b*d)" is mentally nicer.
> 
> Has anyone else tried APL notation for paper math?  Did you 
> like the
> experience?
> 
> Regards,
> Johann

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to