Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 11 of 22

Compute expectations without deriving every transformed law

Use sums, integrals and integrability conditions.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

A uniformly chosen X in (0,3) is squared to form a cost. The mean input is 3/2, but the mean squared cost is not necessarily (3/2)². Predict the direction of the discrepancy before integrating. Squaring emphasizes large magnitudes, so a nonlinear operation need not commute with averaging.

Predict

Could you calculate E(X²) without first finding the density of X²? Yes: average the function x² against the known law of X. The law of the unconscious statistician, often abbreviated LOTUS, formalizes this direct calculation rather than licensing arbitrary substitution into a mean.

Experiment

Since f_X(x)=1/3 on (0,3), E(X²)=∫₀³x²/3 dx=3. By contrast, [E(X)]²=9/4. Their gap is 3/4, the variance of X.

For a discrete comparison, let X equal −2 or 1 with probabilities 1/3 and 2/3. Then E(X)=0, while E(X²)=4/3+2/3=2. Build a ledger with columns for value, probability, value times probability and squared value times probability. The same weights average different functions.

Understand

For a discrete law, E[g(X)]=Σg(x)P(X=x). For an absolutely continuous law, E[g(X)]=∫g(x)f_X(x)dx. More generally the expectation integrates g against the distribution of X. This identity lets us compute moments, costs and indicators without first deriving the full transformed law.

For nonnegative g, the expectation is defined as a nonnegative value that may be infinite. For signed g, a finite expectation is ensured by E|g(X)|<∞. If positive and negative contributions both diverge, their difference is undefined, not zero by cancellation. Treating divergent parts as ordinary numbers leads to false conclusions.

Linearity holds for integrable random variables: E(aX+bY)=aE(X)+bE(Y), without independence. This is a property of integration. Products do not generally factor, and nonlinear functions do not generally pass through expectation. Independence can justify product factorization under suitable integrability, while convexity yields inequalities rather than equality for many nonlinear functions.

An expectation can lie outside the set of attainable outcomes. A fair ±1 variable has mean zero but never equals zero. The mean is a weighted center or long-run target under appropriate repetition assumptions, not a prediction that every single observation will equal it.

The symmetric Cauchy density 1/[π(1+x²)] illustrates why symmetry alone does not establish a mean of zero. Its positive first-moment integral diverges logarithmically, as does the magnitude of the negative part. A symmetric principal-value cancellation can be zero, but the ordinary expectation does not exist. Its absolute first moment is infinite.

Expectation calculations depend on the whole law, including rare large outcomes. A small sample can miss those tails. A neat finite average from a few observations does not prove the corresponding population expectation exists or is well estimated. Distinguish a mathematical model’s moments from evidence about that model.

Apply

Use LOTUS to calculate the practice absolute-value expectation directly. Then explain why the Cauchy principal value is a different object from an ordinary expectation. Your written argument should identify both divergent signed parts, not merely note that an integral looks difficult.

Continue

Next connect moments to variance and survival probabilities. Nonnegative integrals permit useful interchange arguments even when a moment is infinite.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

X is uniform on (0,2). Find E(X²).

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

X takes −1 and 2 with probabilities 2/3 and 1/3. Find E(|X|).

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

For a signed real-valued expectation to be finite, a sufficient and standard condition is:

Your response

Linearity E(X+Y)=E(X)+E(Y) for integrable variables requires:

Your response

For X equally likely −1 or 1, compare E(X²) with [E(X)]² and explain the error in interchanging squaring and averaging.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

The symmetric density 1/[π(1+x²)] has a principal-value integral of x equal to zero. Explain why that does not give an ordinary expectation.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.