What is the range of values for a parameter to ensure that a pdf is valid?

The question is:

The continuous probability distribution function (PDF) depends on one parameter $$a$$ related to the slope of the line and can be defined as: $$\operatorname{pdf}(x | a)=\left\{\begin{array}{ll}{1+a x,} & {\text { for }-\frac{1}{2} \leq x \leq \frac{1}{2}} \\ {0,} & {\text { otherwise }}\end{array}\right.$$ a) What is the range of values for $$a$$ to ensure that the above definition is a valid probability distribution function?

$$0 \leq p d f(x | a) \leq 1$$

So: $$\quad 1+a x \geqslant 0$$ and $$1+a x \leq 1$$

$$1^{\circ}$$ for $$-\frac{1}{2} \leq x \leq \frac{1}{2} \quad$$ and $$\quad a>0$$ $$\quad$$ $$\quad\left\{\begin{array}{l}{1+a x \geqslant 0} \\ {1+a x \leq 1}\end{array}\right\} \cdot \frac{1}{a} \rightarrow \left\{\begin{array}{l}{x \geqslant-\frac{1}{a}} \\ {x \leq 0}\end{array} \Rightarrow-\frac{1}{2}=-\frac{1}{a} \Rightarrow a=2\right.$$

$$2^{\circ}$$ for $$-\frac{1}{2} \leq x \leq \frac{1}{2} \quad$$ and $$\quad a<0$$ $$\quad$$ $$\quad\left\{\begin{array}{l}{1+a x \geqslant 0} \\ {1+a x \leq 1}\end{array}\right\} \cdot \frac{1}{a} \rightarrow \left\{\begin{array}{l}{x \leq-\frac{1}{a}} \\ {x \leq 0}\end{array} \Rightarrow\frac{1}{2}=-\frac{1}{a} \Rightarrow a=-2\right.$$

$$\Rightarrow a \in[-2,2]$$

Is this answer correct? I feel like this isn't the correct approach but it's been so long since I last did inequalities.

• If you are calling it a "pdf" you may also want $\int_{-0.5}^{0.5} f(x|a) dx = 1$, which will determine admissible values of $a$.
– snar
Oct 23 '19 at 16:07
• Oh! Now I understand! So the pdf itself can take values greater than 1, but the area should be 1. Thank you super much! Oct 23 '19 at 16:12

pdf must take nonnegative values but it can take values that are bigger than $$1$$.

Hence we need $$1-\frac12 a \ge 0$$ and $$1+\frac12 a \ge 0$$. We just need to check the boundary value since it is a straight line segment.

which is equivalent to $$2 \ge a$$ and $$a\ge -2$$.

That is $$-2 \le a \le 2$$

Remark: It is easy to check that integration to $$1$$ condition holds trivially.

• How come it can take values bigger than 1? Isn't the maximum probability 1? I am missing something big here. It's been too long since I took a probability course. Oct 23 '19 at 16:10
• For example, consider the uniform distribution between $0$ to $\frac12$. The values that the pdf value take is not the probability, the integration gives you the probability. Oct 23 '19 at 16:12
• Finally I understand! I knew there are something basic I was missing. Thank you super much! Oct 23 '19 at 16:12