maths.freeStatistics & Probability › Continuous random variables

Continuous random variables

Density functions: probability is area, and the uniform and exponential distributions.

For a continuous variable the probability of any exact value is 0; probability lives in areas under the density curve. The uniform density on [0, 10] is a flat 1/10, so P(2 ≤ X ≤ 5) is the area 3/10. The exponential density e^{−x} models waiting times.

Continuous Probability Functions

We begin by defining a continuous probability density function. We use the function notation f(x). Intermediate algebra may have been your first formal introduction to functions. In the study of probability, the functions we study are special. We define the function f(x) so that the area between it and the x-axis is equal to a probability. Since the maximum probability is one, the maximum area is also one. For continuous probability distributions, PROBABILITY = AREA.

Example

Consider the function f(x) = \(\frac{1}{20}\) for 0 ≤ x ≤ 20. x = a real number. The graph of f(x) = \(\frac{1}{20}\) is a horizontal line. However, since 0 ≤ x ≤ 20, f(x) is restricted to the portion between x = 0 and x = 20, inclusive.

f(x) = \(\frac{1}{20}\) for 0 ≤ x ≤ 20.

The graph of f(x) = \(\frac{1}{20}\) is a horizontal line segment when 0 ≤ x ≤ 20.

The area between f(x) = \(\frac{1}{20}\) where 0 ≤ x ≤ 20 and the x-axis is the area of a rectangle with base = 20 and height = \(\frac{1}{20}\).

\[\text{AREA}=20(\frac{1}{20})=1\]

Suppose we want to find the area between f(x) = \(\frac{1}{20}\) and the x-axis where 0 < x < 2.

\[\text{AREA }=\ (2\ -\ 0)(\frac{1}{20})\ =\ 0.1\]

\[(2\ -\ 0)\ =\ 2\ =\text{ base of a rectangle}\]

The area corresponds to a probability. The probability that x is between zero and two is 0.1, which can be written mathematically as P(0 < x < 2) = P(x < 2) = 0.1.

Suppose we want to find the area between f(x) = \(\frac{1}{20}\) and the x-axis where 4 < x < 15.

\(\text{AREA }=\ (15\ -\ 4)(\frac{1}{20})\ =\ 0.55\)

\((15\ -\ 4)\ =\ 11\ =\text{ the base of a rectangle}\)

The area corresponds to the probability P(4 < x < 15) = 0.55.

Suppose we want to find P(x = 15). On an x-y graph, x = 15 is a vertical line. A vertical line has no width (or zero width). Therefore, P(x = 15) = (base)(height) = (0)\((\frac{1}{20})\) = 0

P(X <= x), which can also be written as P(X < x) for continuous distributions, is called the cumulative distribution function or CDF. Notice the less than or equal to symbol. We can also use the CDF to calculate P(X > x). The CDF gives area to the left and P(X > x) gives area to the right. We calculate P(X > x) for continuous distributions as follows: P(X > x) = 1 – P (X < x).

Label the graph with f(x) and x. Scale the x and y axes with the maximum x and y values. f(x) = \(\frac{1}{20}\), 0 ≤ x ≤ 20.

To calculate the probability that x is between two values, look at the following graph. Shade the region between x = 2.3 and x = 12.7. Then calculate the shaded area of a rectangle.

