# Finding CDF of a Continuous R.V.

1. Jan 30, 2013

### gajohnson

1. The problem statement, all variables and given/known data

Let
f(x) = (1 + cx)/2 for x between -1 and 1 and f(x)=0 otherwise, where c is between -1 and 1. Show that f is a density and find the corresponding cdf. Find the quartiles and the median of the distribution in terms c.

2. Relevant equations

NA

3. The attempt at a solution

I simply showed that this was a density by integrating f(x) from -1 to 1 and showing that this is 1.

For the second part of the problem, I found the CDF to be F(x) = 1/2(x+(cx^2)/2) for -1≤x≤1.
Clearly, F(x) = 0 for -1<x. However, is F(x) = 1 for x>1?

In addition, I am having trouble properly interpreting the directions for finding the quartiles and median. Should my answer be a function of c? If so, how do I go about getting there? Thank you!

Last edited: Jan 30, 2013
2. Jan 30, 2013

### LCKurtz

Your CDF is wrong. For $x<-1, F(x) = \int_{-\infty}^x 0\, dx = 0$. For $x$ bewteen -1 and 1, you should be calculating$$F(x) = \int_{-\infty}^x f(x)\, dx =\int_{-\infty}^{-1} 0\, dx + \int_{-1}^x \frac {1+cx} 2\, dx$$Now do you see what to do for $x>1$?

Last edited: Jan 30, 2013
3. Jan 30, 2013

### gajohnson

Thanks for your response! Why would I be taking the integral of 1/2(x+(cx^2)/2) to find the CDF, and not the integral of (1+cx)/2, which is my density function?

4. Jan 30, 2013

### LCKurtz

You shouldn't, of course. My eyes fell on the wrong function while typing. I will correct it.

5. Jan 31, 2013

### gajohnson

Got it. Thanks!

Do you have any suggestions on the quartiles and medians?

6. Jan 31, 2013

### Ray Vickson

Despite that observation, your cdf is still wrong.
$$F(x) = \frac{1}{2} \int_{-1}^x 1 \, dt + \frac{1}{2} \int_{-1}^x c t \, dt, \: -1 \leq x \leq 1.$$ This will = 0 at x = -1 and = 1 at x = 1, no matter what is the value of c.

To get a 100p percentile, solve the quadratic equation F(x) = p.

7. Jan 31, 2013

### gajohnson

I am not entirely sure where my CDF is wrong or what you mean about c.
Currently my CDF is as follows:

P(X≤x) = 1/2(x+(cx^2)/2) if -1≤x≤1
0 if x < -1
1 if x > 1

1/2(x+(cx^2)/2) was found by taking exactly the integral that you described.

Do you mean instead that it should be:

P(X≤x) = 1/2(x+(cx^2)/2) if -1<x<1
0 if x ≤ -1
1 if x ≥ 1

Thank you!

8. Jan 31, 2013

### Ray Vickson

Do either of the above formulas give $\lim_{x \downarrow -1} P(X \leq x) = 0$ and $\lim_{x \uparrow 1} P(X \leq x) = 1?$ Since X is continuous, these must happen.

9. Jan 31, 2013

### jfgobin

gajohnson: don't confuse integral and antiderivate. For instance, try to compute the value of your CDF

$F\left ( x \right ) = \frac{1}{2}\left ( x + \frac{cx^2}{2} \right )$

for $x=-1$. Is it what you expected?

The parameter $c$ will govern "how fast" your CDF climbs. Here is a graph of it between $-1$ and $1$, for various values of $c$.

#### Attached Files:

• ###### cdf.png
File size:
31.3 KB
Views:
126
10. Jan 31, 2013

### gajohnson

Ahhhh, yes. Not sure what I was thinking there.

So, I ought to get F(x) = (x+1)/2 + c/4(x^2 -1) for -1≤x≤1
=1 for x>1
=0 for x<-1

I believe I see what you were getting it (should not have taken so long). How does that look?

11. Jan 31, 2013

### jfgobin

Looks better to me :-)

12. Jan 31, 2013

### gajohnson

Great, thanks for the help, everyone!

Last edited: Jan 31, 2013