Change the algorithm used for "randomized experiments"
krlln opened this issue · comments
Hi,
The algorithm currently used for randomly ordering the experiment pages involves providing function() { return 0.5 - Math.random(); }
to array.sort
.
This method is biased: it is more probable for the first page in the YAML config file to be presented in the first pages. (see https://stackoverflow.com/a/18650169)
If possible, I'd recommend using the Fisher-Yates (aka Knuth) Shuffle as recommended here: https://stackoverflow.com/a/2450976.
Regards,
Krlln
Lines 73 to 75 in c929877
Thanka for spotting this. Would you be able to provide a PR?
Yes I would. I'll write it tomorrow.