Fiveable

Calculus IV Unit 12 Review

QR code for Calculus IV practice questions

12.2 Probability and expected values

12.2 Probability and expected values

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
Calculus IV
Unit & Topic Study Guides

Probability and expected values connect calculus with real-world modeling of uncertainty. By extending integration to two dimensions, you can compute probabilities, averages, and measures of spread for pairs of continuous random variables.

This topic covers joint and marginal probability density functions, conditional probability, and expected values/variances, all computed through double integrals.

Joint and Marginal Probability Density Functions

Defining Joint and Marginal Probability Density Functions

A joint probability density function f(x,y)f(x,y) describes how probability is distributed across all possible pairs of values for two continuous random variables XX and YY. Think of it as a surface over the xyxy-plane whose "volume" under any region gives the probability of landing in that region.

Every valid joint pdf must satisfy two properties:

  • Non-negativity: f(x,y)0f(x,y) \geq 0 for all xx and yy
  • Total probability equals 1: f(x,y)dxdy=1\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(x,y)\, dx\, dy = 1

A marginal probability density function isolates one variable by "integrating out" the other. If you only care about XX, you sum up (integrate) all the contributions from every possible yy:

fX(x)=f(x,y)dyf_X(x) = \int_{-\infty}^{\infty} f(x,y)\, dy

Similarly, the marginal pdf of YY is:

fY(y)=f(x,y)dxf_Y(y) = \int_{-\infty}^{\infty} f(x,y)\, dx

The marginal pdf reduces a two-variable problem back to a single-variable one, which is useful when you need the distribution of just one of the two variables.

Calculating Probabilities Using Double Integrals

To find the probability that (X,Y)(X,Y) lands in some region RR of the xyxy-plane, integrate the joint pdf over that region:

P((X,Y)R)=Rf(x,y)dAP((X,Y) \in R) = \iint_R f(x,y)\, dA

Here dAdA is the area element (dxdydx\,dy or dydxdy\,dx, depending on your order of integration), and RR is whatever region the problem specifies.

Example: Suppose f(x,y)=6xyf(x,y) = 6xy on the triangular region where 0x10 \leq x \leq 1 and 0y1x0 \leq y \leq 1 - x (and f=0f = 0 elsewhere). To verify this is a valid pdf, check that the total integral equals 1:

0101x6xydydx=016x(1x)22dx=013x(1x)2dx=1\int_0^1 \int_0^{1-x} 6xy\, dy\, dx = \int_0^1 6x \cdot \frac{(1-x)^2}{2}\, dx = \int_0^1 3x(1-x)^2\, dx = 1

To find the probability that, say, X1/2X \leq 1/2 and Y1/2Y \leq 1/2, you'd integrate 6xy6xy over the appropriate sub-region of the triangle.

Conditional Probability

Defining Joint and Marginal Probability Density Functions, integration - Joint and marginal distributions and expectations (Is my proof right ...

Definition and Formula

Conditional probability answers the question: given that XX takes a particular value xx, how is YY distributed?

The conditional pdf of YY given X=xX = x is:

fYX(yx)=f(x,y)fX(x),provided fX(x)>0f_{Y|X}(y|x) = \frac{f(x,y)}{f_X(x)}, \quad \text{provided } f_X(x) > 0

You're dividing the joint density by the marginal density of the known variable. This "slices" the joint distribution at a fixed xx and rescales it so it integrates to 1 over yy.

The symmetric version gives the conditional pdf of XX given Y=yY = y:

fXY(xy)=f(x,y)fY(y)f_{X|Y}(x|y) = \frac{f(x,y)}{f_Y(y)}

Calculating Conditional Probabilities

Once you have the conditional pdf, computing a conditional probability is a single-variable integral.

To find P(cYdX=x)P(c \leq Y \leq d \mid X = x):

  1. Compute the marginal fX(x)f_X(x) by integrating f(x,y)f(x,y) over all yy.
  2. Form the conditional pdf: fYX(yx)=f(x,y)fX(x)f_{Y|X}(y|x) = \frac{f(x,y)}{f_X(x)}.
  3. Integrate over the desired range of yy:

P(cYdX=x)=cdfYX(yx)dyP(c \leq Y \leq d \mid X = x) = \int_c^d f_{Y|X}(y|x)\, dy

The same steps apply (with roles swapped) for P(aXbY=y)P(a \leq X \leq b \mid Y = y).

Expected Value and Variance

Defining Joint and Marginal Probability Density Functions, probability - Joint distribution of multiple binomial distributions - Mathematics Stack Exchange

Expected Value

The expected value (mean) of a random variable tells you the "center of mass" of its distribution.

For a single variable with pdf f(x)f(x):

E(X)=xf(x)dxE(X) = \int_{-\infty}^{\infty} x\, f(x)\, dx

When you're working with a joint pdf f(x,y)f(x,y) and want the expected value of XX, you integrate xx weighted by the joint density over the entire plane:

E(X)=xf(x,y)dxdyE(X) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} x\, f(x,y)\, dx\, dy

