# Thread: [SOLVED] Distribution Function Confusion

1. ## [SOLVED] Distribution Function Confusion

Hello all,

I can't get my stupid head around CDF (Cumulative distribution function). How do you form a single expression (if that's the right word) for F(x) if you have it like this (for example):

$\displaystyle F(x) = 0 \ for \ x < 0$
$\displaystyle F(x) = 1/6 \ for \ 0 < x < 1$
$\displaystyle F(x) = 5/6 \ for \ 1 < x < 2$
$\displaystyle F(x) = 1 \ for \ x > 2$

So what I want to be able to do is write the above as something I can integrate/differentiate or whatever, presuming it's possible. The book I'm using just says "so we write the above as F(x) = blah blah blah" without a single explanation of how to do it. So what I'd like to know is... how do you do it?

(P.s. I'm not too concerned with the answer to the above question, I'm just studying...so whatever examples you want to use are fine).

Thanks.

2. Hello,
Originally Posted by StupidIdiot
Hello all,

I can't get my stupid head around CDF (Cumulative distribution function). How do you form a single expression (if that's the right word) for F(x) if you have it like this (for example):

$\displaystyle F(x) = 0 \ for \ x < 0$
$\displaystyle F(x) = 1/6 \ for \ 0 < x < 1$
$\displaystyle F(x) = 5/6 \ for \ 1 < x < 2$
$\displaystyle F(x) = 1 \ for \ x > 2$

So what I want to be able to do is write the above as something I can integrate/differentiate or whatever, presuming it's possible. The book I'm using just says "so we write the above as F(x) = blah blah blah" without a single explanation of how to do it. So what I'd like to know is... how do you do it?

(P.s. I'm not too concerned with the answer to the above question, I'm just studying...so whatever examples you want to use are fine).

Thanks.
You can't differentiate that, since it's not continuous.
This cdf is characteristic of the cdf of a discrete rv.
I assume it's rather :

$\displaystyle F(x)=\begin{cases} 0 & x<0 \\ \frac 16 & 0 {\color{red}\leq} x<1 \\ \frac 56 & 1 {\color{red}\leq} x<2 \\ 1 & x {\color{red}\geq} 2 \end{cases}$

This means that :
$\displaystyle \mathbb{P}(X=0)=\frac 16$
$\displaystyle \mathbb{P}(X=1)=\frac 56-\frac 16=\frac 23$
$\displaystyle \mathbb{P}(X=2)=1-\frac 56=\frac 16$

And that's all..

Cumulative distribution function - Wikipedia, the free encyclopedia

Originally Posted by Moo
I assume it's rather :

$\displaystyle F(x)=\begin{cases} 0 & x<0 \\ \frac 16 & 0 {\color{red}\leq} x<1 \\ \frac 56 & 1 {\color{red}\leq} x<2 \\ 1 & x {\color{red}\geq} 2 \end{cases}$
Sorry, that was a bad example to give. I just made it up myself just to ask the question. You're right about the inequalities.

Originally Posted by Moo
You can't differentiate that, since it's not continuous.
This cdf is characteristic of the cdf of a discrete rv.
So...if it was continuous, could you do it?

Given X is a continuous random variable whose distribution function F satisfies:

$\displaystyle F(x) = 0 \ for \ x < 0$
$\displaystyle F(x) = 1 \ for \ x > 0$
$\displaystyle F(x) = x(2-x) \ for \ 0\leq x \leq 1$

Find E[x].

I think you need the density function for this question. So how do you convert the distribution function to the density function in this example?

