On Mon, Jul 21, 2008 at 2:34 PM, June Kim <[EMAIL PROTECTED]> wrote:
> There are 21 judges whose probabilty for making correct
> decision(binary decision of accept or reject) is all 0.7. They will
> aggregate their decision with the simple majority rule(more than half
> the number wins the decision). What is their probability for correct
> decision?
>
> 0.97361

For this case, that is, all judges being equally good, you can use the
gsl library (sorry for mentioning this the third time on the list in
the last few days now).  This gives the same result on my machine as
you wrote.

   -. 'libgsl.so gsl_cdf_binomial_P > d i d i' (15!:0) 0.7 (<[EMAIL 
PROTECTED]:@];[;]) 21
0.97361

> Now, play it with five judges: 0.95, 0.95, 0.90, 0.90, 0.80

This one can't be computed with a gsl function directly because the
library does not provide a function for computing the cdf of the
discrete multinomial distribution.

Wow, nice question.  I wrote my own solution.

   qual =: 0.95 0.95 0.90 0.90 0.80
   njud =: #qual
   poss =: >,{njud$<0 1
   prob =: */"1 poss ([+]*{&1 _1@:[)"1 qual
   good =: (+/"1 poss) < -:njud
   echo success =: +/ good * prob
0.992945

You could also use that to confirm the answer for the first question,
albeit a bit slowly.

   qual =: 21#0.7
   njud =: #qual
   poss =: >,{njud$<0 1
   prob =: */"1 poss ([+]*{&1 _1@:[)"1 qual
   good =: (+/"1 poss) < -:njud
   echo success =: +/ good * prob
0.97361

> 2) What would happen if the least correct judge(0.80) from the second
> case just follows the first judge(0.95)'s decision?

Let's modify the previous solution (which I actually wrote with this
question in mind).

   qual =: 0.95 0.95 0.90 0.90 0.80
   njud =: #qual
   poss =: >,{njud$<0 1
   prob =: */"1 poss ([+]*{&1 _1@:[)"1 qual
   possv =: (0 {"1 poss) _1}"0 1 poss
   goodv =: (+/"1 possv) < -:njud
   echo successv =: +/ goodv * prob
0.988

Surprisingly, the result of a good decision is improved from 0.974 to
0.988, unless I made a mistake in the calculation somewhere.

Ambrus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to