Constructing a probability distribution for random variable