A new method for building a discrete analogue to a continuous random variable based on minimization of a distance between distribution functions