# Probability distribution and cumulative distribution function q's

1. Apr 5, 2013

### Evo8

1. The problem statement, all variables and given/known data
$$P_x(x)=A(1- \frac{|x|}{2}) \ \ \ |x|≤2$$
$$P_x(x)=0 \ \ |x|>2$$

Find A

2. Relevant equations

3. The attempt at a solution

This one shouldn't be too bad but I wanted to verify that im on the right track.

I basically have $P_x(x)=A(1- \frac{x}{2})$ when x≤2. 0 otherwise.

So I write the integral $\int_{-\infty}^{2} A(1-\frac{|x|}{2})dx$

I end up with $A (x(\frac{-x^2}{4})dx$ evaluated from 2 to $-\infty$ wich will equate to $\infty$

The section in my text that talks about probability distribution function mentions this
$$\int_{-\infty}^{\infty} p_x(x)dx=1$$

So I could do $A\int_{-\infty}^{\infty} 1-\frac{|x|}{2} dx=1$? Solving this would yield A=$\infty$ which is not what im looking for I dont think. Its something to do with the absolute value of x i think...

The form that the question writes the equation in always screws me up.

Thanks for any help

2. Apr 5, 2013

### SteamKing

Staff Emeritus
Your limits of integration do not match the domain specified for P(x). Look carefully. The ABSOLUTE VALUE of x is less than or equal to 2.

3. Apr 5, 2013

### Evo8

How about something like this $\int_{-2}^{2}A(1-\frac{|x|}{2}=1$

$\frac{1}{A}=\int_{-2}{2}(1-\frac{|x|}{2}=4$

so $A=\frac{1}{4}$?

4. Apr 5, 2013

### SteamKing

Staff Emeritus
That looks much better.

5. Apr 6, 2013

### Evo8

I think i actually made a mistake with the absolute value. A would equal $A=\frac{1}{2}$ not $\frac{1}{4}$

The second part is to find the CDF (cumulative distribution function) for x.

From what I understand the pdf is $p_x(x)$ as the problem states. The CDF is $P_x(x)$, and $P_x(x)= \int p_x(x)$?

Isnt that what Ive already done to find the constant A?

So $P_x(x)=\frac{1}{2}\int_{-2}^2(1-\frac{|x|}{2})dx$

Isnt this what Ive already done?

6. Apr 6, 2013

### Evo8

Ok so I did a little more digging/reading and found a few video examples too. I found this one to quite helpful Cumulative Distribution Functions : Introduction

So to find $P_x(x)$ I did the following

$$P_x(x)=\frac{1}{2}\int_{-2}^{x}(1-\frac{|x|}{2}) \\ =\frac{1}{2}|_{-2}^{x} \ x-\frac{x-|x|}{4} \\ =\frac{1}{2}[x-\frac{x^2}{2}-1]\\ =\frac{-(x^2-4x+4)}{8}$$
So my CDF is

$$\begin{cases}0 \ \ \ \ x<-2\\ \\ \frac{-(x^2-4x+4)}{8} \ \ \ \ -2≤x≤2\\ \\ 1 \ \ \ \ x>2 \end{cases}$$

Does this look somewhat correct? I got a little confused when it came to values of x greater then 2 and the probability being 1. I guess I would have expected the probability to be 0 as the value is o above that upper limit...