Too easy to be annoying: h =: [: f /:~
Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of km Sent: Monday, March 11, 2013 3:02 PM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Find the median Very nice, Linda. And it is easy to do g =: f @ /:~ (Just wanted to annoy!) --Kip Sent from my iPad On Mar 11, 2013, at 2:09 AM, "Linda Alvord" <lindaalv...@verizon.net> wrote: > f=: 13 :'(<.-:#y){-:y+|.y' > > f > ([: <. [: -: #) { [: -: ] + |. > > Linda > > > -----Original Message----- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of km > Sent: Monday, March 11, 2013 2:45 AM > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] Find the median > > Very neat, thank you. I won't show you my lengthy solution which led > me to call for help! --Kip > > Sent from my iPad > > > On Mar 10, 2013, at 7:48 PM, Raul Miller <rauldmil...@gmail.com> wrote: > >> On Sun, Mar 10, 2013 at 6:29 PM, km <k...@math.uh.edu> wrote: >>> The median of list 1 2 2 4 6 is 2 ("middle" value of sorted list), >>> the > median of 2 2 4 6 is 3 (average of two "middle" values). Write a verb > to find the median of a sorted list of numbers. >> >> Here's one implementation of this definition of median: >> >> mean=: +/ % # >> median=: (<.,>.)@-:@<:@# mean@:{ /:~ >> >> -- >> Raul >> --------------------------------------------------------------------- >> - For information about J forums see >> http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm