What are independent and dependent events in probability?

Updated Feb 20, 2026

Short answer

Independence means the outcome of one event does not change the probability of another event happening. Independent events can occur together, but knowing one result gives no useful information about the other. Dependent events are linked because the first outcome changes the probability of the second.

Deep explanation

Probability questions often ask whether events influence each other. The key idea is whether learning that one event happened changes the chance of another event happening.

Two events are independent events when:

  • The occurrence of one event does not affect the probability of the other.
  • The events can happen at the same time, but they do not provide information about each other.
  • The probability of both happening is the product of their separate probabilities.

Mathematically:

[ P(A \cap B) = P(A) \times P(B) ]

where:

  • P(A ∩ B) is the probability that both events happen.
  • P(A) and P(B) are the individual probabilities.

The fastest interview test is: "Does knowing event A happened change the chance of event B?" If the answer is no, the events are likely independent.

Independent event example

Imagine rolling a fair six-sided die and flipping a fair coin:

  • Event A: The die shows 6.
  • Event B: The coin shows heads.

The coin result does not care about the die result. Even if the die lands on 6, the probability of heads remains 1/2.

probability-example.ts
const dieSixProbability = 1 / 6;
const headsProbability = 1 / 2;
const bothProbability = dieSixProbability * headsProbability;
console.log(bothProbability); // 1/12

The combined probability is:

[ \frac{1}{6} \times \frac{1}{2} = \frac{1}{12} ]

Dependent events

Two events are dependent events when the outcome of one event affects the probability of the other.

A common example is drawing cards without replacement:

  • Event A: Drawing an ace from a deck.
  • Event B: Drawing another ace after removing the first card.

The second probability depends on what happened first. After one ace is removed, there are fewer cards and fewer aces available.

For dependent events:

[ P(A \cap B) = P(A) \times P(B|A) ]

The term P(B|A) means "the probability of B happening given that A already happened."

Visual comparison

Rendering diagram…
FeatureIndependent EventsDependent Events
RelationshipNo influence between eventsOne event affects another
Probability approachMultiply individual probabilitiesMultiply by conditional probability
Common exampleCoin flip and die rollCard draws without replacement
Key question"Does the first event matter?""Does the first event change the next chance?"

What interviewers look for

A junior candidate does not need to memorize only formulas. Interviewers usually want to hear the reasoning:

  1. Identify the events clearly.
  2. Ask whether information from the first event changes the second event.
  3. Choose the correct probability rule.

A common trap is assuming events are independent just because they are separate actions. Two events can look separate but still be dependent if they share resources or conditions.

For example:

  • Two coin flips are usually independent because the first flip does not physically change the coin.
  • Selecting two people from a fixed group without replacement is dependent because the first selection changes the remaining group.

The concept appears throughout software engineering, statistics, machine learning, and system design. For example, a monitoring system may analyze whether two failures are independent or whether one failure increases the chance of another. Understanding the relationship helps engineers choose better models and make better predictions.

Remember: independence is about unchanged probability, not about events being unrelated in everyday language.

Real-world example

Suppose an online store tracks two events:

  • Event A: A user receives an email notification.
  • Event B: The user clicks an advertisement from a different campaign.

If the email system and advertisement system operate separately, receiving the email may not change the probability of clicking the advertisement. These events may be modeled as independent.

However, if the email contains a discount that makes users more likely to click ads, then the events become dependent because the first event changes user behavior.

A simple simulation might look like:

simulate_events.py
email_received = True
ad_click_probability = 0.05
if email_received:
ad_click_probability = 0.10

Here, the probability changes after the email event occurs, so the events are dependent.

Common mistakes

  • * **Confusing separate with independent** - Two events happening in different places or systems are not automatically independent. Check whether one changes the probability of the other.
  • * **Ignoring "without replacement"** - Removing items from a collection usually creates dependency because the available choices change.
  • * **Using the wrong formula** - Do not multiply probabilities directly unless the events are independent.
  • * **Forgetting conditional probability** - When one event affects another, use the updated probability after the first event occurs.
  • * **Assuming independence from observation** - Events may appear unrelated but still share hidden causes or constraints.

Follow-up questions

  • How do you mathematically test whether two events are independent?
  • Are mutually exclusive events always independent?
  • What is conditional probability and why is it useful?
  • Can two dependent events become independent?
  • Why does independence matter in machine learning and statistics?

More Probability interview questions

View all →