[Haskell-beginners] computing percentile

Dennis Raddle dennis.raddle at gmail.com
Tue Oct 2 00:11:40 CEST 2012

Just thought I would toss the list a problem I need to solve and see what I
can learn from the solutions here.

My problem is that I need to take a list of Double and map them into
"percentile" form (not sure if I have that terminology correct) - so that
the lowest number is mapped to 0, the highest number is mapped to 1, the
median is mapped to 0.5, and in general given a fixed delta D and an
interval (x, x +D) in the percentile domain, the same number of elements
get mapped into that interval for any x. Except there aren't an infinity of
values and there may be ties, so it gets a little fuzzier how to define it.

so I need:

toPercentile :: [Double] -> [Double]

I shall now work on it and report back.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121001/16c9ed0a/attachment.htm>

More information about the Beginners mailing list