Introduction

Welcome back to Building Probability Models! In the previous lesson, you learned how to evaluate whether a set of outcome–probability pairs qualifies as a valid probability model by checking two requirements: every probability falls between 00 and 11, and all probabilities sum to exactly 11. With that skill in hand, you are ready for the next step.

In this second lesson out of five, we shift from checking models to building them. Specifically, we will focus on the uniform probability model, the simplest and most widely used type. By the end, you will know how to construct a uniform model from scratch, confirm it is valid, and use it to calculate the probability of any event.

Why Equally Likely Outcomes Lead to a Special Model

Many everyday chance processes treat every possible result the same way. Flipping a fair coin gives heads and tails an equal shot. Rolling a fair six-sided die treats every face identically. Drawing a name at random from a hat gives every name the same chance of being picked.

Three examples of equally likely outcomes: a fair coin, a six-sided die, and names drawn from a hat

What these situations share is a key property: no single outcome is favored over any other. When this is true, fairness itself dictates the structure of the model. Because no outcome deserves a larger or smaller slice of the total probability, every outcome must receive the same value. This is the defining feature of a uniform probability model, and it makes construction straightforward, as we will see next.

Building a Uniform Probability Model

Suppose a chance process has nn equally likely outcomes. Since every outcome gets the same probability and all probabilities must add to 11, each outcome is assigned:

P(each outcome)=1nP(\text{each outcome}) = \frac{1}{n}
Verifying the Model

Building a model is only half the job; we should always confirm it passes both validity checks from the previous lesson. Let us verify the die model.

Requirement 1 — each probability between 00 and 11: Every value is 160.167\frac{1}{6} \approx 0.167, comfortably inside the range . ✓

Finding Event Probabilities with a Uniform Model

A model becomes truly useful when we apply it to answer questions about events. An event is any collection of outcomes from the sample space, and its probability equals the sum of the probabilities of all outcomes in that event:

P(event)=P(favorable outcomes)P(\text{event}) = \sum P(\text{favorable outcomes})

Let us try this with our die model. Suppose we want the probability of rolling an even number. The favorable outcomes are {2,4,6}\{2, 4, 6\}, so we add their probabilities:

Raffle Night: A Full Example

Let us bring all three steps together with a new real-world scenario. A community center is holding a raffle with 8 equally likely prizes: 3 gift cards, 2 movie tickets, and 3 book bundles. One prize is selected at random from these 8 prizes, and we want the probability of selecting movie tickets.

Step 1 — Build the uniform model. There are n=8n = 8 prizes, so each one gets a probability of 18\frac{1}{8}:

PrizeProbability
Gift Card 1
Conclusion and Next Steps

A uniform probability model assigns the same probability, 1n\frac{1}{n}, to each of nn equally likely outcomes. Because every value automatically lies between 00 and 11 and the total is always , uniform models are valid by construction. To find the probability of an event, sum the probabilities of its favorable outcomes, which in a uniform model simplifies to .

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal