For discrete random variables you answer this type of question by summing the probability that \(X\) is equal to \(y\) for every \(y\) in the set \(A\text{.}\) For continuous random variables, the probability of being equal to any one real number is zero. In the example with the dart, the probability that it lands exactly \(\sqrt{3}\) feet from the left edge (or 1 foot, or \(1/3\) of a foot, or any other real number of feet) is zero. The only way to get a nonzero probability is to consider an entire interval of values. Thus the most basic questions we ask about \(X\) are: what is the probability that \(X \in [a,b]\text{,}\) where \(a \lt b\) are fixed real numbers. These probabilities will be governed by a probability density, which is a nonnegative function telling how likely it is for \(X\) to be in an interval centered at any given real number.
A random variable \(X\) is said to have probability density \(f\) if the probability of finding \(X\) in any interval \([a,b]\) is equal to \(\int_a^b f(t) \, dt\text{.}\)
Sometimes \(f\) is defined only on an interval \([a,b]\) and not on the whole real line. The interpretation is that the random variable \(X\) takes values only in \([a,b]\text{.}\) Probabilities for \(X\) are then defined by integrating in sub-intervals of \([a,b]\text{.}\) Often one extends the definition of \(f\) to all real numbers by making it zero off of \([a,b]\text{.}\) This may result in \(f\) being discontinuous but its definite integrals are still defined.
The standard exponential random variable has density \(e^{-x}\) on \([0,\infty)\text{.}\) If \(X\) has this density, what is \(\mathbb{P} (X \in [-1,1])\text{?}\) This is the same as \(\mathbb{P} (X \in [0,1])\text{,}\) because by assumption \(X\) cannot be negative. We compute it by \(\displaystyle \int_0^1 e^{-x} \, dx = \left. e^{-x} \right |_0^1
= 1 - e^{-1}\text{.}\) As a quick reality check we observe that the quantity \(1 - \frac{1}{e}\) is indeed between zero and one, therefore it makes sense for this to be a probability.
Write the statement \(X \geq m\) as a statement about \(X\) being in a (possibly infinite) interval. Letting \(f\) be the probability density of \(X\text{,}\) write an integral computing \(P (X \geq m)\text{.}\)
For example, if we know that \(f(x)\) should be of the form \(C x^{-3}\) on \([1,\infty)\) then we would need to find the right constant \(C\) to make this a probability density. The function \(f\) has to integrate to 1, meaning we have to solve
\begin{equation*}
\int_1^\infty C x^{-3} \, dx = 1
\end{equation*}
for \(C\text{.}\) Solving this results in \(C = 2\text{,}\) therefore the density of \(f\) is \(2 / x^3\) on \([1,\infty)\text{.}\)
Suppose \(X\) has density proportional to \(\cos (x)\) on the interval \([-\pi/2 , \pi / 2]\text{.}\) What value of \(C\) makes \(C \cos x\) a probability density on this interval?