[Jprogramming] Using the hypergeometric adverb (H.).
'Bo Jacoby' via Programming
programming at jsoftware.com
Thu Jul 7 20:53:22 UTC 2016
I am estimating the number of known answers (x) in a multiple choice test, knowing the number of correctly (y) and incorrectly (n-y) answered questions.
The computation shows that N=10 and y=8 gives x=5±2.
I would like to compress the three lines defining M0, M1 and M2 into at single line.
Thank you!
Bo.
M0=. 13 : '(1,-x)H.(-y+1e_7)2'
M1=. 13 : '(2,-x)H.(-y+1e_7)2'
M2=. 13 : '(3,-x)H.(-y+1e_7)2'
M =. 13 : '>(i.>:y)(M0,M1,M2)&.>y'
ms=. 13 : '(<:a),:%:a*(+:b)->:a[''a b''=.|:2%~/\"1 M y'
3":(i.@>:,ms) 10
0 1 2 3 4 5 6 7 8 9 10
0 0 0 1 1 2 3 4 5 7 9
0 0 1 1 1 1 2 2 2 2 1
More information about the Programming
mailing list