NumPy RandomLesson 24Free preview
Uniform Distribution
This lesson is part of NumPy · All levels
Summary
A uniform distribution produces the same random value of the probability across the entire range between the left and right boundaries. Suitable for simple simulations like dice and random selection.
Key points
- Uniform(left, right, size) spreads evenly across the range [left, right].
- The density of probabilities is flat, not the bell.
- The mean is equal to (left + right)/2 and the variance is equal to (right - left) squared of 2.
- This distribution forms the basis for many other random generation methods.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.