I multiply many probabilities into one.
P.S. The probability won't never be zero (it'll be 0.01) and it won't never be hundrer (it'll be 0.99).
for probabilities in get_random_list_of_probabilities():
a = 1
b = 1
for probability in probabilities:
a *= probability
b *= (1 - probability)
if a < b:
a_is_greater += 1
if b > a:
b_is_greater += 1
After some iterations, the a
can be about 5.087e-258
.
According to sys.float_info
, the minimum value my Python can handle is about 2.225e-308
.
I am afraid of running my code on other machines.
How can I normalize my values?
Thanks a lot!