2

$X \sim F(x)$

$$F(x)=\begin{cases}0,&x<0\\x^2,&0\leq x<1/2\\x,&1/2\leq x<1\\1,&x>1\end{cases}$$

(not right-continuous)

I want to compute $\operatorname{Var}(X)$.

Is this correct:

$$\mathbb E[X]=\int_0^{1/2}2x^2\,dx+\int_{1/2}^1x\,dx+1/2\cdot \mathbb P(1/2)$$

How can I evaluate $\mathbb P(X=1/2)$? Is it $1/2 -(1/2)^2$? And how do I evaluate $\mathbb E[X^2]$?

$$Y:=X^2$$

$$F_Y(x)=\mathbb P[Y \leq x]=\mathbb P[X^2 \leq x]=\mathbb P[X \leq \sqrt x]=F(\sqrt x)=\begin{cases}0,&x<0\\x,&0\leq x<1/4\\\sqrt x,&1/4\leq x<1\\1,&x>1\end{cases}$$

$$\mathbb E[X^2]=\int_0^{1/2}2x^3\,dx+\int_{1/2}^1x^2\,dx+1/4\cdot \mathbb P(1/4)$$

$$\mathbb P(X=1/4)=\sqrt{1/4} -1/4?$$

2 Answers2

2

the variance should be $$\operatorname{Var}(X)=\mathbb E[(X-\mathbb E[X])^2] = \mathbb E[X^2]-\mathbb E[X]^2$$ $$\mathbb E[g(x)]=\int g(x) f(x) \, dx$$ where $f(x)$ is the probability distribution function (pdf) $$f(x)=\frac{dF(x)}{dx}=\frac{1}{4}\delta(x-\frac{1}{2})+\begin{cases}0,&x<0\\2x,&0\leq x<1/2\\1,&1/2\leq x<1\\0,&x>1\end{cases}$$ where $\delta (x)$ is the Dirac delta function $$\mathbb E[X]=\int_0^{1/2}2x^2 dx+\int_{1/2}^1x \, dx+\frac{1}{4}\int \delta(x-\frac{1}{2})x \, dx$$ $$=\frac{2}{3}\left(\frac{1}{2}\right)^3+\frac{1}{2}\left(1-\frac{1}{4}\right)+\frac{1}{4}\left(\frac{1}{2}\right)=\frac{7}{12}$$

$$\mathbb E[X^2]=\int_0^{1/2}2x^3\ dx+\int_{1/2}^1x^2\ dx+ \frac{1}{4}\int \delta(x-\frac{1}{2})x^2dx$$ $$=\frac{2}{4}\left(\frac{1}{2}\right)^4+\frac{1}{3}\left(1-\frac{1}{8}\right)+\frac{1}{4}\left(\frac{1}{4}\right)=\frac{296}{768}$$ $$\mathbb E[X^2]-\mathbb E[X]^2 = 296/768-49/144 = 13/288$$

phdmba7of12
  • 1,030
0

Your expression for $\ \mathbb{E}\left[X\right]\ $ is correct if $\ \mathbb{P}\left(\frac{1}{2}\right)\ $ is taken to mean the same thing as $\ \mathbb{P}\left(X=\frac{1}{2}\right)\ $. And yes, the value of $\ \mathbb{P}\left(X=\frac{1}{2}\right)\ $ is the size of the jump in $\ F\ $ at $\ x=\frac{1}{2}\ $: $$ \mathbb{P}\left(X=\frac{1}{2}\right)=F \left(\frac{1}{2}\right)-\lim_{x\rightarrow\left(\frac{1}{2}\right)^-}F(x)= \frac{1}{2}-\frac{1}{4}\ . $$ There's a problem, however with your formula for $\ \mathbb{E}\left[X^{\color{red}2}\right]\ $ (even apart from the typo flagged by the red superscript in the preceding expression, which is missing from the expression on the left side of your equation). You appear to have used something like the identity \begin{align} \mathbb{E}\left[X^2\right]&=\int_{-\infty}^\infty x^2dF(x)\\ &=\int_0^\frac{1}{2}x^2F'(x)dx +\left(\frac{1}{2}\right)^2\mathbb{P}\left(X=\frac{1}{2}\right)\\ &\hspace{1.5em}+ \int_ \frac{1}{2}^0x^2F'(x)dx\\ &= \int_0^\frac{1}{2}2x^3dx+ \left(\frac{1}{2}\right)^2\mathbb{P}\left(X=\frac{1}{2}\right)+\int_\frac{1}{2}^1x^2dx\ , \end{align} which would have been correct, but in place of $\ \mathbb{P}\left(X=\frac{1}{2}\right)\ $ you have $\ \mathbb{P}\left(\frac{1}{4}\right)\ $. Was this another typo?

Also, your derivation of the distribution of $\ Y=X^2\ $ is a little puzzling. While the derivation is correct, and this distribution could have been used to compute $\ \mathbb{E}\left[Y\right]=\mathbb{E}\left[X^2\right]\ $, you haven't actually made any use of it.

lonza leggiera
  • 28,646
  • 2
  • 12
  • 33
  • Yes, those were typos. Did you mess up the upper limit of the 2nd integral at the evaluation of $\mathbb E[X^2]$? It should be $\int_{\frac{1}{2}}^1$ instead of $\int_{\frac{1}{2}}^0$?

    And I thought that I need the distribution of $Y$ to find out that the discontinuity is at $1/4$

    – user756349 Mar 03 '20 at 20:22
  • Yes, the $\ 0\ $ at the upper limit of that integral was a typo. When evaluating $\ \mathbb{E}\left(X^2\right)\ $ by integrating $\ x^2\ $ with respect to the distribution $\ F\ $ of $\ X\ $, it's the discontinuity of $\ F\ $ you need to use, not that of $\ F_Y\ $. You already know that the former occurs at $\ x=\frac{1}{2}\ $, and the term this gives you in the integration is the square of $\ x\ $ at that point (namely $\ \frac{1}{4}\ $) times the size of the jump in $\ F\ $ there (also equal to $\ \frac{1}{4}\ $). – lonza leggiera Mar 04 '20 at 01:11
  • You would only need to use the discontinuity in $\ F_Y\ $ at $\ y=\frac{1}{4}\ $ if you were to evaluate $\ \mathbb{E}\left(X^2\right)= \mathbb{E}(Y)\ $ by integrating $\ y\ $ with respect to the distribution $\ F_Y\ $ of $\ Y\ $. – lonza leggiera Mar 04 '20 at 01:11