median=:[:-:[:+/]{~[:(<.,>.)[:-:[:<:#

On Fri, Sep 24, 2010 at 9:33 PM, Kip Murray <k...@math.uh.edu> wrote:

> The median of list 0 1 2 3 4 is 2 (the middle element), and the median of 0
> 1 2
> 3 is 1.5 (average of the two middle elements).  Therefore the definition of
> median given in Phrases 10C. Math and Stats is incorrect:
>
>    median =: <....@-:@# { /:~
>
>    median 0 1 2 3 4
> 2
>    median 0 1 2 3
> 2
>
> So, write a correct definition for median!  --Kip Murray
>
> ----------------------------------------------------------------------
> 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