# Help Please -- cumulative distribution function, probability density

## Homework Statement

For the next probability function: f(x)=x/4 for 0<x<2

## Homework Equations

a) Get the probability function
b) Get the cumulative distribution function

## The Attempt at a Solution

I don´t know if the problem is well written, and for that I'm lost with the first question.
f(0)=? f(1)=? f(2)=

RUber
Homework Helper
The probability function is what you gave in part 1, isn't it? Or do you need to scale it so that the function sums to one to be a probability density function?
The CDF is just the integral of the PDF.

The probability function is what you gave in part 1, isn't it? Or do you need to scale it so that the function sums to one to be a probability density function?
The CDF is just the integral of the PDF.

I suppose that the probability function is given in the exercise, and for the CDF, do I only need to solve the integral? Then, which is the next step?

haruspex
Homework Helper
Gold Member
I suppose that the probability function is given in the exercise, and for the CDF, do I only need to solve the integral? Then, which is the next step?
Except that f as given is not a valid probability density function. Do you see why?

Except that f as given is not a valid probability density function. Do you see why?
I don´t know how to explain the reason, but the function is like it were incomplete, so the first step is to find the correct function, right? How can I do that? Or what are the steps?

haruspex
Homework Helper
Gold Member
I don´t know how to explain the reason, but the function is like it were incomplete, so the first step is to find the correct function, right? How can I do that? Or what are the steps?
The reason is that the total probability should be 1.

The reason is that the total probability should be 1.
Yes, the probability is less than one, so how can I do to make the probabability be 1?

haruspex
Homework Helper
Gold Member
Yes, the probability is less than one, so how can I do to make the probabability be 1?
Think of f as specifying the relative probabilities.

RUber
Homework Helper
I am pretty sure you need to assume that p(x not in [0,2]) = 0.
So, to solve this problem, you need to focus on the goal of total probability being 1.
What is ##\int_0^2 x/4 dx ##? Is there a C such that ##\int_0^2 Cx/4 dx = 1 ##? If there is, then your PDF is ##f(x) = Cx/4## and your CDF is ##F(x) = \int_0^x Cy/4 dy##.

I am pretty sure you need to assume that p(x not in [0,2]) = 0.
So, to solve this problem, you need to focus on the goal of total probability being 1.
What is ##\int_0^2 x/4 dx ##? Is there a C such that ##\int_0^2 Cx/4 dx = 1 ##? If there is, then your PDF is ##f(x) = Cx/4## and your CDF is ##F(x) = \int_0^x Cy/4 dy##.
Ok please, can you explain me in more detail? I'm a little confused about the topic and for your information I'm 17 y/o, so please take this into consideration.

Ray Vickson
Homework Helper
Dearly Missed
Ok please, can you explain me in more detail? I'm a little confused about the topic and for your information I'm 17 y/o, so please take this into consideration.

We cannot help you without having more information about your background. Do you know basic calculus? Do you know what integration is, and how to do some elementary examples of it? Are you working with a textbook (even if you are not officially registered in a course)?

We cannot help you without having more information about your background. Do you know basic calculus? Do you know what integration is, and how to do some elementary examples of it? Are you working with a textbook (even if you are not officially registered in a course)?
My background is that I know a little about integral calculus, I can do some indefinite integrals, I am working with the notes of my older brother and I only have the exercise but not the answer or procedure. About probability, these are my first steps on the subject and I´m doing this because I want to learn what my brother learned.

haruspex
Homework Helper
Gold Member
My background is that I know a little about integral calculus, I can do some indefinite integrals, I am working with the notes of my older brother and I only have the exercise but not the answer or procedure. About probability, these are my first steps on the subject and I´m doing this because I want to learn what my brother learned.
As I posted, you can treat the function as defining relative probabilities. I.e. the relative likelihoods at two points correspond to the ratio of the values of the function at those points. Given that, what can you think of to do to the function to make its total integral equal 1?

RUber
Homework Helper
First things first, do you know how to integrate x/4? To get the integral from 0 to 2 you evaluate the indefinite integral at 2 and subtract from that the evaluation at 0.

RUber
Homework Helper
Another useful tidbit when dealing with integrals is that multiplication by a constant can pass through the integral.
i.e. ## \int_0^2 x/4 dx = \frac 14 \int_0^2 x dx ## this should help you with the scaling problem to make it equal 1.

