The Student Room Group

Probability Density Function

Hi, I am stuck on a question. I am given a graph and am asked to determine the probability density function f(x). I have attached a picture of the graph.

The problem is that I do not know how to work out the f(x). Please can someone tell me how to find the f(x). Thanks
Original post by zkm1223
Hi, I am stuck on a question. I am given a graph and am asked to determine the probability density function f(x). I have attached a picture of the graph.

The problem is that I do not know how to work out the f(x). Please can someone tell me how to find the f(x). Thanks


Knowing that the total area under the pdf function is "1", can you do it now?
Reply 2
So is it f(x) = 1?
Original post by zkm1223
So is it f(x) = 1?


No. The function plotted on the graph is the pdf, i.e. f(x), and you need to find its equation.
It is in two parts; there will be one equation from 0 to 2, and another from 2 to 6. They are both straight lines.

It is the area underneath the graph that is equal to "1".
Reply 4
so is it f(x) = 2 and f(x) = 6?
Original post by zkm1223
so is it f(x) = 2 and f(x) = 6?


Your answer should be something like:

f(x) = 1.5 for 0 <= x <= 2, and

f(x) = 4.5 - 2x for 2 <= x <= 6, and

zero otherwise.


The actual numbers I've given are NOT the correct values, but just given to illustrate the sort of answer you are looking for.
Reply 6
I think I understand it better now. I think the first equation is f(x) = y for 0 <= x <= 2 but I don't know how to get the second equation.
Reply 7
split the curve into a rectangle and a triangle. calculate the area of both of these objects and add them (note you dont know the height, so call this a variable x,y,z or whatever is your favourite letter). the sum of the two areas equals 1 (this is true for all pdfs). solve to find your variable and so your y axis value.

now you know what the y axis value is, you can create 2 equations (1 for 0<x<2 and another for 2<x<6). note that these are straight lines so will be in the from y=mx+c for the triangle bit and just y=something for the rectangle bit.
Reply 8
If we call the height c, is the equation for the rectangle part:

f(x) = c for 0 <= x <= 2?

but i don't understand how to work out the second equation.
Original post by zkm1223
If we call the height c, is the equation for the rectangle part:

f(x) = c for 0 <= x <= 2?

but i don't understand how to work out the second equation.



If the height is "c", then what's the area of the rectangle part in terms of c.

What's the area of the triangle part?

The sum of the two is equal to "1", so you can set up an equation and solve for c, to get the first part of your answer.

For the second part of your answer, you know two points on that descending line (2,c) and (6,0).
Reply 10
Area of rectangle = 2c

Area of triangle =0.5 x 4 x c = 2c

Therefore:

2c + 2c = 1
c= 0.25

Is this right?
Original post by zkm1223
Area of rectangle = 2c

Area of triangle =0.5 x 4 x c = 2c

Therefore:

2c + 2c = 1
c= 0.25

Is this right?


Yes, that that gives you the value for the first part.

So now for the second part you know that your sloping line passes through (2,0.25) and (6,0).

So whatever method you've learnt for determining the equation of a line....
Reply 12
y - y1 = m (x - x1)

y - 0 = -1/16 (x - 6)

y = -1/16 (x - 6)

Is this right?
Original post by zkm1223
y - y1 = m (x - x1)

y - 0 = -1/16 (x - 6)

y = -1/16 (x - 6)

Is this right?


Yes. You can substitute the two values of x, 2 and 6, into the equation to see if they give the right values for y, as a check.
Reply 14
Ok, thanks for all the help. Also please can you tell me how to write out the final answer.
Original post by zkm1223
Ok, thanks for all the help. Also please can you tell me how to write out the final answer.


Have a look at post #6
Reply 16
OK, thanks. Last question. I am asked to calculate the inter-quartile range. How would I do this?
Original post by zkm1223
OK, thanks. Last question. I am asked to calculate the inter-quartile range. How would I do this?


You need to find the value of x, such that the integral from 0 to x is 0.25 (i.e. the area under the graph from 0 to x), and similarly for 0.75, and then subtract the two values to get the interquartile range.
Reply 18
I have integrated f(x) with limits x and 0 and made it equal 0.25. After integrating it all I was left with a quadratic equation which I got the answers x=2 and x=4.

I have done the same thing but made it equal 0.75, however I can't solve the quadratic to get any values of x. Am I doing the right thing?
Original post by zkm1223
I have integrated f(x) with limits x and 0 and made it equal 0.25. After integrating it all I was left with a quadratic equation which I got the answers x=2 and x=4.

I have done the same thing but made it equal 0.75, however I can't solve the quadratic to get any values of x. Am I doing the right thing?


Depends what you integrated.

The area under the graph for the interval [0,2] is 1/4 x 2 = 0.5.
So your first quartile will lie under the constant part, and it's not 2 (nor do you need to solve a quadratic).
Your third quartile will lie under the descending graph, and it's not going to be 4 (but it will be a quadratic, although a very simple one).

Looking at it geometrically might be easier for you, but I'm not going to comment further on that; depends how fluent/comfortable you are with it.

Regarding the third quartile, you may find it easier to ingrate from x to 6 and set that equal to 0.25; i.e. look at the values greater than the third quartile. Looking at the values below the thrid quartile you will need to sum two parts; and as this it taking a lot more explanation than I feel comfortable doing, I'm not going to comment further on that.

Post working if you're still stuck.

Quick Reply

Latest