jeudi 31 octobre 2019

Implementing specific distribution in python

i want to return 1<l<10 with probability 1/(2^(l-1))

how i should do this rather then:

    x = random()
    if x < 0.5:
       return 2

and so on

thank you




Aucun commentaire:

Enregistrer un commentaire