added option to change random when calling calc_expected