Exercise R.1.7
Probability density function: show the uniform density is a pdf
**Most of the time, one can swap sums to integrals to switch from the discrete to the continuous case (although not completely correct).
A pdf is a function \(f\) such that \(f(x)\geq 0\) for all \(x\) and \[\begin{align*} \int_{-\infty}^{\infty}f_X(x) dx=1. \end{align*}\]
Note that this means that its integral exists. A pdf has density \(f_X(x)\) at each point.
To get probabilities, we need the area under the curve of the pdf over an interval: \[\begin{align*} \mathbb{P}(a<X<b)=\int_a^b f_X(x) dx, \end{align*}\] read as the probability \(X\) is between \(a\) and \(b\).
A continuous uniform distribution has pdf \(f(x)=\frac{1}{b-a}\) for \(x \in (a,b)\) and \(f(x)=0\) otherwise. Show that it is indeed a pdf.
Hint: the function has to be non-negative and the integral must equal 1.