# Solving for constant in probability density function

A continuous random variable $X$ has the density $f_X$:

$$f_x(x) = \begin{cases}\frac{x}{a}, & 20 < x < 40,\\0, & \textrm{otherwise.}\end{cases}$$

Find $a$ so that $f_x(x)$ becomes a proper density function.

I'm aware that $f$'s total area under the curve has to be $1$, which is the core of the problem. E.g:

$$\int_{-\infty}^\infty f_xdx = \int_{21}^{39} f_xdx = 1$$

Solving this yields $a = 540$. However, my learning material's solution has different integral borders:

$$\int_{20}^{40} f_xdx = 1$$

Which gives another answer. Is this simply a typo, considering $f_x(20) = f_x(40) = 0$. Or why should $20$ and $40$ be included in the evaluation?

• The bounds on your first integral are wrong, $f_x(20.0001) \neq 0$. – fosho Jan 7 '16 at 21:36

## 1 Answer

Remember that when we calculate the area under a curve, excluding only point does not affect the value of the area. So you can consider this as as the function

$f(x)= \frac{x}{a}$ where $20\le x\le 40$

Why is that? Go back to the definition of integral, it's the limit of Riemann sum, Will Riemann sum be affected by just excluding a point? absolutely not! this can be seen as intuitively true.

• OP has excluded an uncountably infinite number of points! – fosho Jan 7 '16 at 21:44
• @Daniel, And this is why he got a wrong answer! – Fawzy Hegab Jan 8 '16 at 0:45
• Thank you very much for your answer; it makes perfect sense. My mind was stuck in the world of whole numbers, and forgot the infinite amount of numbers in between. – Zar Jan 8 '16 at 17:15
• @Zar, You are welcome ;-) – Fawzy Hegab Jan 8 '16 at 22:08