from random import random def loi_discrete(): U=random() if U<2/3: X=-10 elif U<5/6: X= 3 else: X= 50 return X