AI Glossary / Statistics and probability / Foundation
Uniform distribution
Definition
A uniform distribution assigns equal probability to outcomes of equal size within its support. For a continuous uniform distribution on an interval from a to b, equal-length subintervals have equal probability and the probability density is constant. A discrete uniform distribution instead gives equal probability to each member of a finite set. The distinction matters: a continuous distribution does not give positive probability to each individual real-number value, even though its density is positive throughout the interval.
What it means
Uniform means no part of the specified support is favored under the chosen representation. For a continuous interval, probability depends on length rather than location. The endpoints define the range, and the density must integrate to one. Uniformity is a modeling assumption, not a consequence of knowing only minimum and maximum values. It also depends on scale: a quantity uniform in ordinary units will generally not remain uniform after a nonlinear transformation such as taking its logarithm.
How it works
For a less than b, the continuous uniform density is 1/(b minus a) inside the interval and zero outside. Its cumulative probability at an interior value x is (x minus a)/(b minus a). The mean is (a + b)/2 and the variance is (b minus a) squared divided by twelve. To generate a value from a unit-uniform draw U, use a + (b minus a)U. In SciPy's uniform distribution, loc specifies the lower endpoint and scale specifies the interval width, so the upper endpoint is loc plus scale.
Three practical examples
Example 1: A simulation draws a delay uniformly between two and ten seconds as an explicit scenario assumption. Example 2: An experiment randomly assigns one of four equally likely display variants using a discrete uniform choice. Example 3: A Monte Carlo procedure starts with unit-uniform random numbers and transforms them into another distribution. These applications use uniformity for different purposes; none implies that naturally occurring delays or customer preferences must be uniformly distributed.
Think of it this way
Think of placing a point at random along a perfectly even ruler. Two segments of the same length have the same chance of containing the point, regardless of where they lie. A longer segment has proportionally more chance. Choosing among numbered cards is the discrete counterpart, where probability is attached to individual cards rather than lengths.
Worked example
Let X be continuous uniform from two to ten seconds. The interval width is eight seconds, so the density is 1/8 per second. The probability that X lies between four and seven seconds is the interval length three divided by eight, or 0.375. The mean is six seconds and the variance is 64/12, approximately 5.333 square seconds. The 90th percentile is two plus 0.90 times eight, equal to 9.2 seconds. The probability of exactly six seconds is zero in this continuous model, although any interval of positive length around six has positive probability. In a measurement system that rounds to whole seconds, observing the recorded value six can have positive probability because several underlying values map to the same rounded label.
Illustrative case study
In this fictional case study, Juniper Simulation uses a uniform delay model to explore a bounded service scenario. An analyst initially enters two as the location and ten as the scale, which would create an interval ending at twelve. Reviewing the parameter definition reveals that the intended scale is eight. The team also labels the distribution as a scenario assumption and compares it with observed delay patterns before relying on it for capacity decisions. Correct software parameters and a plausible model are separate requirements.
Common misconceptions and mistakes
Common mistakes include confusing the upper endpoint with the scale parameter, assuming every bounded variable is uniform, and interpreting a density value as a point probability. Another mistake is expecting a short random sample to have perfectly even counts across bins. Random sampling creates variation even under a uniform model. A nonlinear transformation generally changes the distribution, and a uniform prior on one parameterization need not be uniform on another.
Business use
Businesses use uniform distributions in simulations, randomized allocation and simple uncertainty scenarios. State the support, units and reason for equal weighting. If the model represents real operational behavior, compare its implications with data and test whether tails or concentration near particular values matter for the decision. Keep discrete choices separate from continuous measurements. When uniform random draws feed another model, record the transformation and random-generation settings so that results can be reproduced and interpreted correctly.
People also ask
Does uniform mean every sample histogram is flat?
No; finite samples fluctuate.
Is the density the same as probability at a point?
No.
Can a discrete uniform outcome have positive probability?
Yes.
Is the mean always one-half?
Only for the unit interval from zero to one.
Does knowing a range justify uniformity automatically?
No; it is an additional assumption about how probability is distributed within that range.
Check your understanding
What is the probability of four to seven seconds in the example?
Answer: 3/8, or 0.375.
What SciPy scale produces the interval two to ten?
Answer: Eight.
What is the 90th percentile?
Answer: 9.2 seconds.
Why can a rounded recorded value have positive probability when the exact continuous value does not?
Answer: Rounding combines an interval of underlying values into one label.
Related terms
- Discrete distribution
- Cumulative distribution function
- Inverse transform sampling
- Related terms include probability density
- random number generation and probability integral transform
- but subsequent transformations can produce many nonuniform distributions
Learn next
Learn next how inverse cumulative distribution functions turn uniform draws into other random variables. Compare density, cumulative probability and empirical histograms on the same interval. Then examine why assumptions about uniformity can change under transformations, especially when modeling uncertainty about parameters on different scales.
More in Statistics and probability
- Uncomfortable science - Uncomfortable science is an informal methodological expression for research situations where limited available evidence is used both to develop explanations...
- Unconditional probability - Unconditional probability is the probability of an event without restricting the calculation to a specified conditioning event.
- Unevenly spaced time series - An unevenly spaced time series is a sequence of observations recorded at times whose successive gaps are not all equal.
- Uniform sampling fraction - A uniform sampling fraction means that the same proportion of units is selected from each stratum of a stratified population.
- Uniformly most powerful test - A uniformly most powerful test is a hypothesis test whose power is at least as high as that of every competing test in a specified class, at every parameter...
- Unimodal - Unimodal describes a distribution or data pattern with one mode, commonly understood as one principal peak.
Sources
Source: SciPy, scipy.stats.uniform, https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.uniform.html. This primary software reference defines the continuous uniform distribution and its location-scale convention. The interval probabilities, moments, percentile and parameter-check example are original and independently checked. The simulation-company case is fictional, and the assumed delay distribution is illustrative rather than an empirical claim.
Previous: Uniform-cost search Next: Uniform memory access