As you may recall the probability density function describes the behavior of a random variable.

Like a histogram, the PDF when plotted reveals the shape of the distribution. The PDF also has the property that the area under the curve for is one. Another property is the PDF is defined across the entire sample space.

The exponential, Weibull and other distributions have PDFs defined, yet it is possible to have an arbitrary function meet the requirements of a PDF.Â Thus the following two functions are possible PDFs.

$$ \large\displaystyleÂ f\left( x \right)=0.25x\text{, where 0}\ge x\ge {\sqrt{8}}\text{, else }f\left( x \right)=0$$

We can check if this function does have an area of 1 over the sample space by integrating from negative to positiveÂ infinity.

$$ \large\displaystyle \int_{-\infty }^{\infty }{0.25xdx}$$

And the result should equal one. Yet the function has three regions. Below zero the function equals zero, from zero to 8 f(x) = 0.25x, and above 8 it again equals zero. To integrate this function we use the interval union property and break up the integration into the three regions.

$$ \large\displaystyle \int_{-\infty }^{\infty }{0.25xdx}=\int_{-\infty }^{0}{0.25xdx}+\int_{0}^{\sqrt{8}}{0.25xdx}+\int_{\sqrt{8}}^{\infty }{0.25xdx}$$

Since by the definition of the given PDF the first and last terms are equal to zero this reduces to

$$ \large\displaystyle \int_{-\infty }^{\infty }{0.25xdx}=\int_{0}^{\sqrt{8}}{0.25xdx}$$

This is a definite integral of a variable raised to a power, recall the x is the same as x raised to the first power, x^{1}. In general

$$ \large\displaystyle \int_{a}^{b}{{{x}^{n}}dx}=\left. \frac{{{x}^{n+1}}}{n+1} \right|_{a}^{b}=\frac{{{b}^{n+1}}-{{a}^{n+1}}}{n+1}$$

Thus we can evaluate the PDF to check if the area under the defined curve is equal to one.

$$ \large\displaystyle \int_{0}^{\sqrt{8}}{0.25xdx}=\left. \frac{0.25{{x}^{2}}}{2} \right|_{0}^{\sqrt{8}}=\frac{0.25{{\left( \sqrt{8} \right)}^{2}}-0.25\left( {{0}^{2}} \right)}{2}=0.125\left( 8 \right)=1$$

So, it seems the function is a PDF.

## PDF to CDF

Now letâ€™s determine the cumulative distribution function for this PDF.

Well we already kind of did that when checking if the area under the curve equals one. The CDF is the integral of the PDF and in this case is

$$ \large\displaystyle F\left( n \right)=\int_{0}^{n}{0.25xdx}=\left. \frac{0.25{{x}^{2}}}{2} \right|_{0}^{n}=\frac{0.25{{n}^{2}}-0.25\left( {{0}^{2}} \right)}{2}=0.125{{n}^{2}}\text{, where }0\le n\le \sqrt{8}$$

Thus if we wanted to determine the probability of being less than or equal toÂ 2 we can use the CDF function

$$ \large\displaystyle \begin{array}{l}F\left( x \right)=0.125{{x}^{2}}\\F\left( 2 \right)=0.125\left( {{2}^{2}} \right)=0.5\end{array}$$

Hope this worked out example with a touch ofÂ integration helps to refresh your calculus skills.

Related:

The Poisson DistributionÂ (article)

The Normal DistributionÂ (article)

The Exponential DistributionÂ (article)

Lance says

Hey. This article has numerous mistakes.

Firstly, 0 <= x = x >= 8.

Secondly, when you integrate the PDF, you integrate f(x) and not 0.25x. Because, f(x) is not always equal to 0.25x from -ve infinity to +ve infinity.