# Sum of Probability Density Function > 1?

• I
I have a Stats exam on Wednesday and while I thought I was quite well-versed, I've gone back over to the very basics only to find myself confused at what should be introductory.

Suppose I have a continuous random variable modelled by a probability density function: $$f(x)=2x$$ Obviously the domain (x) needs to be restricted between parameters ##a## and ##b## such that ##\int_a^b f(x) \, dx = 1##

Setting ##a=0##, working out ##b## should prove straightforward: $$\int_0^b 2x \, dx = 1$$ $$\big[x^2\big] _0^b = 1$$ $$b^2 - 0 = 1$$ $$b=1$$ So, the function is now: $$f(x) =\left\{ \begin{array}{l} 2x , & 0 \leq x \leq 1\\ 0 , & \textrm{otherwise} \end{array} \right.$$

Except that the area under this function obviously exceeds 1. Even taking ##f(x)## at the boundary, ##f(1)## returns a value of 2. What am I doing wrong? Why is something so simple not adding up?

Thanks

fresh_42
Mentor
2021 Award
I have a Stats exam on Wednesday and while I thought I was quite well-versed, I've gone back over to the very basics only to find myself confused at what should be introductory.

Suppose I have a continuous random variable modelled by a probability density function: $$f(x)=2x$$ Obviously the domain (x) needs to be restricted between parameters ##a## and ##b## such that ##\int_a^b f(x) \, dx = 1##

Setting ##a=0##, working out ##b## should prove straightforward: $$\int_0^b 2x \, dx = 1$$ $$\big[x^2\big] _0^b = 1$$ $$b^2 - 0 = 1$$ $$b=1$$ So, the function is now: $$f(x) =\left\{ \begin{array}{l} 2x , & 0 \leq x \leq 1\\ 0 , & \textrm{otherwise} \end{array} \right.$$

Except that the area under this function obviously exceeds 1. Even taking ##f(x)## at the boundary, ##f(1)## returns a value of 2. What am I doing wrong? Why is something so simple not adding up?

Thanks
The function defines the triangle ##(0,0);(1,0);(1,2)## where it is not zero. And the volume of it is ##\frac{1}{2} \cdot 2 \cdot 1 = 1##. Beside it is a funny distribution everything looks ok.

Edit: For ##f(x) ≤ 1## you have to renorm it, e.g. ##f(x) = \frac{1}{2} x## with ##0≤x≤2##.

The function defines the triangle ##(0,0);(1,0);(1,2)## where it is not zero. And the volume of it is ##\frac{1}{2} \cdot 2 \cdot 1 = 1##. Beside it is a funny distribution everything looks ok.
But surely the probability that X takes a value of 1, ##f(1)## cannot equal 2? And yet I got the value of x=1 by integrating to ensure that the sum of probabilities never exceeds 1. That's where my confusion comes from.

fresh_42
Mentor
2021 Award
But surely the probability that X takes a value of 1, ##f(1)## cannot equal 2? And yet I got the value of x=1 by integrating to ensure that the sum of probabilities never exceeds 1. That's where my confusion comes from.
Sorry, edited a moment too late.

Sorry, edited a moment too late.
I saw your edit, now the confusion arises when taking ##f(2)##, which equals 1. I suspect my understanding of the significance of the values continuous distributions functions return is what's at stake here.

EDIT: Of course, the fallacy is that with a continuous variable, ##P(X=x)## in exact terms, e.g. ##P(X=2.0000...)## as opposed to ##P(1.95 \leq X \leq 2.05)##, always equals 0. Correct? Can't believe that flew by me when making the thread.

Last edited:
fresh_42
Mentor
2021 Award
I saw your edit, now the confusion arises when taking ##f(x)=2##. I suspect my understanding of the significance of the values continuous distributions functions return is what's at stake here.
How do you get ##f(x) = 2## with the renormed function? Your original function values cannot be interpreted as probabilities, maybe as an outcome of an experiment. Therefore you have to modify it.

• NatFex
How do you get ##f(x) = 2## with the renormed function? Your original function values cannot be interpreted as probabilities, maybe as an outcome of an experiment. Therefore you have to modify it.
Likewise, fixed my post a moment too late. Perfect, you confirmed what I thought was going on.

• fresh_42
fresh_42
Mentor
2021 Award
Likewise, fixed my post a moment too late. Perfect, you confirmed what I thought was going on.
Try not to get nervous, possibly by yourself. To look back at things you already learned shortly before a test can sometimes do more damage than good. I remember an examination on a field I wasn't really firm in. I read a book and learned as much as I could a few weeks ahead. On the day of the examination my professor was late of about 2 or 3 hours due to an unexpected funeral he had to attend. So I took the time and went through my condensed notes of the topic. The result was that in the end I only had these in my head and the stuff around them was not as present to me as it should have been.

Last edited:
nrqed
Homework Helper
Gold Member
I saw your edit, now the confusion arises when taking ##f(2)##, which equals 1. I suspect my understanding of the significance of the values continuous distributions functions return is what's at stake here.

EDIT: Of course, the fallacy is that with a continuous variable, ##P(X=x)## in exact terms, e.g. ##P(X=2.0000...)## as opposed to ##P(1.95 \leq X \leq 2.05)##, always equals 0. Correct? Can't believe that flew by me when making the thread.
Just to add a comment: the key point is that your f(x) is not a probability! It is a probability density. So it is simply meaningless to talk about f(x). The only meaningful quantity is the integral of f(x) between two values, and this si never larger than 1 even though f(x) itself may be larger than 1 for some x.

• Fooality
FactChecker
Gold Member
The integral of your function is exactly 1. That is the difference between the "sum" that you state in the title and an integral. An integrand, f(x), can be huge over a small range of x and still have an integral of 1. The integral of 1000 from 0 to 1/1000 is 1.

chiro
In a continuous distribution you can have large values at a single point and it's still all good.

It's not like a discrete distribution - you have to look at the integral of a region and not the value at a particular real number.

If you take an integral you should always find that it's a valid probability - even if the point value is a lot greater than 1.

Stephen Tashi
Setting ##a=0##, working out ##b## should prove straightforward: $$\int_0^b 2x \, dx = 1$$ $$\big[x^2\big] _0^b = 1$$ $$b^2 - 0 = 1$$