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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
