2

A rv $X$ has the cumulative distribution function

$$ F(x) = \begin{cases} 0 \; \; \; \; x<1 \\ \frac{x^2-2x+2}{2} \; \; \; \; 1 \leq x < 2 \\ 1 \; \; \; \; x \geq 2 \end{cases} $$

Calculate the variance of $X$

attempt

First since $F'(x) = f(x)$, then

$$ f(x) = x-1 $$

on $[1,2)$ and $0$ otherwise. Now,

$$ Var(X) = E(X^2) - E(X)^2 = \int\limits_1^2 (x^3 - x^2) dx - \left( \int\limits_1^2 (x^2-x )\right)^2 $$

After solving this easy integral I get $0.73$ whereas my answer key says the answer is $\boxed{0.139}$. What is my mistake here? Am I applying the formulas wrong?

James
  • 3,997
  • [I've deleted the former part of my comment since you fixed it.] I can't find a mistake in your work and suspect the key is wrong. – Aaron Montgomery Apr 22 '18 at 00:27
  • The short answer is that there is an atom of weight $1/2$ at $x = 1$ which needs to be accounted for. – Brian Tung Apr 22 '18 at 01:30
  • Has been asked here and here. For a mixed distribution, you can either compute the Stieltjes integral wrt $dF_X$ or write the pdf in terms of the delta function: $$f_X(x) = (x - 1)[1 < x < 2] + \frac 1 2 \delta(x - 1), \ \int_{-\infty}^\infty x f_X(x) dx = \frac 4 3, \ \int_{-\infty}^\infty \left(x - \frac 4 3 \right)^2 f_X(x) dx = \frac 5 {36}.$$ – Maxim Apr 29 '18 at 16:30

2 Answers2

3

The cdf 'jumps' at $x=1$, so $P(X=1)=0.5$. $$\begin{align} Var(X) &= E(X^2) - E(X)^2 = \int\limits_1^2 (x^3 - x^2) dx + 0.5 - \left( \int\limits_1^2 (x^2-x )dx+0.5\right)^2 \\ & \approx 1.4167+0.5-(0.83333+0.5)^2 \\ & \approx 0,1389 \end{align}$$

LinAlg
  • 19,822
2

It doesn't have a density. Note that $F(1)=\frac12$. If you assume that there is a density and compute according to your formula, you will notice that $E(X) <1$, which imply that something went wrong.

Let $y \in [1,4)$,$$P(X^2 \le y)=P(X \le \sqrt{y})=\frac{y-2\sqrt{y}+2}{2}$$

$$E[X^2]=\int_0^1 \, dx+\int_1^4 \frac{2\sqrt{x}-x}{2}\, dx=\left. \frac23x^\frac32-\frac{x^2}4\right|_1^4+1=1+\frac{14}{3}-\frac{15}4=1+\frac{56-45}{12}=\frac{23}{12}$$

$$E[X]=\int_0^1 \, dx + \int_1^2\frac{2x-x^2}{2}\, dx = \left. \frac{x^2}2-\frac{x^3}{6} \right|_1^2+1=1+\frac32-\frac76=\frac{4}{3}$$

Hence the variance is

$$\frac{23}{12}-\frac{16}{9} \approx 0.139$$

Siong Thye Goh
  • 149,520
  • 20
  • 88
  • 149