Skip to main content
added 12 characters in body
Source Link
Michael Hardy
  • 11k
  • 1
  • 33
  • 56

Think about this geometrically: we've got $(X,Y)$ uniformly distributed over the right triangle with vertices at $(0,0)$, $(2,0)$, and $(0,6)$.

If we imagine sampling over and over from this region uniformly, we can picture $E(X|Y=5)$$E(X\mid Y=5)$ as the average $x$ coordinate of the points that end up on the horizontal line $y=5$. All of these points will necessarily have $0 < x < 1/3$, since if $x \geq 1/3$ then $y = 5$ can't happen, and since the points are uniform over this line, this image suggests $E(X|Y=5) \stackrel ?= 1/6$$E(X\mid Y=5) \stackrel {\text{?}}= 1/6$ (this is the midpoint of the range of $x$ points that can end up on this line).

Checking this with calculus, the issue with what you did is the limits of integration for $x$ also depend on $y$. If $y = 5$ is observed then the biggest that $x$ can be is $1/3$, so really $$ E(X|Y=5) = \int_0^{1/3}x \frac{3}{6-y}\,\text dx = 3 \cdot \frac 12 x^2\bigg|_{x=0}^{x=1/3} = \frac 16. $$$$ E(X\mid Y=5) = \int_0^{1/3}x \frac{3}{6-y}\,\text dx = 3 \cdot \frac 12 x^2\bigg|_{x=0}^{x=1/3} = \frac 16. $$


Another quick sanity check is that $E(X|Y)$$E(X\mid Y)$ has to be within the range of $X$, so $E(X|Y=5)\neq 6$$E(X\mid Y=5)\neq 6$ can be recognized as incorrect before the negative variance shows up.

Think about this geometrically: we've got $(X,Y)$ uniformly distributed over the right triangle with vertices at $(0,0)$, $(2,0)$, and $(0,6)$.

If we imagine sampling over and over from this region uniformly, we can picture $E(X|Y=5)$ as the average $x$ coordinate of the points that end up on the horizontal line $y=5$. All of these points will necessarily have $0 < x < 1/3$, since if $x \geq 1/3$ then $y = 5$ can't happen, and since the points are uniform over this line, this image suggests $E(X|Y=5) \stackrel ?= 1/6$ (this is the midpoint of the range of $x$ points that can end up on this line).

Checking this with calculus, the issue with what you did is the limits of integration for $x$ also depend on $y$. If $y = 5$ is observed then the biggest that $x$ can be is $1/3$, so really $$ E(X|Y=5) = \int_0^{1/3}x \frac{3}{6-y}\,\text dx = 3 \cdot \frac 12 x^2\bigg|_{x=0}^{x=1/3} = \frac 16. $$


Another quick sanity check is that $E(X|Y)$ has to be within the range of $X$, so $E(X|Y=5)\neq 6$ can be recognized as incorrect before the negative variance shows up.

Think about this geometrically: we've got $(X,Y)$ uniformly distributed over the right triangle with vertices at $(0,0)$, $(2,0)$, and $(0,6)$.

If we imagine sampling over and over from this region uniformly, we can picture $E(X\mid Y=5)$ as the average $x$ coordinate of the points that end up on the horizontal line $y=5$. All of these points will necessarily have $0 < x < 1/3$, since if $x \geq 1/3$ then $y = 5$ can't happen, and since the points are uniform over this line, this image suggests $E(X\mid Y=5) \stackrel {\text{?}}= 1/6$ (this is the midpoint of the range of $x$ points that can end up on this line).

Checking this with calculus, the issue with what you did is the limits of integration for $x$ also depend on $y$. If $y = 5$ is observed then the biggest that $x$ can be is $1/3$, so really $$ E(X\mid Y=5) = \int_0^{1/3}x \frac{3}{6-y}\,\text dx = 3 \cdot \frac 12 x^2\bigg|_{x=0}^{x=1/3} = \frac 16. $$


Another quick sanity check is that $E(X\mid Y)$ has to be within the range of $X$, so $E(X\mid Y=5)\neq 6$ can be recognized as incorrect before the negative variance shows up.

added 178 characters in body
Source Link
jld
  • 20.8k
  • 2
  • 64
  • 69

Think about this geometrically: we've got $(X,Y)$ uniformly distributed over the right triangle with vertices at $(0,0)$, $(2,0)$, and $(0,6)$.

