
Introduction
Anyone entering data science is told to understand probability. That advice is sound, but it does not mean memorizing every theorem in a statistics textbook. What matters in practice is a working grasp of the probability concepts that appear consistently in real projects — building models, analyzing data, and making predictions. Real-world data is messy and uncertain, and probability provides the tools to quantify that uncertainty and make informed decisions. This guide covers the concepts practitioners actually use, with the math kept to what is needed.
1. Random variables
A random variable is simply a variable whose value is determined by chance — a container that can hold different values, each with a certain probability. Two types come up constantly. Discrete random variables take countable values: the number of visitors to a website (0, 1, 2, 3, …), the number of defective products in a batch, or the outcome of a coin flip. Continuous random variables can take any value within a range: temperature readings, time until server failure, or customer lifetime value. The distinction matters because the two types call for different probability distributions and analysis techniques.
2. Probability distributions
A probability distribution describes all the values a random variable can take and how likely each is. Every machine learning model makes assumptions about the underlying distribution of the data; understanding distributions reveals when those assumptions hold and when they break.
Normal distribution
The normal (Gaussian) distribution is everywhere in data science. Its symmetric bell shape is fully described by two parameters — the mean and the standard deviation — and many natural measurements approximate it. Many statistical methods, from linear regression to hypothesis tests, lean on assumptions of normality.
Binomial distribution
The binomial distribution models the number of successes in a fixed number of independent trials, where each trial has the same probability of success — tossing a coin ten times and counting heads, or running 100 ads and counting clicks. It is the natural model for click-through rates, conversion rates, A/B testing outcomes, and churn framed as yes/no events.
Poisson distribution
The Poisson distribution models the number of events occurring in an interval of time or space when events occur independently at a constant average rate, governed by the rate parameter lambda. Typical uses include support tickets per day, server errors per hour, rare-event prediction, and anomaly detection.
3. Conditional probability
Conditional probability is the probability of one event given that another has occurred, written P(A|B) and read “the probability of A given B.” The concept is fundamental to machine learning: a classifier essentially estimates the probability of a class given the input features.
Consider spam detection. The question is P(spam | contains “free”) — if an email contains the word “free,” how likely is it spam? Answering requires three ingredients: P(spam), the overall base rate of spam; P(contains “free”), the overall probability that an email contains the word; and P(contains “free” | spam), how often spam emails contain it. This structure is the foundation of the Naive Bayes classifier, and thinking in conditional probabilities also sharpens feature engineering and model interpretation.
4. Bayes’ theorem
Bayes’ theorem describes how to update beliefs when new evidence arrives:
P(A|B) = P(B|A) × P(A) / P(B)
A medical-testing example shows why it matters. Suppose a diagnostic test is 95 per cent accurate — both at detecting true cases and at correctly rejecting non-cases — and the disease affects 1 per cent of the population. For someone who tests positive, the actual probability of having the disease is only about 16 per cent. With such low prevalence, false positives outnumber true positives. This is the base-rate fallacy: the base rate must always be taken into account, and as prevalence rises, a positive result becomes far more informative. The same reasoning underpins A/B-test analysis, Bayesian inference, and any workflow where evidence accumulates over time.
5. Expected value
Expected value is the probability-weighted average of all possible outcomes — essential for data-driven business decisions. Consider a marketing campaign costing $10,000 with four possible outcomes: a 20 per cent chance of returning $50,000, a 40 per cent chance of $20,000, a 30 per cent chance of $5,000, and a 10 per cent chance of nothing. Measured against the $10,000 cost, the net outcomes are +$40,000, +$10,000, −$5,000 and −$10,000, so the expected value is:
(0.20 × 40,000) + (0.40 × 10,000) + (0.30 × −5,000) + (0.10 × −10,000) = $9,500
A positive expected value argues for running the campaign. The same logic applies to pricing strategy, resource allocation, feature prioritization, and risk assessment — any decision involving multiple uncertain outcomes.
6. Law of large numbers
The law of large numbers states that as more samples are collected, the sample average converges toward the expected value. A fair coin may show 70 per cent heads over the first few flips, but over 10,000 flips the proportion will sit very close to 50 per cent. This is why metrics from small samples cannot be trusted: an A/B test with 50 users per variant may show one variant “winning” purely by chance, while the same test with 5,000 users per variant is far more reliable. The principle underlies statistical-significance testing and sample-size calculations.
7. Central limit theorem
The central limit theorem (CLT) is arguably the most important idea in statistics: take large enough samples and compute their means, and those sample means will follow a normal distribution — even when the original data does not. A common rule of thumb is that sample sizes of around 30 are often sufficient. The CLT is what makes confidence intervals, t-tests, and z-tests work on imperfectly normal data, and it is why inferences about population parameters can be drawn from samples at all.
Wrapping up: limitations and further study
These concepts are not standalone topics; together they form a toolkit used in nearly every data science project. Useful recurring questions include: which distribution is being assumed, which conditional probabilities are being modeled, and what the expected value of a decision is.
Some caveats are worth noting. The rules of thumb above have limits — the CLT’s “around 30” guideline fails for heavily skewed or heavy-tailed data, real events are rarely perfectly independent (weakening binomial and Poisson assumptions), and expected-value analysis ignores risk tolerance, which matters when outcomes are large relative to a budget. For structured practice, resources such as Khan Academy’s statistics and probability course and the SciPy stats documentation pair well with hands-on work. Related reading on this site: popular GitHub repositories for learning AI and handling large datasets in Python.