What is a Uniform Distribution?
The uniform distribution is a symmetric probability distribution where all outcomes have an equal likelihood of occurring. All values in the distribution have a constant probability, making them uniformly distributed. This distribution is also known as the rectangular distribution because of its shape in probability distribution plots, as I’ll show you below.
Uniform distributions come in both discrete and continuous varieties of probability distributions.
Discrete: Each discrete value has an equal probability. For example, the chances of obtaining any of the six values on a die are equal.
Continuous: Models symmetric, continuous data where all equal sized ranges have the same probability. For example, values are equally like to fall in the range of 0.1 – 0.2 as they are in 0.4 – 0.5.
Both forms of the uniform distribution have two parameters, a and b. These values represent the smallest and largest values in the distribution.
Related post: Understanding Probability Distributions
Uniform Distribution Examples
In real life, analysts use the uniform distribution to model the following outcomes because they are uniformly distributed:
- Rolling dice and coin tosses.
- The probability of drawing any card from a deck of cards.
- Random sampling because that method depends on population members having equal chances.
- P-values in hypothesis tests follow the uniform distribution when the null hypothesis is true under certain conditions.
- Random number generators use the uniform distribution because no number should be more common than other numbers.
- Radioactive decay of particles over time.
Analysts can use the uniform distribution to approximate new processes when there is insufficient data to estimate the actual distribution of outcomes. In other cases, analysts use this distribution because it’s a close approximation and the formula is simple, as I show below.
Graphing Distributions and Finding Probabilities
Graphing is a great way to see what uniform distributions look like and find probabilities. Below, I’ll graph discrete and continuous forms of the distribution.
For discrete uniform distributions, finding the probability for each outcome is 1/n, where n is the number of outcomes. Rolling dice has six outcomes that are uniformly distributed. Therefore, each one has a likelihood of 1/6 = 0.167. The bar chart below displays the rectangular-shaped distribution.
For continuous probability density functions, you obtain probabilities for ranges of values by finding the area under the curve for that range. Usually, that involves complex calculations. However, in continuous uniform distributions, the formula is simple because you’re finding areas of a rectangle instead of a curve. You just divide the number of units of interest by the total number of units.
In the example below, the distribution ranges from 5 to 10, which covers 5 units. The shaded area is one unit out of five or 1 / 5 = 20% of the total area. Hence, the probability for a value falling between 6 and 7 is 0.2. In fact, all one-unit ranges in this distribution have the same likelihood of 0.2. You can use the same formula to calculate the probabilities for other sized ranges when the outcomes are uniformly distributed.
Learn how to identify the distribution or your data!
Joe Lombardi says
Thanks, Jim, for pointing me to your post on the Chi-Square GoF Test. I am very eager to read it. But let me tell you more of the story.
I only used dice to frame my question b/c you used a die in your post. But what I really want to do is check the “honesty” of an online, real-money casino Blackjack game. I am suspicious of and cynical about all of them (as we all should be).
In a regular deck of playing cards, there are 52 cards w/o the Jokers. Four of them are Aces, which leaves 48 cards, 16 of which have a value of ten (K, Q, J, and 10). Hence, I would expect to see the dealer’s face card (or up card) to be a ten only one third (16/48) of the time (ignoring the Aces, which is another kettle of fish). And I would expect the dealer to have a 20 (with just two cards) only once on average every nine hands (⅓ x ⅓ = 1/9). It has been my casual observation that one particular casino’s “dealer” has been showing a ten-value top card WAY MORE OFTEN than one third of the time (I am thinking 40 – 50 percent) and having a two-card 20 far more often than 11 percent of the time. That would indicate a virtual “stacked deck.” It is important to note that the arithmetic above is not based on just one deck, b/c the online casinos use card “shoes” with at least six decks. Some of them have “bottomless” shoes.
Although my current bankroll is actually way ahead of my starting bankroll, BION, I plan on “investing” some of my winnings on “research.” I am going to record the dealer’s hole card and face card and then perform the analysis to see if it’s an honest game. I wonder whether one hundred hands are sufficient. I don’t mind doing more in the interest of “science.” 🙂
Jim Frost says
One approach would be to use the chi-square test as I describe with the die, but instead devise a list of possible outcomes and expected probabilities for that top card. And then record the actual outcomes and perform the test. Given the number of possible outcomes (all the different cards), you’d need many more trials.
The fact that it’s a bottomless deck of cards actually helps. Otherwise, you’d have to factor in the changing probabilities due to sampling without replacement, which causes the probabilities to change. However, I think the bottomless deck idea would essentially be sampling with replacement, and the probabilities wouldn’t change as you play.
It’s great that you’re ahead! Even if they’re not playing fair, it seems like you’re doing well!
Joe Lombardi says
Hey, Jim. Thanks for this post. Speaking of dice . . . What if I were trying to analyze a single die to see whether it’s “fair,” that is, not “loaded” or containing a defect that might cause one (or more) of the numbers to occur more (or less) often than one-sixth of the time? If I toss that die 900 times, I expect each number to occur ABOUT 150 times. But how does one establish an acceptable range of results? Intuitively, if I see a count of 100 or 200 for a particular number, I know something’s fishy. But how would I establish the pass/fail criteria before beginning the test?
Jim Frost says
That’s a great applied question!
To do that, you’d need to perform a chi-square goodness-of-fit test for a discrete distribution. If you click that link, you’ll see examples of this test. Scroll down to the car color example. Now imagine instead of entering the proportion values I use in the example, you instead enter the values relevant for the uniform distribution using a die, which would be 1/6 for each possible value. You’d roll the die and record the outcomes.
If the test results are statistically significant, you reject the null and conclude that the results do not follow the uniform distribution.