Probability: The Basics
Probability is the branch of mathematics that helps us measure and understand uncertainty. It answers questions like: "How likely is it to rain tomorrow?" or "What are the chances of getting heads when I flip a coin?"
I. Key Terms in Probability
Trial:
- A single attempt or action whose result is uncertain. Example: Flipping a coin once.
Experiment:
- Doing a trial (or several trials) to observe outcomes. Example: Flipping a coin 2 times.
Outcome:
- The result of a single trial. Example: Getting "Heads" when you flip a coin.
Sample Space (
- The set of all possible outcomes of an experiment.
- Example: Rolling a die:
= - Example: Flipping a coin:
=
- Example: Rolling a die:
➛ Each element of outcome are part of the sample space.
Random Experiment:
- An experiment whose outcome is not known in advance is called a random experiment.
- A phenomenon which appears to be unpredictable or random.
- Example: Flipping a coin.
Event:
- Any subset of the sample space. An event is what we care about happening.
- Example: Getting an even number when rolling a die: E =
- Example: Getting heads when flipping a coin: E =
Probability of an Event (P(E)):
- The chance that an event happens. For equally likely outcomes:
- Example: Probability of getting a 1 on a die:
- Example: Probability of getting heads:
Complementary Events
- For any event E, the complementary event not E is the event that E does not occur.
- The probability of the complementary event is:
- Example: If the probability of raining tomorrow is 0.3, then the probability that it does not rain is: 1-0.3=0.71
Continuous Probability
- Continuous probability deals with events that have an infinite number of possible outcomes, like measuring time, height, or temperature.
- In continuous probability, the outcomes are not distinct (like heads or tails) but can take any value in a given range. We don't calculate probabilities for specific values, but instead for ranges of values.
Why is Probability Important?
- It helps us make decisions when we don't know what will happen.
- It is the foundation for statistics, data science, and machine learning.
- Statistics helps interpret the results of testing machine learning models and make better decisions
- Probability provides the foundation for understanding statistics and its tools.
II. The Rules (Axioms) of Probability
These forms the foundation for calculating and understanding probabilities.

These are the basic rules that all probabilities must follow:
- Non-Negativity:
- The probability of any event E is always between 0 and 1 (inclusive).
- There are no events that can have negative probability.
- Total Probability:
- The probability of the entire sample space S, which includes all possible outcomes, is always 1.
- This means something in the sample space is guaranteed to happen.
- Additivity:
- If two events cannot happen at the same time (mutually exclusive), then
- Example: When flipping a coin, getting heads and getting tails are mutually exclusive.
- If two events cannot happen at the same time (mutually exclusive), then
III. Approaches to Probability
There are three main ways to think about probability:
- Axiomatic Probability (based on rules/axioms)
- Frequentist Probability (based on experiments and data)
- Classical Probability (based on equally likely outcomes)
★ Axiomatic Probability
- Uses the three rules above to define probability for any situation.
- Example: If Anna watches drama 40% of the time and action 30% of the time, the chance she watches either is
.
★ Frequentist Probability
- Based on experiments or data. Probability is the long-run frequency of an event.
- Example: Anna watched 12 dramas out of 30 movies last year. Probability she picks a drama next is
.
★ Classical Probability
- All outcomes are equally likely. Probability is just "favorable outcomes divided by total outcomes."
- Example: Anna has 4 dramas out of 10 movies. Probability she picks a drama is
.
| ASPECT | FREQUENTIST PROBABILITY | CLASSICAL PROBABILITY |
|---|---|---|
| Definition | Probability is defined as the long-run relative frequency of an event occurring in repeated trials. | Probability is based on the assumption that all outcomes in the sample space are equally likely. |
| Interpretation | Probability is an empirical measure derived from repeated experiments. | Probability is derived theoretically based on symmetry and logical reasoning. |
| Assumption | Assumes an infinite number of trials for probabilities to converge. | Assumes all possible outcomes have the same likelihood. |
| Calculation | Estimated from observed frequencies over repeated trials. | Computed using the formula: P(A) = (Favorable outcomes) / (Total outcomes) |
| Example | If a coin is flipped 1,000 times and lands on heads 520 times, the probability of heads is estimated as 520/1000 = 0.52. | The probability of getting heads in a fair coin toss is 1/2 since both outcomes are equally likely. |
| Alignment with Axioms | Follows the Axioms of Probability but interprets probability through empirical observations. | Fully adheres to Axiomatic Probability, assuming equal likelihood of all outcomes. |
4. Counting Principles: How Many Ways?
To find the probability of an event, we first need to count the number of outcomes. Counting plays a key role in determining the size of the sample space and calculating probabilities. By knowing how many ways an event can happen, we can better understand its likelihood.
There are two fundamental rules for counting:
1. The Addition Rule (for "OR")
- If you have two events are mutually exclusive (you can't pick both), you add the number of options.
- Example: If you can take a bus (3 routes) OR a train (2 routes) to school, you have
total ways to get there.
2. The Multiplication Rule (for "AND")
- If you have to make a sequence of choices, you multiply the number of options at each step.
- Example: To create an outfit, you choose from 3 shirts AND 2 pairs of pants. You have
possible outfits.
I. Types of Counting
Based on the multiplication rule, we can handle more complex scenarios. The key questions to ask are: "Does order matter?" and "Can I reuse items?"
★ Exponents (Counting with Replacement)
- Use exponents when you are making a sequence of choices from the same set of options, and you can pick the same option more than once.
- Here repetitions are allowed.
- Formula:
, where is the number of options for each choice, and is the number of choices you make. - Example: A 3-digit lock can use digits from 0-9. How many combinations are possible?
- You have 10 choices for the first digit, 10 for the second, and 10 for the third.
- Total combinations =
.
★ Factorials (Counting without Replacement)
- If repetitions are not allowed, the number of available options decreases with each selection, and we use factorials.
- A factorial is the product of all integers from
to . - Example: For a padlock where you choose a 4-digit password from combo from 10 numbers without repeats,
- The number of combinations is:
- The number of combinations is:
★ Permutations (Order Matters, Without Replacement)
- Use permutations when you are arranging a set of items, and you cannot reuse an item. The order of arrangement is important.
- Formula:
- Where
is the total number of items, and is how many you choose to arrange.
- Where
- Example: How many ways can you award 1st, 2nd, and 3rd place to 8 runners?
- Order matters (1st is different from 2nd). You can't give one runner two prizes.
ways.
★ Combinations (Order Does NOT Matter, Without Replacement)
- a.k.a Binomial Coefficients
- Use combinations when you are selecting a group of items, and the order of selection does not matter.
- Formula:
- Where
is the total number of items, and is how many you choose.
- Where
- Example: How many ways can you choose 3 students out of 5 to form a committee?
- Order doesn't matter (a committee of Alice, Bob, and Charlie is the same as Charlie, Alice, and Bob).
ways.
II. The Inclusion-Exclusion Principle
What if events are NOT mutually exclusive? If we just add them, we double-count the overlap. The inclusion-exclusion principle helps us correct this.
The Inclusion-Exclusion Principle helps calculate the probability of the union of overlapping events by subtracting the over-counted intersections.
- Formula for two events:
- We subtract the intersection (
) to remove the double-counted outcomes.
Example:
In a class of 30 students, 15 play soccer, 10 play basketball, and 5 play both. What is the probability that a randomly chosen student plays soccer or basketball?
- Let S be the event "plays soccer" and B be "plays basketball."
. - So, there is a 66% chance a student plays at least one of the sports.
V. Advanced Probability Concepts
1. Independent Events:
- Two events are independent if knowing one happened does NOT change the chance of the other.
- Mathematically:
- Independent Events:
- Dependent Events:
- Independent Events:
- Example: Flipping a coin twice. Getting heads the first time doesn't affect the second flip.
2. Mutually Exclusive Events:
- Two events are mutually exclusive if they cannot both happen at the same time.
- Mathematically:
- Example: Rolling a die, getting a 1 and getting a 2 are mutually exclusive.
3. Comparison Example:
Let A = {roll a 6}, B = {roll a 2 or 3} on a die.
, (they can't both happen) - So, A and B are mutually exclusive, but NOT independent.
Simple case: Rolling a fair die, let Event A = {roll a 6} and let B =
Question: Are the events Independent, Mutually exclusive or neither?
- As per the definition of Independence
Events A and B are NOT independent
- As per definition of Mutual Exclusive
the events are mutually exclusive
VI. Conditional Probability
Conditional probability is the chance that something happens, given that something else has already happened.
Formula:
Example:
If 30% of students play football, and 10% play both football and basketball, then the probability a student plays basketball given they play football is
Note
This becomes the basis of Naive Bayes Theorem
Bayes' Theorem:
This is a special formula for "flipping" conditional probabilities:

VII. Partition and The Law of Total Probability
Sometimes, it's hard to calculate the probability of an event directly. The Law of Total Probability gives us a clever way to find it by breaking the problem into smaller, easier pieces.
★ What is a Partition?
A partition is a way of dividing the entire sample space into several events that are:
- Mutually Exclusive: None of the events overlap.
- Exhaustive: Together, the events cover all possible outcomes.
Think of it like slicing a pizza. Each slice is a separate piece (mutually exclusive), and all the slices together make up the whole pizza (exhaustive).
- Simple Example: For tomorrow's weather, the events "Rain" and "No Rain" form a partition. They can't both happen, and one of them must happen.
★ The Law of Total Probability
This law states that you can find the probability of an event (let's call it A) by considering how it behaves within each piece of the partition.
- Formula: If
form a partition of the sample space, then for any event A:
In simple terms: The total probability of A is a weighted average of its conditional probabilities, where the weights are the probabilities of each event in the partition.
Example 1: Choosing a Marble
Imagine two bags of marbles.
- Bag 1: Contains 3 red and 7 blue marbles.
- Bag 2: Contains 6 red and 4 blue marbles.
You flip a fair coin to decide which bag to draw from. What is the probability you pick a red marble?
-
Event A: Picking a red marble.
-
Partition: The choice of bag. Let
be "choose Bag 1" and be "choose Bag 2". (from the coin flip) (from the coin flip)
-
Conditional Probabilities:
- The probability of getting red given you chose Bag 1 is
. - The probability of getting red given you chose Bag 2 is
.
- The probability of getting red given you chose Bag 1 is
-
Total Probability:
So, the overall probability of picking a red marble is 45%.
Example 2: Student Study Habits
At a school, students are either "Full-Time" or "Part-Time".
- 60% of students are Full-Time (
). - 40% are Part-Time (
).
We also know:
- 50% of Full-Time students study on weekends (
). - 80% of Part-Time students study on weekends (
).
What is the probability that a randomly chosen student studies on the weekend?
- Event A: A student studies on the weekend.
- Partition: Student status, "Full-Time" (FT) and "Part-Time" (PT).
- Total Probability:
So, there is a 62% chance that any given student studies on the weekend. This law is a key ingredient in Bayes' Theorem.
VIII. Bayes' Theorem (Putting It All Together)
Bayes' theorem helps us update our beliefs when we get new information. It connects conditional probabilities in a powerful way.
Formula:
Key Terms:
- Prior Probability (
): - What you believed about A before seeing new evidence B.
- Example: Suppose 5% of the population has a certain disease. Before testing, your prior belief about someone having the disease is 5%.
- Likelihood (
): - How likely is the evidence B if your belief A is true?
- Example: A medical test correctly identifies the disease 99% of the time (i.e., if someone has the disease, the test will be positive 99% of the time).
- Posterior Probability (
): - What you should believe about A after seeing the evidence B.
- Marginal Likelihood (
): - The overall probability of observing the evidence B. This is often calculated using the Law of Total Probability!
Example: The "Positive Test" Problem Revisited
Suppose 1% of people have a certain disease. A test for it is 99% accurate for sick people, but has a 2% false positive rate (healthy people who test positive). If you test positive, what is the chance you actually have the disease?
Step 1: Define Events
: You have the disease. : You are healthy. : You test positive.
Step 2: List the Probabilities
- Prior:
. So, . - Likelihoods:
(A sick person tests positive). (A healthy person tests positive).
Step 3: Calculate
The sample space is partitioned into "Disease" and "Healthy".
The overall chance of anyone testing positive is about 3%.
Step 4: Apply Bayes' Theorem
We want to find
So, even with a positive test, the chance you have the disease is only about 33.3%! This surprising result happens because the disease is rare.
Example 2: The Defective Bolt Problem
In a factory, three machines,
- Machine
: 3% - Machine
: 4% - Machine
: 2.5%
A bolt is drawn randomly from a day's production and found to be defective. What is the probability it was produced by machine
Step 1: Define Events
: The bolt is from machine . : The bolt is from machine . : The bolt is from machine . : The bolt is defective.
We want to find
Step 2: List the Probabilities
First, let's find the prior probabilities of a bolt coming from each machine.
- Total bolts produced =
.
Next, list the likelihoods (the defect rates for each machine).
Step 3: Calculate P(D) using the Law of Total Probability
The events
The overall probability of picking a defective bolt is about 3.06%.
Step 4: Apply Bayes' Theorem
Now we can calculate the posterior probability,
Conclusion:
The probability that the defective bolt came from machine
Why is Bayes' Theorem Important?
- It provides a mathematical way to update our beliefs in light of new evidence.
- It is the foundation of many machine learning algorithms (like Naive Bayes classifiers), medical diagnostic tools, and spam filters.
IX. Key Takeaways
- Probability is about reasoning with uncertainty. It gives us a framework to make logical decisions when we don't have all the facts.
- Always define your sample space and events clearly. This is the most important step in solving any probability problem.
- Counting is key. Use the right tool for the job: the addition rule for "OR" choices, and the multiplication rule (exponents, permutations, combinations) for "AND" sequences.
- Don't double-count. Use the inclusion-exclusion principle when events can happen at the same time.
- Context matters. Conditional probability (
) is one of the most important ideas. It's the probability of A, in the new world where we know B has happened. - Update your beliefs. The Law of Total Probability and Bayes' Theorem are powerful tools for breaking down complex problems and updating our knowledge as we get new data.