hjugement-2.0.1.20190208: Majority Judgment.

Safe HaskellNone
LanguageHaskell2010

Majority.Rank

Synopsis

Documentation

type JS = Integer Source #

Number of judges.

type GS = Integer Source #

Number of grades.

type G = Integer Source #

Rank of grade.

rankOfMajorityValue :: GS -> MajorityValue (Ranked grade) -> Integer Source #

'rankOfMajorityValue gs mv' returns the number of MajorityValue lower than given mv.

countMiddleFrom :: JS -> GS -> (G, G) -> (G, G) -> Integer Source #

countMiddle :: JS -> GS -> (G, G) -> Integer Source #

'countMiddle js gs (l,h)' returns the number of MajorityValues of length js and using grades gs, which have '(l,h)' as lower and upper majority grade. This is done by multiplying together the countMerits to the left of l and the countMerits to the right of h

probaMajorityGrades :: JS -> GS -> [Rational] Source #

(probaMajorityGrades js gs' compute the probability of each grade to be a MajorityGrade given js judges and gs grades.

countMerits :: JS -> GS -> Integer Source #

'countMerits js gs' returns the number of Merits of size js possible using grades gs. That is the number of ways to divide a segment of length js into at most gs segments whose size is between '0' and js.

nCk :: Integral i => i -> i -> i infix 7 Source #

nCk n k returns the number of combinations of size k from a set of size n.

Computed using the formula: nCk n (k+1) == nCk n (k-1) * (n-k+1) / k