Another useful tidbit when dealing with integrals is that multiplication by a constant can pass through the integral.
i.e. ## \int_0^2 x/4 dx = \frac 14 \int_0^2 x dx ## this should help you with the scaling problem to make it equal 1.
I think that the result of integrate x/4 is equal to x^2/8 +c, right?
And then , the result of evaluate is equal to 1/2-0=1/2

RUber
Homework Helper
That's correct. So what should you multiply the function by in order for the integral to be 1?

That's correct. So what should you multiply the function by in order for the integral to be 1?
I should multiply by 2, and if then I evaluate I get 2(2^2)/8-0=1-0=1, right?

Ray Vickson
Homework Helper
Dearly Missed
I should multiply by 2, and if then I evaluate I get 2(2^2)/8-0=1-0=1, right?

Right. So, what is the formula you get for the probability density function ##p(x)## (the one that integrates to 1)? From that, what would be the formula for the cumulative distribution function ##F(x) = \int_0^x p(t) \, dt##?

Right. So, what is the formula you get for the probability density function ##p(x)## (the one that integrates to 1)? From that, what would be the formula for the cumulative distribution function ##F(x) = \int_0^x p(t) \, dt##?
The formula for probability function is ##f(x) = Cx/4## ##f(x)=2x/4##
F(x) would be ##x^2/4## and for evaluate do I need to substitute x vith the values (0,1 and 2)?
Am I correct?

haruspex
Homework Helper
Gold Member
F(x) would be ##x^2/4## and for evaluate do I need to substitute x vith the values (0,1 and 2)?
Am I correct?
Evaluate? The question as initially posted only asked that you find F, which you have done.

Evaluate? The question as initially posted only asked that you find F, which you have done.
Ok, so now I have the answer for the two questions. And for example, if I want to make a chart with the probability of the values of x, in that case, do I need to evaluate, or what I have to do?

haruspex
Homework Helper
Gold Member
Ok, so now I have the answer for the two questions. And for example, if I want to make a chart with the probability of the values of x, in that case, do I need to evaluate, or what I have to do?
It depends what you mean by 'probability values'. This is a continuous distribution, so P[X=x] = 0. You can chart probability density values, or CDF values (P[X<x]).

It depends what you mean by 'probability values'. This is a continuous distribution, so P[X=x] = 0. You can chart probability density values, or CDF values (P[X<x]).
I'd be interested in doing a chart of CDF values. How can I get the values?

haruspex
Homework Helper
Gold Member
I'd be interested in doing a chart of CDF values. How can I get the values?
Just plug the x values into your F(x) formula.

Ray Vickson
Homework Helper
Dearly Missed
The formula for probability function is ##f(x) = Cx/4## ##f(x)=2x/4##
F(x) would be ##x^2/4## and for evaluate do I need to substitute x vith the values (0,1 and 2)?
Am I correct?

Your formula for ##f(x)## can be simplified from##f(x) = 2x/4## to ##f(x) = x/2##.

Strictly speaking, we really ought to write it as ##f(x) = I_{(0,2)}(x) \cdot x/2##, where the "indicator" function ##I_{(a,b)}## is 1 for ##x## in the interval ##(a,b)## and is 0 otherwise. In other words,
$$f(x) = I_{(0,2)}(x)\cdot x/2 = \begin{cases} 0& x \leq 2 \\x/2 & 0 < x < 2 \\ 0 & x \geq 2 \end{cases}$$
Also, if we are being picky we ought to write the cdf in a similar way:
$$F(x) = \begin{cases} 0 & x \leq 0 \\ x^2/4 & 0 < x < 2 \\ 1 & x \geq 2 \end{cases}$$
However, as long as you remember to use your formulas only for ##0 < x < 2## you can just use the simpler form.

Another question, this method only applies in cases similar to this one, cases in which the probability is less than one? In a case when I already have the probability equal to one, do I only need to evaluate the function in the intervale (a,b) or I have to do another procedure?

RUber
Homework Helper
As a rule, total probability of all possible outcomes is always 1. So, in order to determine odds, you will always need it scaled. Other than that, note what Ray said in #26.

Thank you so much, I really appreciate your help and that you shared your knowledge with me!