![]() |
VOOZH | about |
In Probability, Uniform Distribution Function refers to the distribution in which the probabilities are defined on a continuous random variable, one which can take any value between two numbers, then the distribution is said to be a continuous probability distribution. For example, the temperature throughout a given day can be represented by a continuous random variable and the corresponding probability distribution is said to be continuous.
C++ have introduced uniform_real_distribution class in the random library whose member function give random real numbers or continuous values from a given input range with uniform probability.
Public member functions in uniform_real_distribution class:
Probability of some ranges 0.50-0.51 0.0099808 0.60-0.61 0.0099719 0.45-0.46 0.009999
The probability of all ranges are almost equal.
Example:
Lower Bound 0 Upper Bound 1.5 Minimum possible output 0 Maximum possible output 1.5
Reference:
https://cplusplus.com/reference/random/uniform_real_distribution/