Re: [Jprogramming] Novice problem

2013-11-18 Thread Don Kelly
L- *: rms has a nice tree, and fewer concepts are required. Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Don Kelly Sent: Monday, November 18, 2013 2:06 AM To: programm...@jsoftware.com Subje

Re: [Jprogramming] Novice problem

2013-11-18 Thread bill lam
In some ancient articles, they may tell you the average fo sum of square is (+/%#)@*: They are correct for some very old versions of J (at least for the old J7 in 1993), becuase at that time rank of monad *: is _, but later it was changed to rank 0. Пн, 18 ноя 2013, Don Kelly писал(а): > The pr

Re: [Jprogramming] Novice problem

2013-11-18 Thread Don Kelly
The problem is that rms =: %:@(+/%#)@*: doesn't work in this case but replacing @ with @: does work (+/%#)@:*: 1 2 1 2 1 4 1 4 (+/%#)@:*: 1 2 1 2 2.5 it appears that (+/%#)@ 1 2 1 2 leads to 1 4 1 4 -the summation taken over individual elements (i.e (+/1%1),(+/4%1)... rather than acti

Re: [Jprogramming] Novice problem

2013-11-18 Thread Raul Miller
-++- % >│L- # >L- *: > > rms has a nice tree, and fewer concepts are required. > > Linda > > > -Original Message- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Don K

Re: [Jprogramming] Novice problem

2013-11-18 Thread Linda Alvord
Sent: Monday, November 18, 2013 2:06 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Novice problem You sent an answer to my question before I asked it! Thanks- I suspected but didn't know that this was it. I think that I will stay with the earlier definition: rms=:[:%:[:(+/%

Re: [Jprogramming] Novice problem

2013-11-18 Thread Raul Miller
I do not expect a measurable speed difference in the rms implementations I have seen here. I could be wrong, of course. Thanks, -- Raul On Mon, Nov 18, 2013 at 2:06 AM, Don Kelly wrote: > You sent an answer to my question before I asked it! Thanks- I suspected > but didn't know that this w

Re: [Jprogramming] Novice problem

2013-11-18 Thread Piet de Jong
I always read/interpret "@" or "@:" as "of the" Took me a while to get this "interpretation" but now I use it all the time when I write J programs: rms =: %:@(+/%#)@*: NB. square root "of the" mean "of the" squares. On Mon, Nov 18, 2013 at 6:06 PM, Don Kelly wrote: > You sent an answer to m

Re: [Jprogramming] Novice problem

2013-11-17 Thread Don Kelly
You sent an answer to my question before I asked it! Thanks- I suspected but didn't know that this was it. I think that I will stay with the earlier definition: rms=:[:%:[:(+/%#)*: which, while it does have brackets is somewhat more readable for my present state of understanding. Yours is sho

Re: [Jprogramming] Novice problem

2013-11-17 Thread Don Kelly
Thanks - This is what I had concluded and Jasmin and Linda have also emphasized the [: rather than @: Both, in this case do what I wanted. Don On 16/11/2013 9:43 PM, km wrote: Focus on what you want to DO. You want to do "the square root of the mean of the square". A novice's tip for using

Re: [Jprogramming] Novice problem

2013-11-17 Thread Don Kelly
That is neat and does give me further material to think about. I note that &. doesn't work (as I expected from the dictionary entry) but &.: so I have to figure this out Is it because that in u%.v y the u is applied to each element of y and for &.: it is applied to the whole of y? Don On

Re: [Jprogramming] Novice problem

2013-11-17 Thread Don Kelly
scalJasmin/Advanced%20forks%20and%20grammar - Original Message - From: Don Kelly To: "programm...@jsoftware.com" Cc: Sent: Saturday, November 16, 2013 8:20:04 PM Subject: [Jprogramming] Novice problem This is a novice problem (which arose from reading "Easy J" by Linda

Re: [Jprogramming] Novice problem

2013-11-17 Thread Bo Jacoby
Shorter version of root-mean-square using &.:    rms=.(+/%#)&.:*:    rms 1 2 1 2 1.58114 Den 16:23 søndag den 17. november 2013 skrev Raul Miller : Here's another definition of rms > >  Rms=: +/@:*: %:@% # >  Rms 1 2 1 2 >1.58114 > >Explanation: > >We do not need to square the numbers in

Re: [Jprogramming] Novice problem

2013-11-17 Thread Raul Miller
Here's another definition of rms Rms=: +/@:*: %:@% # Rms 1 2 1 2 1.58114 Explanation: We do not need to square the numbers in the argument to #, we only need to square them in the argument to +/ We only need the square root on the result of % Makes sense? Also, here's a partial explanat

Re: [Jprogramming] Novice problem

2013-11-16 Thread km
Focus on what you want to DO. You want to do "the square root of the mean of the square". A novice's tip for using [: is to read [: f g as "the f of the g" . What you want is [: %: ( [: (+/%#) *: ) which you read as "the square root of ( the mean of the square )" . (Omitted one "

Re: [Jprogramming] Novice problem

2013-11-16 Thread Linda Alvord
: programm...@jsoftware.com Subject: [Jprogramming] Novice problem This is a novice problem (which arose from reading "Easy J" by Linda Alvort I think that I have it worked out but this is something (IMHO) that possibly should be in a primer. I have occasion to use what is called rms or root

Re: [Jprogramming] Novice problem

2013-11-16 Thread Raul Miller
Here's how I think I'd do this: RMS=: (+/ % #)&.:*: RMS 1 2 1 2 1.58114 -- Raul On Sat, Nov 16, 2013 at 8:20 PM, Don Kelly wrote: > This is a novice problem (which arose from reading "Easy J" by Linda > Alvort > I think that I have it worked out but this is something (IMHO) that possi

Re: [Jprogramming] Novice problem

2013-11-16 Thread Pascal Jasmin
%20grammar - Original Message - From: Don Kelly To: "programm...@jsoftware.com" Cc: Sent: Saturday, November 16, 2013 8:20:04 PM Subject: [Jprogramming] Novice problem This is a novice problem  (which arose from reading  "Easy J" by Linda Alvort I think that I have it worked o

[Jprogramming] Novice problem

2013-11-16 Thread Don Kelly
This is a novice problem (which arose from reading "Easy J" by Linda Alvort I think that I have it worked out but this is something (IMHO) that possibly should be in a primer. I have occasion to use what is called rms or root mean square (usually applied to a wave form). I can define root, me