Welcome to Sharpening Probability Basics! This is the very first lesson of the course, so you are right at the starting line. Over the coming lessons we will build a strong foundation in probability, one concept at a time, so that every new idea has a solid base to stand on.
In this lesson, we revisit the core idea behind single-event probability: measuring how likely something is to happen by comparing favorable outcomes to total outcomes. Even if this sounds familiar, taking the time to sharpen this skill now will pay off in every topic that follows. Let's get started.
What Does Probability Really Measure?
The Sample Space and Favorable Outcomes
Before we calculate anything, we need two pieces of information:
Sample space: the complete set of equally likely outcomes. In the coffee-pod example, the sample space contains all 10 pods.
Favorable outcomes: the outcomes that match the event we care about. If we want a decaf pod, the favorable outcomes are the 3 decaf pods.
The phrase equally likely is important. Each pod has the same chance of being grabbed because we are choosing at random. When outcomes are equally likely, counting them is all we need.
The Probability Formula
Expressing the Result Three Ways
A Worked Example: Raffle Tickets
Common Mistakes to Watch For
Even with a straightforward formula, a few errors come up often. Keeping these pitfalls in mind will help you set up every problem correctly from the start.
Swapping the counts. Placing the total in the numerator and the favorable count in the denominator flips the meaning entirely. Always remember: favorable on top, total on the bottom.
Missing part of the sample space. If a bowl holds red, blue, and green marbles, forgetting to include the green ones in the total will throw off the calculation.
Confusing "favorable" with "unfavorable." If someone asks for the probability of drawing a red marble, only the red marbles count as favorable, not every marble that is not red.
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
Imagine a coworker places ten coffee pods in a jar: seven are regular and three are decaf. If you reach in without looking, you have a sense that you are more likely to grab a regular pod than a decaf one. Probability simply puts a number on that feeling. It tells you, on a scale from 0 (impossible) to 1 (certain), how strong the chance of a particular outcome really is.
With those two counts in hand, the probability of an event A is:
P(A)=total number of equally likely outcomesnumber of favorable outcomes
For our decaf example, the probability of drawing a decaf pod is:
P(decaf)=103
Notice a few things about this ratio. If no outcomes are favorable, P(A)=0 and the event is impossible. If all outcomes are favorable, P(A)=1 and the event is certain. In every other case, the probability falls somewhere strictly between 0 and 1.
A probability can be communicated as a fraction, a decimal, or a percentage. All three say the same thing, just in different formats.
Form
How to get it
Decaf example
Fraction
Write the ratio directly
103
Decimal
Divide numerator by denominator
0.3
Percentage
Multiply the decimal by 100
30%
Being comfortable converting between these forms is essential, because real-world contexts often call for one form over another. A weather app shows 40%, a textbook might show 52, and a spreadsheet might show 0.4. They all represent the same likelihood.
Now let's walk through a complete example from start to finish. A small raffle sells 200 tickets, and you buy 5 of them. What is the probability that one of your tickets is drawn as the winner?
Identify the total number of equally likely outcomes. Every ticket has the same chance, so the total is 200.
Identify the number of favorable outcomes. You hold 5 tickets, so the favorable count is 5.
Set up the ratio.
P(win)=2005
Simplify the fraction. Divide numerator and denominator by 5:
P(win)=401
Convert.
Decimal: 1÷40=0.025
Percentage: 0.025×100=2.5%
So you have a 2.5% chance of winning. That single ratio captures everything you need to know about the likelihood of this event.
In this lesson we pinned down the foundational ratio at the heart of all probability work: P(A) equals the number of favorable outcomes divided by the total number of equally likely outcomes. We also practiced expressing that result as a fraction, a decimal, and a percentage — three interchangeable forms you will use throughout the rest of this course.
Now it is time to put this knowledge into action. Up next you will work through a set of practice exercises that range from identifying correct probability setups to computing and interpreting probabilities on your own. Jump in and see how sharp your skills already are!