This is equivalent to computing E(X)=xfX(x)dxE(X) = \int_{-\infty}^{\infty} x\, f_X(x)\, dx using the marginal, but sometimes it's easier to work directly with the joint pdf.

More generally, for any function g(X,Y)g(X,Y):

E(g(X,Y))=g(x,y)f(x,y)dxdyE(g(X,Y)) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} g(x,y)\, f(x,y)\, dx\, dy

This formula is the workhorse for computing variances, covariances, and other quantities.

Variance

Variance measures how spread out a distribution is around its mean μX=E(X)\mu_X = E(X):

Var(X)=E ⁣((XμX)2)=(xμX)2f(x)dx\text{Var}(X) = E\!\left((X - \mu_X)^2\right) = \int_{-\infty}^{\infty} (x - \mu_X)^2\, f(x)\, dx

The computational shortcut is often easier to use in practice:

Var(X)=E(X2)(E(X))2\text{Var}(X) = E(X^2) - \left(E(X)\right)^2

where E(X2)=x2f(x)dxE(X^2) = \int_{-\infty}^{\infty} x^2\, f(x)\, dx.

Steps to compute variance:

  1. Find E(X)E(X).
  2. Find E(X2)E(X^2) using the same integration technique but with x2x^2 in the integrand.
  3. Subtract: Var(X)=E(X2)(E(X))2\text{Var}(X) = E(X^2) - (E(X))^2.

The standard deviation σX=Var(X)\sigma_X = \sqrt{\text{Var}(X)} puts the spread back in the same units as XX.

Covariance and Correlation

Covariance

Covariance quantifies how two random variables move together. If large values of XX tend to occur with large values of YY, the covariance is positive; if large XX pairs with small YY, it's negative.

Cov(X,Y)=E ⁣((XμX)(YμY))=(xμX)(yμY)f(x,y)dxdy\text{Cov}(X,Y) = E\!\left((X - \mu_X)(Y - \mu_Y)\right) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} (x - \mu_X)(y - \mu_Y)\, f(x,y)\, dx\, dy

The computational shortcut:

Cov(X,Y)=E(XY)E(X)E(Y)\text{Cov}(X,Y) = E(XY) - E(X)\,E(Y)

where E(XY)=xyf(x,y)dxdyE(XY) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} xy\, f(x,y)\, dx\, dy.

  • Positive covariance: XX and YY tend to increase together.
  • Negative covariance: one tends to increase as the other decreases.
  • Zero covariance: no linear relationship (but a nonlinear relationship could still exist).

Correlation Coefficient

Covariance depends on the scale of XX and YY, which makes it hard to interpret the magnitude. The correlation coefficient normalizes covariance to a dimensionless number:

ρXY=Cov(X,Y)σXσY\rho_{XY} = \frac{\text{Cov}(X,Y)}{\sigma_X\, \sigma_Y}

Properties of ρXY\rho_{XY}:

  • Always satisfies 1ρXY1-1 \leq \rho_{XY} \leq 1
  • ρXY=1\rho_{XY} = 1: perfect positive linear relationship
  • ρXY=1\rho_{XY} = -1: perfect negative linear relationship
  • ρXY=0\rho_{XY} = 0: no linear relationship (same caveat as covariance about nonlinear dependence)