\(P(2.3

Condensed — the full section is in OpenStax Statistics.

The Uniform Distribution

The uniform distribution is a continuous probability distribution and is concerned with events that are equally likely to occur. When working out problems that have a uniform distribution, be careful to note if the data are inclusive or exclusive of endpoints.

Example

The data in are 55 smiling times, in seconds, of an eight-week-old baby.

10.419.618.813.917.816.821.617.912.511.14.9
12.814.822.820.015.916.313.417.114.519.022.8
1.30.78.911.910.97.35.93.717.919.29.8
5.86.92.65.821.711.83.42.14.56.310.7
8.99.49.47.610.03.36.77.811.613.818.6

The sample mean = 11.49 and the sample standard deviation = 6.23.

We will assume that the smiling times, in seconds, follow a uniform distribution between zero and 23 seconds, inclusive. This means that any smiling time from zero to and including 23 seconds is equally likely. The histogram that could be constructed from the sample is an empirical distribution that closely matches the theoretical uniform distribution.

Let X = length, in seconds, of an eight-week-old baby's smile.

The notation for the uniform distribution is

X ~ U(a, b) where a = the lowest value of x and b = the highest value of x.

The probability density function is f(x) = \(\frac{1}{b-a}\) for axb.

For this example, X ~ U(0, 23) and f(x) = \(\frac{1}{23-0}\) for 0 ≤ X ≤ 23.

Formulas for the theoretical mean and standard deviation are

\[\mu =\frac{a+b}{2}\text{ and }\sigma =\sqrt{\frac{{(b-a)}^{2}}{12}}\]

For this problem, the theoretical mean and standard deviation are

\[\mu \text{ = }\frac{0+23}{2}\text{ = 11}\text{.50 seconds and }\sigma \text{ = }\sqrt{\frac{{(23-0)}^{2}}{12}}\text{ = 6}\text{.64 seconds}\text{.}\]

Notice that the theoretical mean and standard deviation are close to the sample mean and standard deviation in this example.

Condensed — the full section is in OpenStax Statistics.

The Uniform Distribution

Use the following information to answer the next 10 questions. The data that follow are the square footage (in 1,000 feet squared) of 28 homes:

1.52.43.62.61.62.42.0
3.52.51.82.42.53.54.0
2.61.62.21.83.82.51.5
2.81.84.51.91.93.11.6

The sample mean = 2.50 and the sample standard deviation = 0.8302.

The distribution can be written as X ~ U(1.5, 4.5).


Use the following information to answer the next eight exercises. A distribution is given as X ~ U(0, 12).


Use the following information to answer the next 12 exercises. The age of cars in the staff parking lot of a suburban college is uniformly distributed from six months (0.5 years) to 9.5 years.

The Exponential Distribution (Optional)

The exponential distribution is often concerned with the amount of time until some specific event occurs. For example, the amount of time (beginning now) until an earthquake occurs has an exponential distribution. Other examples include the length, in minutes, of long-distance business telephone calls, and the amount of time, in months, a car battery lasts. It can be shown, too, that the value of the change that you have in your pocket or purse approximately follows an exponential distribution.

Values for an exponential random variable occur in the following way. There are fewer large values and more small values. For example, the amount of money customers spend in one trip to the supermarket follows an exponential distribution. There are more people who spend small amounts of money and fewer people who spend large amounts of money.

Exponential distributions are commonly used in calculations of product reliability, or the length of time a product lasts.

Example

Let X = amount of time (in minutes) a postal clerk spends with his or her customer. The time is known to have an exponential distribution with the average amount of time equal to four minutes.

X is a continuous random variable since time is measured. It is given that μ = 4 minutes. To do any calculations, you must know m, the decay parameter.

\(m=\frac{1}{\mu }\). Therefore, \(m=\frac{1}{4}=0.25.\)

The standard deviation, σ, is the same as the mean. μ = σ

The distribution notation is X ~ Exp(m). Therefore, X ~ Exp(0.25).

The probability density function is f(x) = me-mx. The number e = 2.71828182846... It is a number that is used often in mathematics. Scientific calculators have the key "ex." If you enter one for x, the calculator will display the value e.

The curve is

f(x) = 0.25e–0.25x where x is at least zero and m = 0.25.

For example, f(5) = 0.25e(−0.25)(5) = 0.072. The probability that the postal clerk spends five minutes with the customers is 0.072.

The graph is as follows:

Notice the graph is a declining curve. When x = 0,

f(x) = 0.25e(−0.25)(0) = (0.25)(1) = 0.25 = m. The maximum value on the y-axis is m.

Condensed — the full section is in OpenStax Statistics.

Memorylessness of the Exponential Distribution

In recall that the amount of time between customers is exponentially distributed with a mean of two minutes (X ~ Exp(0.5)). Suppose that five minutes have elapsed since the last customer arrived. Since an unusually long amount of time has now elapsed, it would seem to be more likely for a customer to arrive within the next minute. With the exponential distribution, this is not the case—the additional time spent waiting for the next customer does not depend on how much time has already elapsed since the last customer. This is referred to as the memoryless property. Specifically, the memoryless property says the following

\[P\text{ (}X\text{ > }r\text{ + }t\text{ | }X\text{ > }r\text{) = }P\text{ (}X\text{ > }t\text{) for all }r\ \ge \text{ 0 and }t\ \ge \text{ 0}\]

For example, if five minutes have elapsed since the last customer arrived, then the probability that more than one minute will elapse before the next customer arrives is computed by using r = 5 and t = 1 in the foregoing equation.

\[P\text{ (}X\text{ > 5 + 1 | }X\text{ > 5) = }P\text{ (}X\text{ > 1) = }{e}^{(-0.5)(1)}\ \approx \text{ 0}\text{.6065}\text{.}\]

This is the same probability as that of waiting more than one minute for a customer to arrive after the previous arrival.

The exponential distribution is often used to model the longevity of an electrical or a mechanical device. In , the lifetime of a certain computer part has the exponential distribution with a mean of ten years (X ~ Exp(0.1)). The memoryless property says that knowledge of what has occurred in the past has no effect on future probabilities. In this case it means that an old part is not any more likely to break down at any particular time than a brand new part. In other words, the part stays as good as new until it suddenly breaks. For example, if the part has already lasted ten years, then the probability that it lasts another seven years is P(X > 17|X > 10) = P(X > 7) = 0.4966.

Relationship Between the Poisson and the Exponential Distribution

There is an interesting relationship between the exponential distribution and the Poisson distribution. Suppose that the time that elapses between two successive events follows the exponential distribution with a mean of μ units of time. Also assume that these times are independent, meaning that the time between events is not affected by the times between previous events. If these assumptions hold, then the number of events per unit time follows a Poisson distribution with mean λ = 1/μ. Recall from the chapter on Discrete Random Variables that if X has the Poisson distribution with mean λ, then \(P(X=k)=\frac{{\lambda }^{k}{e}^{-\lambda }}{k!}\). Conversely, if the number of events per unit time follows a Poisson distribution, then the amount of time between events follows the exponential distribution. (k! = k*(k–1*)(k–2)*(k–3)…3*2*1)

The Exponential Distribution (Optional)

Use the following information to answer the next 10 exercises. A customer service representative must spend different amounts of time with each customer to resolve various concerns. The amount of time spent with each customer can be modeled by the following distribution: X ~ Exp(0.2)


Use the following information to answer the next eight exercises. A distribution is given as X ~ Exp(0.75).

Use the following information to answer the next eight exercises. Carbon-14 is a radioactive element with a half-life of about 5,730 years. Carbon-14 is said to decay exponentially. The decay rate is 0.000121. We start with one gram of carbon-14. We are interested in the time (years) it takes to decay carbon-14.

Kushanda muenzaniso: integrate 1/10 dx from 2 to 5

Integrate 1/10 from 2 to 5

\int_{2}^{5} \frac{1}{10}\, dx

Step by step

  1. \int_{2}^{5} \frac{1}{10}\, dx

    First find an antiderivative F, then evaluate F(b) − F(a).

  2. \int \frac{1}{10}\, dx = \frac{x}{10}

    The integral of a constant c is c·x.

  3. F(5) - F(2) = \left(\frac{1}{2}\right) - \left(\frac{1}{5}\right)

    Fundamental theorem of calculus: plug in the limits.

  4. = \frac{3}{10}

    Simplify.

Kuratidza mhinduro
\frac{3}{10}

Practice (40)

Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.

  1. Consider the function f(x) = \(\frac{\text{1}}{8}\) for 0 ≤ x ≤ 8. Draw the graph of f(x) and find P(2.5 < x < 7.5).

    Kuratidza mhinduro

    P (2.5 < x < 7.5) = 0.625

  2. Which type of distribution does the graph illustrate?

    Kuratidza mhinduro

    Uniform distribution

  3. Which type of distribution does the graph illustrate?

  4. Which type of distribution does the graph illustrate?

    Kuratidza mhinduro

    Normal distribution

  5. What does the shaded area represent? P(___< x < ___)

  6. What does the shaded area represent? P(___< x < ___)

    Kuratidza mhinduro

    P(6 < x < 7)

  7. For a continuous probablity distribution, 0 ≤ x ≤ 15. What is P(x > 15)?

  8. What is the area under f(x) if the function is a continuous probability density function?

    Kuratidza mhinduro

    one

  9. For a continuous probability distribution, 0 ≤ x ≤ 10. What is P(x = 7)?

  10. A continuous probability function is restricted to the portion between x = 0 and 7. What is P(x = 10)?

    Kuratidza mhinduro

    zero

  11. f(x) for a continuous probability function is \(\frac{1}{5}\), and the function is restricted to 0 ≤ x ≤ 5. What is P(x < 0)?

  12. f(x), a continuous probability function, is equal to \(\frac{1}{12}\), and the function is restricted to 0 ≤ x ≤ 12. What is P (0 < x < 12)?

    Kuratidza mhinduro

    one

  13. Find the probability that x falls in the shaded area.

  14. Find the probability that x falls in the shaded area.

    Kuratidza mhinduro

    0.625

  15. Find the probability that x falls in the shaded area.

  16. f(x), a continuous probability function, is equal to \(\frac{1}{3}\) and the function is restricted to 1 ≤ x ≤ 4. Describe \(P(x>\frac{3}{2}).\)

    Kuratidza mhinduro

    The probability is equal to the area from x = \(\frac{3}{2}\) to x = 4 above the x-axis and up to f(x) = \(\frac{1}{3}\).

  17. Consider the following experiment. You are one of 100 people enlisted to take part in a study to determine percentage of nurses in America with an R.N. (registered nurse) degree.  You ask nurses if they have an R.N. degree.  The nurses answer yes or no.  You then calculate the percentage of nurses with an R.N. degree.  You give that percentage to your supervisor.

    1. What part of the experiment will yield discrete data?
    2. What part of the experiment will yield continuous data?
  18. When age is rounded to the nearest year, do the data stay continuous, or do they become discrete?  Why?

    Kuratidza mhinduro

    Age is a measurement, regardless of the accuracy used.

  19. The data that follow are the number of passengers on 35 different charter fishing boats. The sample mean = 7.9 and the sample standard deviation = 4.33. The data follow a uniform distribution where all values between and including zero and 14 are equally likely. State the values of a and b. Write the distribution in proper notation, and calculate the theoretical mean and standard deviation.

    11241041411
    711413246
    3100126910
    513410141211
    61011011132
    Kuratidza mhinduro

    a is zero, b is 14, X ~ U (0, 14), μ = 7 passengers, σ = 4.04 passengers

  20. a. Refer to . What is the probability that a randomly chosen eight-week-old baby smiles between two and 18 seconds?

    Kuratidza mhinduro

    P(2 < x < 18) = (base)(height) = (18 – 2)\((\frac{1}{23})\) = \(\frac{16}{23}\)

  21. b. Find the 90th percentile for an eight-week-old baby's smiling time.

    Kuratidza mhinduro

    b. Ninety percent of the smiling times fall below the 90th percentile, k, so P(x < k) = 0.90.

    \[P(x

  22. c. Find the probability that a random eight-week-old baby smiles more than 12 seconds knowing that the baby smiles more than eight seconds.

    Kuratidza mhinduro

    c. This probability question is a conditional. You are asked to find the probability that an eight-week-old baby smiles more than 12 seconds when you already know the baby has smiled for more than eight seconds.

    Find P(x > 12|x > 8) There are two ways to do the problem. For the first way, use the fact that this is a conditional and changes the sample space. The graph illustrates the new sample space. You already know the baby smiled more than eight seconds.

    for 8 < x < 23

    Write a new f(x): f(x) = \(\frac{1}{23\ -\text{ 8}}\) = \(\frac{1}{15}\) for 8 < x < 23.

    P(x > 12|x > 8) = (23 − 12)\((\frac{1}{15})\) = \(\frac{11}{15}\)

    For the second way, use the conditional formula from Probability Topics with the original distribution.

    P(A|B) = \(\frac{P(A\text{ AND }B)}{P(B)}\)

    For this problem, A is (x > 12) and B is (x > 8).

    So, P(x > 12|x > 8) = \(\frac{(x>12\text{ AND }x>8)}{P(x>8)}=\frac{P(x>12)}{P(x>8)}=\frac{\frac{11}{23}}{\frac{15}{23}}=\frac{11}{15}\)

  23. A distribution is given as X ~ U(0, 20). What is P(2 < x < 18)? Find the 90th percentile.

    Kuratidza mhinduro

    P(2 < x < 18) = 0.8, 90th percentile = 18

  24. a. What is the probability that a person waits fewer than 12.5 minutes?

    Kuratidza mhinduro

    a. Let X = the number of minutes a person must wait for a bus. a = 0 and b = 15. X ~ U(0, 15). Write the probability density function. f (x) = \(\frac{1}{15\ -\ 0}\) = \(\frac{1}{15}\) for 0 ≤ x ≤ 15.

    Find P (x < 12.5). Draw a graph.

    \[P(xThe probability a person waits fewer than 12.5 minutes is 0.8333.

  25. b. On the average, how long must a person wait? Find the mean, μ, and the standard deviation, σ.

    Kuratidza mhinduro

    b. μ = \(\frac{a\ +\ b}{2}\) = \(\frac{15\ +\ 0}{2}\) = 7.5. On the average, a person must wait 7.5 minutes.

    σ = \(\sqrt{\frac{(b-a{)}^{2}}{12}}=\sqrt{\frac{(15-0{)}^{2}}{12}}\) = 4.3. The standard deviation is 4.3 minutes.

  26. c. Ninety percent of the time, the minutes a person must wait falls below what value?

    Kuratidza mhinduro

    c. Find the 90th percentile. Draw a graph. Let k = the 90th percentile.

    \(P(x
    \(0.90=(k)(\frac{1}{15})\)

    \(k=(0.90)(15)=13.5\)

    k is sometimes called a critical value.

    The 90th percentile is 13.5 minutes. Ninety percent of the time, a person must wait at most 13.5 minutes.

  27. The total duration of baseball games in the major league in the 2011 season is uniformly distributed between 447 hours and 521 hours inclusive.

    1. Find a and b and describe what they represent.
    2. Write the distribution.
    3. Find the mean and the standard deviation.
    4. What is the probability that the duration of games for a team for the 2011 season is between 480 and 500 hours?
    5. What is the 65th percentile for the duration of games for a team for the 2011 season?
    Kuratidza mhinduro
    1. a is 447, and b is 521. a is the minimum duration of games for a team for the 2011 season, and b is the maximum duration of games for a team for the 2011 season.
    2. X ~ U (447, 521).
    3. μ = 484, and σ = 21.36
    4. P(480 < x < 500) = 0.2703
    5. 65th percentile is 495.1 hours.
  28. a. The probability that a randomly selected nine-year-old child eats a doughnut in at least two minutes is _______.

    Kuratidza mhinduro

    a. 0.5714

  29. b. Find the probability that a different nine-year-old child eats a doughnut in more than two minutes given that the child has already been eating the doughnut for more than 1.5 minutes.

    The second question has a conditional probability. You are asked to find the probability that a nine-year-old child eats a doughnut in more than two minutes given that the child has already been eating the donut for more than 1.5 minutes. Solve the problem two different ways (see ). You must reduce the sample space. First way: Since you know the child has already been eating the doughnut for more than 1.5 minutes, you are no longer starting at a = 0.5 minutes. Your starting point is 1.5 minutes.

    Write a new f(x):

    \[f(x)\text{ = }\frac{1}{4-1.5}\ =\ \frac{2}{5}\text{ for 1}\text{.5 }\le \ x\le 4.\]

    Find P(x > 2|x > 1.5). Draw a graph.

    \[P(x>2|x>1.5)\text{ = (base)(new height) = (4 - 2)}(\frac{2}{5})=\frac{4}{5}\]
    Kuratidza mhinduro

    b. \(\frac{4}{5}\)

  30. Suppose the time it takes a student to finish a quiz is uniformly distributed between six and 15 minutes, inclusive. Let X = the time, in minutes, it takes a student to finish a quiz. Then X ~ U(6, 15).

    Find the probability that a randomly selected student needs at least eight minutes to complete the quiz. Then find the probability that a different student needs at least eight minutes to finish the quiz given that she has already taken more than seven minutes.

    Kuratidza mhinduro

    P (x > 8) = 0.7778

    P (x > 8 | x > 7) = 0.875

    1. Find the probability that a randomly selected furnace repair requires more than two hours.
    2. Find the probability that a randomly selected furnace repair requires less than three hours.
    3. Find the 30th percentile of furnace repair times.
    4. The longest 25 percent of furnace repair times take at least how long? (In other words: find the minimum time for the longest 25 percent of repair times.) What percentile does this represent?
    5. Find the mean and standard deviation
    Kuratidza mhinduro

    a. To find f(x): f (x) = \(\frac{1}{4\ -\ 1.5}\) = \(\frac{1}{2.5}\) so f(x) = 0.4

    P(x > 2) = (base)(height) = (4 – 2)(0.4) = 0.8

  31. The amount of time a service technician needs to change the oil in a car is uniformly distributed between 11 and 21 minutes. Let X = the time needed to change the oil on a car.

    1. Write the random variable X in words. X = __________________.
    2. Write the distribution.
    3. Graph the distribution.
    4. Find P (x > 19).
    5. Find the 50th percentile.
    Kuratidza mhinduro
    1. Let X = the time needed to change the oil in a car.
    2. X ~ U (11, 21).
    3. P (x > 19) = 0.2
    4. the 50th percentile is 16 minutes.
  32. What type of distribution is this?

  33. In this distribution, outcomes are equally likely. What does this mean?

    Kuratidza mhinduro

    It means that the value of x is just as likely to be any number between 1.5 and 4.5.

  34. What is the height of f(x) for the continuous probability distribution?

  35. What are the constraints for the values of x?

    Kuratidza mhinduro

    1.5 ≤ x ≤ 4.5

  36. Graph P(2 < x < 3).

  37. What is P(2 < x < 3)?

    Kuratidza mhinduro

    0.3333

  38. What is P(x < 3.5| x < 4)?

  39. What is P(x = 1.5)?

    Kuratidza mhinduro

    zero

Symbols used here

\int f(x)\,dx,\ \int_a^b
integral
Antiderivative (indefinite) or signed area from a to b (definite).
\sqrt{x},\ \sqrt[n]{x}
square root, n-th root
The non-negative number whose square (n-th power) is x.
\lambda
lambda (eigenvalue)
The factor by which an eigenvector is stretched: Av = λv.
\sigma,\ s,\ \sigma^2
standard deviation, sample s.d., variance
Typical distance from the mean; its square.
\bar{x},\ \mu
sample mean, population mean
Average of the data; average of the whole population.
P(A),\ P(A \mid B)
probability, conditional probability
Chance of A; chance of A given that B happened.
y',\ y''
first and second derivative of y
Prime notation for derivatives with respect to x (or t).
e
Euler's number
2.71828…, the base whose exponential is its own derivative.
\approx
approximately equal
Equal to the precision shown, not exactly.
\leq,\ \geq
less/greater than or equal
Inequalities that allow equality; < and > exclude it.
\pm
plus or minus
Both signs at once: x = 3 ± 2 means 5 and 1.
n!
factorial
n × (n−1) × … × 1; the number of orderings of n things. 0! = 1.
\binom{n}{k}
binomial coefficient, "n choose k"
Number of k-element subsets of n things: n!/(k!(n−k)!).
\sum_{k=1}^{n} a_k
summation
Add a_k for k = 1 up to n.
A \cup B,\ A \cap B,\ A \setminus B
union, intersection, difference
In either; in both; in A but not B.
E[X],\ \operatorname{Var}(X)
expected value, variance
Probability-weighted average of X; its spread.

How to: Continuous random variables

  1. First find an antiderivative F, then evaluate F(b) − F(a).
  2. The integral of a constant c is c·x.
  3. Fundamental theorem of calculus: plug in the limits.
  4. Simplify.

Questions people ask

Mean or median — which should I use?

Median when the data have outliers or a long tail (incomes, house prices); mean when the data are roughly symmetric and you want every value to count. Report both if they disagree — the gap is itself information.

What does a p-value actually say?

The probability of seeing data at least this extreme if the null hypothesis were true. It is not the probability that the null hypothesis is true.

Why divide by n − 1 for the sample variance?

The sample mean sits closer to the sample than the true mean does, so squared deviations from it are slightly too small on average; dividing by n − 1 instead of n corrects the bias.

Tarisa yako

Parts of this page are adapted from OpenStax Statistics (CC BY 4.0). Condensed and re-explained here; errors are ours.

More in Statistics & Probability