Finding cdf using pdf

47 Views Asked by At

if I have a pdf $$f_X(x) = \begin{cases} c(1-|x|), & \text{for -1 < x < 1} \\ 0, & \text{otherwise} \end{cases}$$

I have figured out c to be 1 from some calculation

It turns out that $$F_X(x) = \begin{cases} 0, & \text{if x < -1,} \\ \frac{(x+1)^2}{2}, & \text{if -1}\ \leq \text{x < 0,} \\ \frac{1}{2}+x(1-x/2), & \text{if 0}\ \leq \text{x < 1,} \\ 1, & \text{if x} \ \geq 1. \end{cases}$$

couple of questions I have in terms of this is that

  1. why is the $c(1-|x|)$ equation not integerated between -1 and 1, but instead done between -1 to 0, and 0 to 1.

  2. is the value 1 when $x \geq 1$ because $F_X(\infty) = 1$?

  3. to get $\frac{x+1^2}{2}$, why does the integral look like $\int_{-1}^x(1+v)dv$, but the one below looks like $\frac{1}{2}+\int_{0}^{x}(1-v)dv$? where does the half come from and why is is 1 + v for the first but 1 - v for the below?

2

There are 2 best solutions below

2
On BEST ANSWER
  1. why is the $c(1-|x|)$ equation not integerated between -1 and 1, but instead done between -1 to 0, and 0 to 1.

Due to the absolute valuation, we partition the domain over negative and positive values of the integration variable.

$$1-\lvert v\rvert = \begin{cases}1+v &:& \qquad v<0\\1-v&:& 0\leq v\end{cases}$$

  1. is the value 1 when $x \geq 1$ because $F_X(\infty) = 1$?

Yes. That is the nature of cumulative distribution functions whose support has a finite supremum.

  1. to get $\frac{x+1^2}{2}$, why does the integral look like $\int_{-1}^x(1+v)dv$, but the one below looks like $\frac{1}{2}+\int_{0}^{x}(1-v)dv$? where does the half come from and why is is 1 + v for the first but 1 - v for the below?

$$\begin{align}F_X(x) & = \mathsf P(X\leqslant x)\\&=\int_{-\infty}^x (1-\lvert v\rvert)\,\mathbf 1_{-1\leq v\leq 1}\,\mathrm d v\\&= \begin{cases} 0 &:& \text{if }x < -1 \\ \int_{-1}^x (1+v)\,\mathrm d v &: & \text{if } -1 \leq x < 0 \\ \int_{-1}^0(1+v)\,\mathrm d v+\int_0^x (1-v)\,\mathrm d v&: & \text{if }0 \leq x < 1 \\ \int_{-1}^0(1+v)\,\mathrm d v+\int_0^1 (1-v)\,\mathrm d v &: & \text{if }1\leq x \end{cases}\\&= \begin{cases} 0 &:& \text{if }x < -1 \\ (1+x)^2/2 &: & \text{if } -1 \leq x < 0 \\ 1/2+x-x^2/2&: & \text{if }0 \leq x < 1 \\ 1/2+1/2 &: & \text{if }1\leq x \end{cases}\end{align}$$

0
On

We are more than welcome to be concise by using

$$\int |x| \:dx = \frac{1}{2}x|x| + C$$

$$\implies \int_{-1}^x1-|t|\:dt = \left[t - \frac{1}{2}t|t|\right]_{-1}^x = x\left(1-\frac{|x|}{2}\right)+\frac{1}{2}$$

which gives us the following CDF

$$F_X(x) = \begin{cases}0 & x < -1 \\ x\left(1-\frac{|x|}{2}\right)+\frac{1}{2} & x\in[-1,1] \\ 1 & x > 1\end{cases}$$

This should answer your first and third question - we don't have to integrate over the nonzero parts of the PDF's domain separately, we can do it all at once. To answer your second question, the PDF is $0$ outside of the interval $[-1,1]$, which means the CDF must take on a constant value on $(-\infty,-1)$ and $(1,\infty)$.