Let the distribution function of continuous random variable X be F(x)=(x-a)/(b-a), and a≤x≤b, then the random variable X is said to obey the uniform distribution on [a, b], and it is denoted as X ~ u [a, b].
This shows that the probability that X falls within the subinterval of [a, b] is only related to the subinterval length and has nothing to do with the subinterval position, so the probability that X falls within the subinterval of [a, b] with the same length is equal, and the so-called uniformity refers to this equal possibility.
Sampling from an arbitrary distribution
Uniform distribution is suitable for sampling with arbitrary distribution. The general method is the inverse transformation sampling method using the cumulative distribution function (CDF) of the target random variable. This method is very useful in theoretical work. Because the simulation using this method needs to invert the cdf of the target variable, an alternative method is designed for the case that the closed form of CDF is unknown. One way is to refuse sampling.