Hassan Ijaz

Ai, Web & Design
← Back to all topics
Probability FundamentalsTopic 5 of 58

Joint, marginal, and conditional distributions

3D surface plot that users can rotate and slice to see marginal distributions on axes and conditional distributions as cross-sections

Concept Overview

Joint, marginal, and conditional distributions are fundamental concepts for understanding how multiple random variables relate to each other. They allow us to analyze complex systems with multiple sources of uncertainty.

Joint Distribution

The joint distribution describes the probability of multiple random variables taking specific values simultaneously.

  • Notation: P(X=x, Y=y) or f(x,y) for continuous
  • Contains complete information about all variables
  • Can be visualized as a 2D table (discrete) or 3D surface (continuous)
  • Sum/integral over all values equals 1

Example: P(Rain, Temperature) tells us the probability of different rain/temperature combinations

Marginal Distribution

The marginal distribution of one variable is obtained by "summing out" or "integrating out" the other variables from the joint distribution.

  • P(X=x) = Σ_y P(X=x, Y=y) for discrete
  • f_X(x) = ∫ f(x,y) dy for continuous
  • Represents the distribution of one variable ignoring others
  • Named "marginal" because often written in table margins

Think of it as: "What's the probability of X, regardless of what Y is?"

Conditional Distribution

The conditional distribution shows how one variable behaves when we know the value of another variable.

  • P(X=x|Y=y) = P(X=x, Y=y) / P(Y=y)
  • Represents a "slice" of the joint distribution
  • Each conditional distribution is a valid probability distribution
  • Different from marginal - uses specific Y value, not all Y values

Key insight: P(X,Y) = P(X|Y) × P(Y) = P(Y|X) × P(X)

Independence

Two variables X and Y are independent if and only if:

  • P(X,Y) = P(X) × P(Y) for all x,y
  • P(X|Y) = P(X) for all y
  • P(Y|X) = P(Y) for all x
  • Knowing one tells us nothing about the other

Practical Example

Consider height (X) and weight (Y) of people:

  • Joint: P(height=6ft, weight=180lbs) - specific combination
  • Marginal: P(height=6ft) - all people 6ft tall, any weight
  • Conditional: P(weight|height=6ft) - weight distribution for 6ft people only

The 3D visualization below lets you explore these concepts interactively. Rotate to see the joint distribution, project onto axes for marginals, and slice at specific values for conditionals.

Interactive Visualization

Loading interactive visualization...

3D surface plot that users can rotate and slice to see marginal distributions on axes and conditional distributions as cross-sections