Lesson · ⏱ 7 min read

🎲 Probability and distributions

EnglishHinglish

🏠 Real-life example

The weather app says '70% chance of rain'. That doesn't mean it rains for 70% of the day. It means that on days like this, it rained 7 times out of 10. AI models talk the same way: '92% likely spam' is a probability, not a certainty.

πŸ’‘ In simple words

Probability is a number from 0 (impossible) to 1 (certain) that says how likely something is. A distribution describes how likely each possible value is. The normal distribution, or bell curve, is common: heights, exam scores and measurement errors cluster around the average and thin out at the extremes. Many ML models output probabilities, and you choose a threshold, say 0.5, to turn them into decisions. Conditional probability, P(A given B), is the chance of A when you already know B happened.

πŸͺœ Step by step

  1. Probability is a number from 0 (impossible) to 1 (certain). A fair coin landing heads is 0.5.
  2. Combine events: 'and' for independent events multiplies (two heads = 0.5 Γ— 0.5 = 0.25); 'or' for exclusive events adds.
  3. Conditional probability: P(fraud | flagged) is the chance it's fraud given it was flagged. It can be very different from P(flagged | fraud).
  4. Distributions describe how values spread: the normal (bell curve) for heights or errors; skewed ones for income or waiting times.
  5. Models output probabilities (0.83 chance of churn). You choose a threshold to turn them into decisions.

πŸ”‘ Key terms

Probability
How likely something is, from 0 to 1.
Normal distribution
The bell-shaped curve where most values sit near the average.
Threshold
The cut-off that turns a probability into a yes/no decision.

πŸ‘€ See it in action

text
Model says: P(fraud) = 0.83 for this UPI transaction
Threshold 0.5  β†’ flag it  βœ…
Threshold 0.9  β†’ let it pass

Lower threshold = catch more fraud, but annoy more honest customers.

Choosing a threshold is a business decision, not just a maths one.

⚠️ Common mistakes to avoid

  • Ignoring the base rate: a 95% accurate test for a rare disease still produces mostly false alarms.
  • The gambler's fallacy: after five heads, tails is not 'due'. Independent events have no memory.

βœ… Quick check

A model says an email is 'spam with probability 0.6'. What does that mean?

  1. 60% of the email is spam
  2. It's more likely spam than not, but not certain
  3. It is definitely spam
Show answer

B. It's more likely spam than not, but not certain: 0.6 means that out of many similar emails, about 6 in 10 would be spam. It's likely, not certain.

πŸ™‹ Questions learners ask

How much probability do I need for AI jobs?

For most engineering roles: basic probability, conditional probability and the idea of distributions. Research roles need much more.

Is a model's 0.9 score really a 90% chance?

Only if the model is calibrated. Many models are over-confident; you can check calibration by comparing predicted scores with how often things actually happened.

πŸ“Œ Remember

Model outputs are usually probabilities, and you pick the threshold.

Learn this as part of a full course

Track your progress, take the quick checks and follow the lessons in the right order. This lesson is part of:

AI Foundations Path Β· ML Engineer Β· AI Research Engineer

Continue in the course