# One-Dimensional Continuous Random Variables

 English Português Français ‎Español Italiano Nederlands

Definition: A continuous random variable takes values on the real line from either a finite or infinite interval.

Density function

If a function $f(x)$ has the following properties: $P(a $f(x)\geq 0$ $\int \limits _{-\infty }^{+\infty }f(x)\,dx=1$ The function $f(x)$ is the density of the continuous random variable $X$ .

Distribution function

The distribution function can be obtained from the density:

{\begin{aligned}F(x)&=&P(-\infty The distribution function $F(x)$ is equal to the area under the density $f(u)$ for $-\infty .

The density function, if it exists, can be computed as the first derivative of the distribution function: ${\frac {\partial F(x)}{\partial x}}=F^{'}(x)=f(x){\text{.}}$ The waiting time (in minutes) of supermarket customers were collected, which resulted in the following frequency distribution:

Waiting time Relative frequency Cumulative relative frequency
8.0 - 8.5 0.002 0.002
8.5 - 9.0 0.004 0.006
9.0 - 9.5 0.009 0.015
9.5 - 10.0 0.013 0.028
10.0 - 10.5 0.020 0.048
10.5 - 11.0 0.043 0.091
11.0 - 11.5 0.094 0.185
11.5 - 12.0 0.135 0.320
12.0 - 12.5 0.169 0.489
12.5 - 13.0 0.158 0.647
13.0 - 13.5 0.139 0.786
13.5 - 14.0 0.078 0.864
14.0 - 14.5 0.065 0.929
14.5 - 15.0 0.030 0.959
15.0 - 15.5 0.010 0.969
15.5 - 16.0 0.014 0.983
16.0 - 16.5 0.006 0.989
16.5 - 17.0 0.004 0.993
16.0 - 17.5 0.003 0.996
17.5 - 18.0 0.004 1.000

The relative frequencies are used to construct the histogram and the frequency polygon. Fig. 1: Histogram of the waiting time

Fig. 2: Polygon of waiting time

The continuous random variable $X=\{\,{\text{waiting time}}\,\}$ defines the groups (bins) with constant bin width $0.5$ min. The probabilities are approximated by relative frequencies (statistical definition of the probability).Note: In Fig. 1, the probabilities are given as the height of the boxes (and not the areas of the boxes). This implies that the sum of the areas of all of the boxes is equal to 0.5 (and not to 1). Similarly, the polygon on Fig. 2 cannot be a density because it does not satisfy the condition $\int _{-\infty }^{+\infty }f(x)\,dx=1\,.$ In order to obtain the density of $X$ , we need to compute the relative frequency density, which is obtained as the ratio of the relative frequencies and the widths of the corresponding groups.

Waiting time Relative frequency density
8.0 - 8.5 0.004
8.5 - 9.0 0.008
9.0 - 9.5 0.018
9.5 - 10.0 0.026
10.0 - 10.5 0.040
10.5 - 11.0 0.086
11.0 - 11.5 0.188
11.5 - 12.0 0.270
12.0 - 12.5 0.338
12.5 - 13.0 0.316
13.0 - 13.5 0.278
13.5 - 14.0 0.156
14.0 - 14.5 0.130
14.5 - 15.0 0.060
15.0 - 15.5 0.020
15.5 - 16.0 0.028
16.0 - 16.5 0.012
16.5 - 17.0 0.008
16.0 - 17.5 0.006
17.5 - 18.0 0.008

Using this relative frequency density we obtain another histogram and smoothed density function. Fig. 3: Histogram of the waiting time using relative frequency density

Fig. 4: Density of $X$ In Fig. 3 the probabilities of the groups are given by the area. This implies that the sum of these areas is equal to one. The density in Fig. 4 is (an approximate) density function of the (continuous) random variable $X=\{\,{\text{waiting time of the customer}}\,\}$ . The corresponding distribution function $F(x)$ is given in Fig. 5. Fig. 5: Distribution function of $X$ Let us consider the function $f(x)=\left\{{\begin{array}{ll}0.25x-0.5\ &{\text{for}}\ 2 Is this function a density? We need to verify whether $\int _{-\infty }^{\infty }f(x)\,dx=1\,{\text{:}}$ {\begin{aligned}\int _{-\infty }^{\infty }f(x)\,dx&=&\int _{2}^{4}(0.25x-0.5)\,dx+\int _{4}^{6}(-0.25x+1.25)\,dx\\&=&\left[0.25{\frac {1}{2}}x^{2}-0.5x\right]_{2}^{4}+\left[-0.25{\frac {1}{2}}x^{2}+1.5x\right]_{4}^{6}=1\end{aligned}} This means that $f(x)$ is a density. In particular, it is the density of the triangular distribution (named after the shape of the density in the following figure).

The density function of a continuous random variable has the following properties:

• it cannot be negative
• the area under the curve is equal to one
• probability that the random variable $X$ lies between $a$ and $b$ is equal to the area between the density and the $x$ -axis on the interval $[a,b]$ The density function $f(x)$ computes the probability that a random variable lies in the interval $[x,x+dx]$ .The probability that a continuous random variable will be equal to a specific real number is always equal to zero, since the area under a specific point is equal to zero: $\int _{x}^{x}f(t)\,dt=F(x)-F(x)=0\,.$ This implies as a corollary: the probability that continuous random variable $X$ falls into an interval does not depend on the closedness or openness of the interval. $P(a\leq X\leq b)=P(a The diagram illustrates that a histogram can be smoothed by increasing the number of observations. in the limit (i.e., as N$\rightarrow \infty )$ the histogram can be approximated by a continuous function.The area between the points $a$ and $b$ corresponds to the probability that a random variable $X$ will fall in the interval $[a,b]$ . This probability can be computed using integrals. A distribution function, $F(x),$ is the probability that the random variable $X$ is less than or equal to $x$ . Its properties follow:

• $F(x)$ is nondecreasing, i.e., $x_{1} implies that $F(x_{1})\leq F(x_{2})$ • $F(x)$ is continuous
• $0\leq F(x)\leq 1$ • $\lim _{x\rightarrow -\infty }F(x)=0$ • $\lim _{x\rightarrow +\infty }F(x)=1$ A distribution function cannot be decreasing because this would imply negative probabilities. In general, the distribution function is defined for real numbers. Limits on the sample space are necessary for the complete description of the distribution function.