If we imagine sampling over and over from this region uniformly, we can picture $E(X|Y=5)$ as the average $x$ coordinate of the points that end up on the horizontal line $y=5$. All of these points will necessarily have $0 < x < 1/3$, since if $x \geq 1/3$ then $y = 5$ can't happen, and since the points are uniform over this line, this image suggests $E(X|Y=5) \stackrel ?= 1/6$ (this is the midpoint of the range of $x$ points that can end up on this line).

Checking this with calculus, the issue with what you did is the limits of integration for $x$ also depend on $y$. If $y = 5$ is observed then the biggest that $x$ can be is $1/3$, so really $$ E(X|Y=5) = \int_0^{1/3}x \frac{3}{6-y}\,\text dx = 3 \cdot \frac 12 x^2\bigg|_{x=0}^{x=1/3} = \frac 16. $$


Another quick sanity check is that $E(X|Y)$ has to be within the range of $X$, so $E(X|Y=5)\neq 6$ can be recognized as incorrect before the negative variance shows up.

Think about this geometrically: we've got $(X,Y)$ uniformly distributed over the right triangle with vertices at $(0,0)$, $(2,0)$, and $(0,6)$.

If we imagine sampling over and over from this region uniformly, we can picture $E(X|Y=5)$ as the average $x$ coordinate of the points that end up on the horizontal line $y=5$. All of these points will necessarily have $0 < x < 1/3$, since if $x \geq 1/3$ then $y = 5$ can't happen, and since the points are uniform over this line, this image suggests $E(X|Y=5) \stackrel ?= 1/6$ (this is the midpoint of the range of $x$ points that can end up on this line).

Checking this with calculus, the issue with what you did is the limits of integration for $x$ also depend on $y$. If $y = 5$ is observed then the biggest that $x$ can be is $1/3$, so really $$ E(X|Y=5) = \int_0^{1/3}x \frac{3}{6-y}\,\text dx = 3 \cdot \frac 12 x^2\bigg|_{x=0}^{x=1/3} = \frac 16. $$

Think about this geometrically: we've got $(X,Y)$ uniformly distributed over the right triangle with vertices at $(0,0)$, $(2,0)$, and $(0,6)$.

If we imagine sampling over and over from this region uniformly, we can picture $E(X|Y=5)$ as the average $x$ coordinate of the points that end up on the horizontal line $y=5$. All of these points will necessarily have $0 < x < 1/3$, since if $x \geq 1/3$ then $y = 5$ can't happen, and since the points are uniform over this line, this image suggests $E(X|Y=5) \stackrel ?= 1/6$ (this is the midpoint of the range of $x$ points that can end up on this line).

Checking this with calculus, the issue with what you did is the limits of integration for $x$ also depend on $y$. If $y = 5$ is observed then the biggest that $x$ can be is $1/3$, so really $$ E(X|Y=5) = \int_0^{1/3}x \frac{3}{6-y}\,\text dx = 3 \cdot \frac 12 x^2\bigg|_{x=0}^{x=1/3} = \frac 16. $$


Another quick sanity check is that $E(X|Y)$ has to be within the range of $X$, so $E(X|Y=5)\neq 6$ can be recognized as incorrect before the negative variance shows up.

Source Link
jld
  • 20.8k
  • 2
  • 64
  • 69

Think about this geometrically: we've got $(X,Y)$ uniformly distributed over the right triangle with vertices at $(0,0)$, $(2,0)$, and $(0,6)$.

If we imagine sampling over and over from this region uniformly, we can picture $E(X|Y=5)$ as the average $x$ coordinate of the points that end up on the horizontal line $y=5$. All of these points will necessarily have $0 < x < 1/3$, since if $x \geq 1/3$ then $y = 5$ can't happen, and since the points are uniform over this line, this image suggests $E(X|Y=5) \stackrel ?= 1/6$ (this is the midpoint of the range of $x$ points that can end up on this line).

Checking this with calculus, the issue with what you did is the limits of integration for $x$ also depend on $y$. If $y = 5$ is observed then the biggest that $x$ can be is $1/3$, so really $$ E(X|Y=5) = \int_0^{1/3}x \frac{3}{6-y}\,\text dx = 3 \cdot \frac 12 x^2\bigg|_{x=0}^{x=1/3} = \frac 16. $$