DIM item$(7), prob(7), cnt%(7) item$() = "aleph","beth","gimel","daleth","he","waw","zayin","heth" prob() = 1/5.0, 1/6.0, 1/7.0, 1/8.0, 1/9.0, 1/10.0, 1/11.0, 1759/27720 IF ABS(SUM(prob())-1) > 1E-6 ERROR 100, "Probabilities don't sum to 1" FOR trial% = 1 TO 1E6 r = RND(1) p = 0 FOR i% = 0 TO DIM(prob(),1) p += prob(i%) IF r < p cnt%(i%) += 1 : EXIT FOR NEXT NEXT @% = &2060A PRINT "Item actual theoretical" FOR i% = 0 TO DIM(item$(),1) PRINT item$(i%), cnt%(i%)/1E6, prob(i%) NEXT