Skip to content

Probability Basics (events, conditional probability)

Events and probability

  • An event is a set of outcomes.
  • Probability is a number between 0 and 1.

Example: probability of drawing a red card from a standard deck is 26/52 = 0.5.

Conditional probability

Probability of A given B:

[ P(A|B) = \frac{P(A \cap B)}{P(B)} ]

In analytics language:

  • A = “user churns”
  • B = “user is on basic plan”

Then (P(A|B)) is the churn rate for basic-plan users.

Independence

A and B are independent if:

[ P(A|B) = P(A) ]

If churn rate differs by plan, churn and plan are not independent.

Bayes’ rule

[ P(A|B) = \frac{P(B|A) P(A)}{P(B)} ]

Common use cases:

  • Medical tests (false positives)
  • Fraud detection (base rate is tiny)

Mini example: base rate fallacy

If fraud is rare (say 0.1%), even a “95% accurate” detector can generate many false alarms.

Key lesson:

  • Always check base rates and precision/recall, not just accuracy.

If this helped you, consider buying me a coffee ☕

Buy me a coffee

Was this page helpful?

Let us know how we did