(There's no need to find E[x], I just need the f(x) and I can do it myself I hope...I don't want to waste anyone's time anymore than is necessary. The answer is 1/3 apparently).

Thanks for the help.

4. Originally Posted by StupidIdiot
So...if it was continuous, could you do it?
Yep

Given X is a continuous random variable whose distribution function F satisfies:

$\displaystyle F(x) = 0 \ for \ x < 0$
$\displaystyle F(x) = 1 \ for \ x > {\color{red}1}$
$\displaystyle F(x) = x(2-x) \ for \ 0\leq x \leq 1$

Find E[x].
Should be 1, not 0 (in red)

I think you need the density function for this question. So how do you convert the distribution function to the density function in this example?
Yes, you need the pdf (probability density function).
Which can be found as the derivative of the cumulative distribution function (what you call "distribution function")

So for $\displaystyle x<0$, the derivative is 0.
For $\displaystyle x>1$, the derivative of 1 is 0.
For $\displaystyle 0\leq x\leq 1$, the derivative is... ?

Note that the pdf doesn't need to be continuous. =)

(There's no need to find E[x], I just need the f(x) and I can do it myself I hope...I don't want to waste anyone's time anymore than is necessary. The answer is 1/3 apparently).

Thanks for the help.
It's not that it would waste our time, it's just that if you can show what you've done/tried, and that you want us to check, it's always better. And it's very welcome

5. Originally Posted by Moo
Should be 1, not 0 (in red)
You're right again. I typed in the question wrong.

Originally Posted by Moo
Yes, you need the pdf (probability density function).
Which can be found as the derivative of the cumulative distribution function (what you call "distribution function")

So for $\displaystyle x<0$, the derivative is 0.
For $\displaystyle x>1$, the derivative of 1 is 0.
For $\displaystyle 0\leq x\leq 1$, the derivative is... ?

Note that the pdf doesn't need to be continuous. =)
Ok, so really the first two parts are "unimportant" when it comes to the differentiation. I presume then:

$\displaystyle PDF = \frac{d}{dx}F(x)$

$\displaystyle f(x)= \frac{d}{dx}x(2-x)$

$\displaystyle f(x)= \frac{d}{dx}2x - x^2$

$\displaystyle f(x)= 2-2x$

$\displaystyle E[x] = \int_0^1 xf(x)dx$
$\displaystyle E[x] = \int_0^1 2x-2x^2dx$
$\displaystyle E[x] = (x^2-\frac{2}{3}x^3)_0^1$
$\displaystyle E[x] = \frac{1}{3}$

Originally Posted by Moo
It's not that it would waste our time, it's just that if you can show what you've done/tried, and that you want us to check, it's always better. And it's very welcome
Thanks for the help Moo! I think I understand now. It's kind of more simple than I thought it might be.

6. Thanks for the help Moo! I think I understand now. It's kind of more simple than I thought it might be.
Yep, you went through it ^^

The "first two parts" are not "unimportant".
It's just that the derivative in these intervals is 0.

The pdf can be written with an indicator function (which is equivalent to restrict it to a certain domain)

Here :
$\displaystyle f(x)=2(2-x) \bold{1}_{[0,1]}(x)$, where :
$\displaystyle \bold{1}_{[0,1]}(x)=\begin{cases} 1 \text{ if } x \in [0,1] \\ 0 \text{ otherwise} \end{cases}$

Or just say that
$\displaystyle f(x)=\begin{cases} 2(2-x) \text{ if } x \in [0,1] \\ 0 \text{ otherwise}\end{cases}$

7. Originally Posted by Moo
The "first two parts" are not "unimportant".
It's just that the derivative in these intervals is 0.
I knew that you wouldn't like me saying unimportant! Well, I just meant in this particular case for this particular problem that those first parts don't directly come into the differentiation.

Originally Posted by Moo
The pdf can be written with an indicator function (which is equivalent to restrict it to a certain domain)

Here :
$\displaystyle f(x)=2(2-x) \bold{1}_{[0,1]}(x)$, where :
$\displaystyle \bold{1}_{[0,1]}(x)=\begin{cases} 1 \text{ if } x \in [0,1] \\ 0 \text{ otherwise} \end{cases}$

Or just say that
$\displaystyle f(x)=\begin{cases} 2(2-x) \text{ if } x \in [0,1] \\ 0 \text{ otherwise}\end{cases}$
Ok good to know. I've never seen lunacy like this before:

$\displaystyle f(x)=2(2-x) \bold{1}_{[0,1]}(x)$, where :
$\displaystyle \bold{1}_{[0,1]}(x)=\begin{cases} 1 \text{ if } x \in [0,1] \\ 0 \text{ otherwise} \end{cases}$

...but it makes sense. And I understand the:

$\displaystyle f(x)=\begin{cases} 2(2-x) \text{ if } x \in [0,1] \\ 0 \text{ otherwise}\end{cases}$

I might just use it some time. Right, once again thanks! I'll slap a "solved" on this thread (if that's possible).