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 15 of 22

Condition on a coordinate using a density ratio

Normalize each slice and avoid a zero-probability event ratio.

Loading your saved responses…

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

Try

Use the triangular model with density 1/2 on 0<x<y<2. Once Y is known to equal y, the allowable X values range only from zero to y. Predict how the conditional support changes as y changes, and why the conditional density must become taller when the interval becomes shorter.

Predict

Since Y is continuous, P(Y=y)=0 at every point. Predict why the elementary event ratio cannot directly define P(X in A|Y=y). A conditional-density construction divides density functions, not two zero point probabilities. Its validity comes from reconstructing joint probabilities by integration.

Experiment

The marginal density is f_Y(y)=y/2. Therefore f_(X|Y)(x|y)=(1/2)/(y/2)=1/y for 0<x<y and 0<y<2. This integrates to one over its conditional support. At y=3/2, the conditional mean is 3/4 and P(X<1/2|Y=3/2)=(1/2)/(3/2)=1/3.

Reverse the conditioning. Since f_X(x)=(2−x)/2, Y given X=x has density 1/(2−x) on x<y<2. Its mean is (x+2)/2. Draw the horizontal and vertical slices and normalize each separately; reversed conditioning changes both denominator and support.

For live exploration, the widget uses a separate unit triangle with the coordinate roles reversed: density 2 on 0<y<x<1. Here Y given X=x is Uniform(0,x). Keep that support distinct from the worked triangle above. Predict the slice probability, then shrink the conditioning bin and compare its ordinary event ratio with the density-based conditional value.

Live experiment: conditioning reshapes a density

The joint density is f(x,y)=2 on the triangle 0<y<x<1 and zero elsewhere. The triangle has area 1/2, so its total probability is 1. Predict P(Y≤b | X=x), then compare an exact density slice with conditioning on a narrow interval around x.

Triangular support, finite bin and density sliceBoth axes run from zero to one with equal scales. The support is below y=x. A gold vertical strip selects the finite bin; the dark blue polygon is the part with y at most b. A dashed vertical line marks X=x. Densities are constant over areas, not heights in this support diagram.000.20.20.40.40.60.60.80.811xy
Gold plus dark blue: the whole finite bin within the triangle. Dark blue: its event Y≤b. Vertical dashed line: the density slice X=x. Horizontal dotted line: y=b. Boundaries have probability zero for this continuous model.

The marginal density at x is ∫₀ˣ2 dy=2x=0.8. Dividing joint by marginal gives f(Y | X=x)=1/x=2.5 on 0<y<x. Thus P(Y≤b | X=x)=0.75 and E[Y | X=x]=x/2=0.2.

For the finite bin [0.2,0.6], its probability is ∫2u du=0.32. The joint event has probability ∫2min(b,u)du=0.23. Their ratio is 0.71875. The integrals here run over the bin, and u is the integration variable for X.

P(X=x)=0, so the density slice is not obtained by dividing event probabilities by P(X=x). For 0<x<1, the joint-to-marginal density ratio defines the specified density-based conditional law. Its conditional CDF matches the shrinking-bin limit in this example. Conditional laws at individual zero-probability points are only determined up to a version; the density formula supplies our convention.

Keep x=0.4,b=0.3 and shrink the bin. Then set b above x: explain why the slice probability reaches 1 while a wide bin may still include X values above b. The shaded areas are support regions, not a density-height plot; probability is twice their area. All values follow exact integrals evaluated with rounded browser arithmetic. Settings are temporary.

Understand

Where f_Y(y)>0, a standard conditional density is f_(X|Y)(x|y)=f_(X,Y)(x,y)/f_Y(y). It is constructed so f_(X,Y)=f_(X|Y)f_Y and the resulting iterated integrals recover joint event probabilities. This connects density conditioning with the multiplication rule without dividing by the probability of a point.

For discrete variables, the familiar positive-probability event ratio applies directly. For mixed laws or more general random variables, conditional distributions require more care. This unit develops explicit discrete and density cases and states the almost-everywhere qualification rather than pretending every possible conditioning value has a uniquely determined elementary ratio.

If f_Y(y)=0, the ratio does not specify a law. Assignments on a marginal-null set can be changed without altering joint integrals, so conditional distributions are generally defined only almost everywhere with respect to the conditioning marginal. A chosen version may extend a convenient formula to a boundary, but that extension is a convention or continuity choice, not forced by a zero denominator.

Conditional expectations integrate against the conditional law. In the uniform slice, E(X|Y=y)=∫₀ʸx/y dx=y/2. This is a function of y, not a prediction that every X equals its midpoint. Conditional variance likewise measures remaining variability inside the slice and need not match the marginal variance.

A density value can exceed one, including a conditional density on a short interval. The normalization integral, not the height, equals one. Likewise, a conditional probability must use the intersection of its event with the conditional support; integrating past the support would add nonexistent mass.

Conditional information can reveal or induce dependence. It is not automatically a causal intervention. Knowing a coordinate and actively setting a variable can correspond to different models when selection or confounding is present.

Apply

For the practice triangle on the unit square, derive both conditional directions and verify each integrates to one. Explain the unsupported boundary values separately. A complete solution names the conditioning range, inner support, density and normalization rather than reporting only a ratio.

Continue

Next compare independence with covariance. A joint law can have zero linear association while remaining completely dependent through a nonlinear relationship.

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.

For joint density 2 on 0<x<y<1, find f_(X|Y)(x|y) at x=1/4,y=1/2.

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

In that model, find E(X|Y=3/4).

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

For a continuous Y, f_(X|Y)(x|y)=f_(X,Y)(x,y)/f_Y(y) is:

Your response

A valid conditional density for a supported y must integrate in x to:

Your response

For density 2 on 0<x<y<1, derive the law of Y given X=x and its mean for 0<x<1.

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.

Why is a conditional density formula only specified almost everywhere with respect to the conditioning marginal?

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.