Probability for Artificial Intelligence: Random Variables, Distributions, and Likelihood
A practical probability toolkit for AI: conditional probability, common distributions, likelihood, and maximum likelihood estimation.
Artificial intelligence operates in a world where observations are incomplete, measurements are noisy, labels can be ambiguous, and future outcomes are unknown. Probability supplies the language and mathematics needed to represent that uncertainty. It lets an AI system express degrees of belief, connect evidence to predictions, compare models, and choose actions when no outcome is guaranteed. This chapter develops the probability concepts that appear throughout machine learning, from events and random variables to distributions, likelihood, estimation, and Monte Carlo methods.
Probability for Artificial Intelligence: Random Variables, Distributions, and Likelihood
Probability is not merely an optional add-on to artificial intelligence. A classifier that outputs a confidence score, a language model that predicts the next token, a robot that estimates its location, and a regression model that describes observation noise all rely on probabilistic ideas. Even optimization objectives that seem purely numerical often come from an underlying probability model.
The central challenge is that an AI system rarely observes everything relevant to its task. An image contains only a finite, noisy view of a scene. A medical dataset records selected measurements rather than a patient's complete biological state. A recommendation system knows some previous interactions but not a user's present intention. Probability provides a disciplined way to reason without pretending that missing information is known.
There are several sources of uncertainty in AI:
- Aleatoric uncertainty is variation inherent in the process, such as sensor noise or genuinely unpredictable customer behavior.
- Epistemic uncertainty comes from limited knowledge, data, or model capacity and may decrease when more informative data become available.
- Label uncertainty arises when classes overlap or annotators disagree.
- Model uncertainty reflects the fact that several parameter settings or model structures may explain the observed sample.
- Decision uncertainty remains when an agent must act before all consequences are known.
A useful probabilistic model does not remove uncertainty. It represents uncertainty in a form that can be checked, updated, and used. This distinction matters because a confident number is not automatically a calibrated probability. If a model assigns probability to many events, approximately 80 percent of those events should occur in a well-calibrated system. Probability theory defines coherent calculations; data and diagnostics determine whether those calculations describe reality well.
Sample Spaces, Outcomes, and Events
Probability begins by specifying what could happen. A random experiment is a process whose particular outcome is not known in advance, even though the set of possible outcomes can be described. Training a model on a randomly selected example, observing whether an email is spam, and recording the number of failed components in a device are all random experiments.
The sample space, written , is the set of all possible elementary outcomes. For a single binary label,
For a six-sided die, . For a continuous sensor reading, the sample space might be an interval of real numbers. In a language model, the immediate sample space can be the finite vocabulary of possible next tokens, even though the space of complete generated sequences is enormous.
An event is a subset of the sample space. If a die is rolled, the event “an even value occurs” is
Events allow statements to be combined with set operations. The union means that at least one of the events occurs. The intersection means that both occur. The complement means that does not occur. Two events are mutually exclusive or disjoint when .
These definitions scale beyond toy examples. Suppose contains all possible images a camera could produce. The event could be “the image contains a pedestrian,” while could be “visibility is below a threshold.” Their intersection describes images with a pedestrian under poor visibility. A probabilistic perception system may need to estimate because its performance depends on the environmental condition.
The probability axioms
A probability measure assigns a number to each event while obeying three axioms:
- Non-negativity: for every event .
- Normalization: .
- Countable additivity: for pairwise disjoint events ,
Many familiar rules follow from these axioms. The impossible event has probability zero, , and complements satisfy
For any two events, whether disjoint or not,
The intersection is subtracted because outcomes shared by and were counted twice. In multiclass classification, predicted class events are normally mutually exclusive, so their probabilities add directly to one. In multilabel classification, however, several labels can be true simultaneously. Treating multilabel outputs as mutually exclusive would impose the wrong probability structure.
Probability as a model
Probability can be interpreted in several compatible practical ways. A frequentist interpretation connects to the long-run relative frequency of under repeated comparable trials. A Bayesian interpretation treats probability as a coherent degree of belief given current information. Machine learning uses both. Evaluation on repeated observations often has a frequentist flavor, while posterior inference explicitly updates uncertainty about unknown parameters.
In either interpretation, probabilities are conditional on modeling assumptions. Saying that a component fails with probability is incomplete unless the operating conditions, population, and time horizon are understood. AI systems can fail when they transport a probability learned in one environment into another where the data-generating process differs. This is one reason distribution shift is a central practical concern.
Conditional Probability and Independence
Evidence changes uncertainty. Conditional probability formalizes the probability of event after learning that event occurred:
Conditioning restricts attention to outcomes in . Among those outcomes, it asks what fraction also belong to . Rearranging the definition gives the multiplication rule
For three events, the chain rule becomes
More generally, a joint distribution over many variables can always be decomposed into a product of conditional distributions. Autoregressive language models use precisely this principle. If are tokens, then
Each next-token prediction is conditional on the preceding context. Multiplying these conditional probabilities assigns a probability to the full sequence.
The law of total probability
Suppose form a partition of the sample space: they are mutually exclusive and together cover all outcomes. Then
This rule averages conditional probabilities over possible cases. For example, the overall probability of a model error can be computed by conditioning on demographic groups, device types, or operating environments. The result depends both on error rates within groups and on how common each group is. A low overall error rate can therefore conceal high error in a small but important subgroup.
Independence
Events and are independent when knowing one does not change the probability of the other:
Equivalently,
Independence is a mathematical property, not a casual claim that two quantities “look unrelated.” It should not be confused with mutual exclusivity. If two nonzero-probability events are mutually exclusive, observing one makes the other impossible, so they are strongly dependent.
Random variables and are independent when their joint distribution factorizes:
in the discrete case, with an analogous equation for continuous densities. Conditional independence is weaker and often more useful:
This notation says that once is known, learning provides no further information about . Probabilistic graphical models encode such relationships. The Naive Bayes classifier assumes that features are conditionally independent given the class label. The assumption is often unrealistic, yet the classifier can still work because useful classification does not require a perfect model of every dependency. You can explore this mechanism with the Naive Bayes Calculator.
Pairwise independence also does not always imply mutual independence. Three variables can be independent in every pair while retaining a three-way constraint. This subtlety matters when factorizing high-dimensional probability models: every omitted dependency is an assumption that should be recognized.
Random Variables: From Outcomes to Numbers
A random variable is a function that maps each outcome in to a numerical value. The randomness comes from the unknown outcome, not from the function itself. If three coin tosses produce an outcome such as HHT, the random variable might count heads, giving .
Random variables make probability suitable for computation. Instead of assigning probabilities only to verbal events, one can ask about , calculate averages, or define losses as functions of model outputs.
Discrete random variables
A discrete random variable takes values in a finite or countably infinite set. Its probability mass function (PMF) is
The PMF satisfies
Examples include a binary class label, the number of clicks in a session, or a sampled token index. Individual values may have positive probability. If is the number of defective products in a batch, is a meaningful mass.
Continuous random variables
A continuous random variable can take values over an interval or collection of intervals. It is described by a probability density function (PDF), . Probabilities are areas under the density:
A valid density satisfies
For a continuous variable, for every exact value . This does not make observations impossible. It means that probability is assigned to intervals, while a point has zero width and therefore zero area. A density value can exceed one as long as its total integral remains one; a density is not itself a probability.
Cumulative distribution functions
Both discrete and continuous variables have a cumulative distribution function (CDF):
The CDF is nondecreasing, approaches zero as , and approaches one as . For a differentiable continuous distribution,
CDFs are especially useful for threshold probabilities, quantiles, and simulation. The -quantile is a value for which reaches . Prediction intervals and anomaly thresholds are often described through quantiles rather than density values.
Joint, marginal, and conditional distributions
AI almost always involves several variables. A joint PMF or joint PDF describes how and vary together. A marginal distribution removes a variable by summation or integration:
for discrete variables, and
for continuous variables. A conditional distribution holds one variable fixed:
Supervised learning can be viewed as estimating a conditional distribution . Generative modeling often aims to represent a joint distribution or a distribution over observations . The distinction influences what a model can sample, classify, or explain.
Expectation, Variance, and Covariance
Probability distributions contain more information than a few summary numbers, but summaries make key properties easier to compare.
Expected value
The expected value or mean of a discrete random variable is
For a continuous variable,
Expectation is a probability-weighted average, not necessarily a value that can occur. A fair six-sided die has expected value , although no roll equals . Under repeated independent trials, the sample mean tends toward the expected value under suitable conditions.
For a function ,
or the corresponding integral. This “law of the unconscious statistician” allows expected losses to be calculated without first deriving the distribution of . Machine learning risk is commonly written
where is a loss function. Training minimizes an empirical approximation because the true data distribution is unknown.
Expectation is linear:
This property holds even when and are dependent.
Variance and standard deviation
The variance measures average squared distance from the mean :
An equivalent computational identity is
Variance is measured in squared units. The standard deviation,
returns to the original units. For constants and ,
Adding a constant changes the center but not the spread. Multiplying by scales deviations by , so variance scales by .
In AI, variance can describe observation noise, variation in predictions across training samples, or uncertainty in parameter estimates. It should not be reduced to a universal notion of “model instability”; its exact interpretation depends on which random quantity and data-generating process are being considered.
Covariance and correlation
The covariance of and is
Equivalently,
Positive covariance means the variables tend to deviate from their means in the same direction. Negative covariance means they tend to deviate in opposite directions. Zero covariance means no linear association, but it does not generally imply independence. A variable such as can depend completely on a symmetric while having zero covariance with it.
Correlation normalizes covariance:
When both standard deviations are positive, correlation lies between and . Covariance matrices extend the idea to vectors. If has mean , then
The diagonal entries are feature variances, and off-diagonal entries are covariances. Covariance matrices appear in Gaussian models, principal component analysis, uncertainty propagation, and optimization. For hands-on calculations involving means, variance, and related summaries, use the Statistics Calculator.
Four Common Distributions in AI
The following distributions form a compact toolkit for labels, counts, categories, and continuous measurements.
| Distribution | Support | Parameters | Mean | Variance | Typical AI use |
|---|---|---|---|---|---|
| Bernoulli | Binary labels and binary events | ||||
| Binomial | Number of successes in repeated trials | ||||
| Gaussian | Noise, residuals, latent variables | ||||
| Categorical | Encoding-dependent | Encoding-dependent | Multiclass labels and token choices |
Bernoulli distribution
A Bernoulli random variable represents one binary trial:
Here, . The compact exponent form produces when and when . Binary classification models commonly predict a Bernoulli parameter conditional on features:
The model's output is therefore not the label itself but a parameter for a distribution over possible labels. Applying a threshold turns that probability into a decision, and changing the threshold changes the trade-off between false positives and false negatives.
Binomial distribution
If are independent Bernoulli variables with the same success probability , their sum
has a Binomial distribution:
The combination term counts how many sequences contain exactly successes. Binomial models are useful for aggregate outcomes such as the number of correct predictions in a fixed evaluation sample, provided trials are reasonably modeled as independent with a common success probability. If examples have different difficulties or are correlated, that assumption may be poor.
Gaussian distribution
The Gaussian or normal distribution has density
The mean determines location and variance determines spread. Gaussian models are common because sums of many small independent influences often have approximately normal behavior, calculations are tractable, and squared-error regression corresponds to maximum likelihood under independent Gaussian errors with constant variance.
Nevertheless, Gaussian assumptions should be checked. Real data may be skewed, heavy-tailed, bounded, multimodal, or heteroscedastic. A Gaussian can assign nonzero density to physically impossible values, such as negative durations. Convenience is not evidence.
The multivariate Gaussian extends the distribution to vectors:
Its covariance matrix controls both marginal spreads and the orientation of equal-density contours.
Categorical distribution
A Categorical variable takes one of unordered categories with probabilities
Thus,
This is the multiclass counterpart of the Bernoulli distribution. Softmax classifiers and next-token language models produce Categorical distributions. If the observed category is represented by a one-hot vector , its probability can be written
The negative log of this expression yields categorical cross-entropy. This connection shows why a standard classification loss is a probabilistic estimation objective rather than an arbitrary penalty.
Probability and Likelihood Are Different Views
Probability and likelihood may use the same mathematical expression, but they answer different questions.
A probability distribution treats parameters as fixed and the data as variable. For a Bernoulli model with , one can ask:
This is a probability statement about a possible observation under a specified model.
A likelihood treats the observed data as fixed and views the same expression as a function of the unknown parameter. After observing ,
The likelihood compares parameter values by how well each makes the observed data plausible. It is not a probability distribution over . In particular, it does not need to integrate to one over the parameter space. Writing emphasizes this change of viewpoint, although many texts use for both contexts.
For independent and identically distributed observations , the likelihood is
Products of many small values can underflow numerically, so computation usually uses the log-likelihood:
The logarithm is strictly increasing, so maximizing the log-likelihood gives the same maximizing parameter as the original likelihood. It also converts products into sums, which are easier to differentiate and more stable to calculate.
Likelihood is relative. A parameter value with twice the likelihood of another explains the observed sample better under the chosen model, but this does not directly give the probability that either parameter is true. To obtain a posterior distribution over parameters, Bayesian inference combines the likelihood with a prior and normalizes the result:
Confusing these quantities is one of the most persistent errors in introductory AI statistics.
Maximum Likelihood Estimation
Maximum likelihood estimation (MLE) selects the parameter value that maximizes the likelihood of the observed data:
The intuition is straightforward: among candidate parameter settings in the assumed model family, choose the one under which the data actually seen are most plausible. MLE does not choose the most probable parameter unless additional assumptions turn the problem into a Bayesian posterior calculation.
Bernoulli MLE derivation
Let be independent Bernoulli observations. Their likelihood is
Let be the number of successes. Then
The log-likelihood is
Differentiate:
Setting the derivative to zero and solving gives
The MLE is the observed fraction of successes. This result is intuitive, but the derivation shows that it follows from a Bernoulli sampling model and independence assumptions.
MLE as loss minimization
Many machine-learning losses are negative log-likelihoods. For a Bernoulli target and predicted probability , the negative log-likelihood is
which is binary cross-entropy. Under Gaussian errors with constant variance, negative log-likelihood differs from sum of squared errors only by constants and a positive scale. Training by cross-entropy or squared error therefore carries assumptions about the conditional distribution of targets.
MLE has strong large-sample properties under suitable regularity conditions, including consistency and asymptotic efficiency. Those properties do not guarantee good estimates from small, biased, or shifted samples. MLE can also overfit highly flexible models. Regularization, validation, and Bayesian priors can stabilize estimation, but each changes the inferential story and should be understood explicitly.
Worked Numeric Example: Estimating a Defect Rate
Suppose an AI-assisted inspection system observes ten components. A value of 1 indicates a defect and 0 indicates no defect:
There are defects among components. Assume, for this simplified example, that outcomes are independent Bernoulli trials with a common unknown defect probability .
The likelihood is
At ,
At ,
At ,
Among these candidates, gives the highest likelihood. The analytic MLE confirms it:
Notice what this result does and does not say. It says that maximizes the Bernoulli likelihood for this observed sample. It does not say there is a 30 percent probability that the true parameter equals . It also does not say the next component is certainly defective with probability exactly under every operating condition. The estimate is based on a small sample and assumptions of independence and constant defect probability.
The expected number of defects in the next 20 comparable components under the fitted model is
and the variance is
The standard deviation is . The expected count six is not a guarantee; the Binomial distribution assigns probability across all counts from zero through twenty.
The probability of exactly six defects is
Thus the single most natural point prediction still represents only part of the distribution. Probabilistic prediction communicates a range of plausible outcomes rather than hiding variation behind one number.
Checking the calculation in Python
The following sample evaluates candidate likelihoods, computes the MLE, and obtains a Binomial probability. In production code, log-likelihoods are preferred when datasets are large.
import numpy as np
from scipy.stats import binom
observations = np.array([1, 0, 0, 1, 0, 0, 0, 1, 0, 0])
n = observations.size
successes = observations.sum()
theta_mle = observations.mean()
candidates = np.array([0.2, 0.3, 0.5])
log_likelihoods = (
successes * np.log(candidates)
+ (n - successes) * np.log1p(-candidates)
)
likelihoods = np.exp(log_likelihoods)
probability_six_of_twenty = binom.pmf(6, n=20, p=theta_mle)
rng = np.random.default_rng(42)
simulated_counts = rng.binomial(n=20, p=theta_mle, size=100_000)
print("MLE:", theta_mle)
print("Candidate likelihoods:", likelihoods)
print("P(K = 6):", probability_six_of_twenty)
print("Monte Carlo estimate:", np.mean(simulated_counts == 6))
The Monte Carlo estimate should be near the exact Binomial probability, with small random variation. Increasing the number of simulations generally reduces that variation.
Sampling and Monte Carlo Intuition
To sample from a distribution is to generate an outcome according to its assigned probabilities. Sampling transforms an abstract distribution into concrete synthetic observations. A language model samples tokens from a Categorical distribution, a diffusion model uses Gaussian noise samples, and a reinforcement-learning agent may sample actions from a policy.
Sampling is not the same as always choosing the most probable outcome. If a Categorical distribution assigns probabilities , argmax selection always returns the first category. Repeated sampling returns the categories in approximate proportions 60, 30, and 10 percent. Argmax is deterministic exploitation; sampling preserves modeled uncertainty and can support exploration or diverse generation.
Monte Carlo methods use random samples to approximate quantities that may be difficult to compute analytically. If and the target is
draw independent samples and estimate
The law of large numbers explains why this average approaches the expectation as grows. The typical standard error decreases at rate . Reducing Monte Carlo error by a factor of ten therefore usually requires roughly one hundred times as many independent samples. This slow but dimension-tolerant convergence is both a limitation and a reason Monte Carlo remains valuable in high-dimensional problems.
A geometric example
One can estimate by sampling points uniformly from the square . A point lies in the unit circle when
The circle's area is and the square's area is four, so the fraction of sampled points inside the circle approaches . Multiplying that fraction by four estimates . This is not the most efficient way to calculate , but it illustrates the general method: convert a desired quantity into an expectation or event probability, sample, and average.
Monte Carlo in AI
Monte Carlo ideas appear in many AI techniques:
- estimating expected rewards in reinforcement learning;
- approximating predictive uncertainty by repeated stochastic forward passes;
- sampling latent variables in generative models;
- integrating over uncertain parameters in Bayesian inference;
- evaluating rare-event probabilities;
- approximating gradients when exact expectations are unavailable.
Sampling quality matters. Correlated samples contain less information than the same number of independent samples. Poor random-number handling can make results irreproducible. Rare events may require impractically many naive samples before even one occurrence appears. Importance sampling, Markov chain Monte Carlo, stratification, and variance-reduction methods address different versions of these problems.
A Monte Carlo output should ideally include an uncertainty estimate, not only a simulated mean. Otherwise users may mistake numerical randomness for meaningful precision. Repeating the simulation, computing standard errors, and checking convergence across sample sizes are basic safeguards.
Common Mistakes and How to Avoid Them
Confusing likelihood with probability
After data are observed, is a function of , but it is not automatically a probability distribution over . Statements such as “the likelihood that is 40 percent” are invalid unless a normalized posterior or another explicitly defined probability distribution is being used.
Keep the direction clear:
- Probability: parameters fixed, possible data vary.
- Likelihood: observed data fixed, candidate parameters vary.
- Posterior: parameters vary probabilistically after combining likelihood with a prior.
Confusing likelihood with posterior
The posterior is proportional to likelihood times prior:
Maximum likelihood ignores the prior. Maximum a posteriori estimation, or MAP, maximizes the posterior and can produce a different answer. The two coincide only under particular conditions, such as an effectively uniform prior over the relevant range.
Treating a density as a point probability
For a continuous variable, is a density and . Probability comes from integrating over an interval. Comparing density heights can still be useful, but saying “the probability is 1.4” because a density equals 1.4 is incorrect.
Assuming independence without justification
Multiplying marginal probabilities is valid only under independence. Repeated observations from the same user, patient, device, or time series are often correlated. Ignoring grouping can overstate the effective sample size and produce overly confident estimates.
Equating zero correlation with independence
Zero correlation rules out a linear association, not all dependence. Independence implies zero covariance when the relevant moments exist, but the converse is generally false. Visual checks and nonlinear dependence measures may reveal structure missed by correlation.
Interpreting expectation as the most likely outcome
The expected value need not be an attainable or high-probability result. Expected class labels are especially hard to interpret when category numbers are arbitrary. Use the complete predictive distribution, appropriate quantiles, or decision-specific summaries.
Ignoring the data-generating process
A precise calculation under the wrong model remains wrong for the application. Selection bias, distribution shift, label leakage, censoring, changing environments, and measurement error can all invalidate a probabilistic conclusion. Probability theory ensures internal coherence, not external relevance.
Trusting uncalibrated confidence
Neural networks can assign extreme softmax scores to incorrect predictions. A score called “probability” should be tested with calibration curves, proper scoring rules, and evaluation on representative held-out data. Calibration can also change under distribution shift.
Multiplying probabilities directly in software
Products of many probabilities can underflow to zero. Use log-probabilities and sum them. Stable library functions such as logsumexp and log1p also avoid precision loss in common calculations.
Using the same data for fitting and final evaluation
Likelihood measures fit to observed training data. A more flexible model can attain higher training likelihood while generalizing worse. Validation and test sets estimate performance on unseen examples; information criteria and regularization address related complexity concerns under specific assumptions.
Practice Probability with Solver360
Probability becomes clearer when each formula is connected to a small calculation. Begin with simple events and then move toward model-based inference.
First, create a two-event scenario. Choose values for , , and that satisfy the probability axioms. Compute , , and both conditional probabilities. Then test whether the events are independent by comparing with .
Second, build a short discrete distribution. Assign probabilities to values , , , and , ensuring that they sum to one. Calculate expectation, variance, and standard deviation by hand, then verify the results with the Statistics Calculator. Change the probability of the largest value and observe how the mean and variance respond differently.
Third, reproduce the Bernoulli worked example with another binary dataset. Count successes, write the likelihood, derive the MLE, and compare likelihood values around the estimate. Try a very small sample such as and notice that the MLE lies at the boundary . This illustrates why small-sample estimates can be extreme and why smoothing or priors may be useful.
Fourth, use the Naive Bayes Calculator to examine class priors, feature likelihoods, and class scores. Identify which quantities are probabilities of evidence given a class and which result is the posterior probability of a class given evidence. Change the prior while holding the likelihood terms fixed. The posterior should change, demonstrating why likelihood alone is not a posterior.
Fifth, simulate a Binomial distribution. Draw many sets of Bernoulli trials, record each total, and compare the simulated histogram with the analytic PMF. Repeat with , , and Monte Carlo repetitions. The empirical frequencies should become more stable, although they will not become perfectly exact.
Finally, connect probability to model evaluation. Collect predicted binary probabilities and outcomes, group predictions into probability ranges, and compare average confidence with observed frequency. A group predicted near should contain roughly 70 percent positive outcomes if the predictions are calibrated and the evaluation sample is representative.
The purpose of these exercises is not to memorize isolated equations. It is to practice identifying the random experiment, sample space, event, variable, distribution, fixed parameter, and observed data in each problem. Once those roles are explicit, many apparent contradictions disappear.
Further Conceptual Connections
Probability provides a common foundation beneath many AI methods. Logistic regression models a conditional Bernoulli probability. Softmax regression models a conditional Categorical distribution. Linear regression is often presented with Gaussian conditional errors. Hidden Markov models factor a sequence distribution using conditional independence. Bayesian networks represent a joint distribution through a directed graph. Reinforcement learning uses expectations over uncertain transitions and rewards.
Loss functions also encode distributional choices. Squared error emphasizes large residuals and corresponds naturally to Gaussian noise. Absolute error is connected to Laplace noise and conditional medians. Cross-entropy is a negative log-likelihood for Bernoulli or Categorical outcomes. Choosing a loss therefore means choosing which errors matter and, often, what probabilistic model is being implied.
Probabilistic thinking also clarifies the distinction between prediction and decision. A model may estimate
but whether to act depends on consequences. If missing a rare disease is far more costly than ordering an additional test, the decision threshold may be much lower than . Probability describes uncertainty; utility or cost determines how an agent should respond to it.
Frequently Asked Questions
Why is uncertainty central to artificial intelligence?
AI systems act from limited data in environments that contain noise, hidden causes, and future variation. A deterministic point prediction hides these conditions. Probability lets a system represent alternatives, quantify confidence, update beliefs with evidence, and optimize expected consequences. It does not make a system automatically reliable, but it makes assumptions and uncertainty available for analysis.
What is the difference between an event and a random variable?
An event is a subset of possible outcomes, such as “the next label is positive.” A random variable is a numerical function of outcomes, such as a variable taking value one for a positive label and zero otherwise. Events involving a random variable can be written as sets, for example or .
Can a probability density be greater than one?
Yes. A density is not a probability at a point. It is probability per unit of the variable, and probabilities are integrals over intervals. A density may exceed one over a narrow region while its total integral remains one. For example, a uniform density on has height two and total area one.
Are mutually exclusive events independent?
Generally, no. If nonzero-probability events are mutually exclusive, observing one tells you the other did not occur. Their intersection has probability zero, while independence would require . Only special cases involving zero-probability events avoid this conflict.
Why use log-likelihood instead of likelihood?
Likelihood products can become too small for floating-point arithmetic, especially with large datasets. Taking logarithms converts products into sums and improves numerical stability. Because the logarithm is strictly increasing, the parameter that maximizes log-likelihood also maximizes likelihood.
Is maximum likelihood estimation Bayesian?
No. MLE treats the observed data as fixed and chooses the parameter that maximizes their likelihood. Bayesian inference places a prior distribution on parameters and computes a posterior distribution after observing data. MAP estimation maximizes that posterior and can resemble regularized MLE, but it is conceptually distinct.
Does independence mean two variables have no relationship?
Statistical independence means their joint distribution factorizes and knowing one does not change the distribution of the other. It is stronger than zero correlation. In a causal setting, the phrase “no relationship” is broader and can be misleading because selection, conditioning, or hidden variables may alter observed dependencies.
Why is the Gaussian distribution so common in machine learning?
It has convenient mathematical properties, is determined by a mean and covariance, and can arise approximately when many small independent contributions are added. It also connects Gaussian error assumptions to squared-error optimization. However, its popularity does not justify using it for skewed, bounded, heavy-tailed, or multimodal data without checking fit.
What is the difference between aleatoric and epistemic uncertainty?
Aleatoric uncertainty describes variation inherent in outcomes under the available information, while epistemic uncertainty describes uncertainty due to limited knowledge or data. More representative observations may reduce epistemic uncertainty. Aleatoric uncertainty may remain even with abundant data, although the practical boundary between the two depends on what information the model is allowed to observe.
How many Monte Carlo samples are enough?
There is no universal number. The required sample size depends on the estimator's variance, the desired precision, sample dependence, and whether rare events dominate. Track estimates and standard errors as sample size grows. Since ordinary Monte Carlo error usually decreases like , demanding one extra decimal place can be expensive.
Is the most likely class always the best decision?
No. The best decision depends on costs, benefits, constraints, and downstream effects. The most probable class minimizes error only under a specific symmetric zero-one loss. Medical screening, fraud detection, and safety systems often require different thresholds because false positives and false negatives have different consequences.
Can a model have high likelihood and still be poor?
Yes. It may overfit training data, rely on an inappropriate distribution family, be evaluated under distribution shift, or assign poor probabilities to practically important subgroups. Training likelihood is one diagnostic, not a complete measure of generalization, calibration, fairness, or usefulness.
Where to Go Next
The natural next topic is Bayes' theorem, which reverses a conditional probability by combining a likelihood with a prior. It explains posterior inference, diagnostic reasoning, Bayesian classifiers, and principled parameter uncertainty:
After Bayes' theorem, study information theory. Entropy measures uncertainty in a distribution, cross-entropy evaluates probabilistic predictions, and Kullback–Leibler divergence compares distributions. These ideas connect probability directly to the objectives used in classification, representation learning, compression, and generative AI.
Together, probability, Bayesian reasoning, and information theory form a coherent sequence. Probability defines uncertain quantities and their distributions. Bayes' theorem explains how evidence changes beliefs. Information theory measures uncertainty and the cost of representing or approximating distributions. With these foundations, likelihoods and losses stop appearing as disconnected formulas and become parts of one mathematical account of learning from uncertain data.
Continue reading
Bayes' Theorem for Machine Learning: Priors, Posteriors, and Naive Bayes
Priors, likelihoods, and posteriors with worked examples, plus the independence assumption, smoothing, and log-probabilities behind Naive Bayes.
Statistics for Machine Learning: Expectation, Variance, Bias, and Evaluation
The statistics that sit under model evaluation: sampling, bias-variance, correlation, confidence, and why train/test splits exist.