bug in raw_frequency()?
- Posted by Davy Jan 22, 2012
- 1181 views
When running this code, the value of 0 in the data_set isn't counted -
include std/stats.e sequence t, s = {}, data_set = {0,1,2,3,4,5,6,7,8,9} for j = 1 to 1000 do s &= data_set[rand(10)] end for t = raw_frequency(s, ST_ALLNUM) ? t
t is -
{ {108,8}, {106,5}, {104,1}, {103,3}, {102,2}, {100,4}, {97,6}, {90,9}, {84,7} }
But if I change the 0 to 10 in data_set, the correct number of values (with their frequencies) are output.