Preview

A lesson from Essential Probability & Statistics for ML

£29/month

£29/month£29/month or £249/year · 30-day money-back guarantee

Get full access

Our content is best on a larger screen

What is a continuous random variable?

The probability density function

Explanation

For a discrete random variable XX, the PMF gives the probability of each value in a list, p(x)=P(X=x)p(x) = P(X = x). A continuous random variable is a different kind of object. It can take any value in an interval, so its values cannot be listed.

Instead, we describe a continuous XX by a curve, and its probabilities are areas under that curve.

12345678910
0
x

Step 1: A curve for X

X takes values in [0,10]. We describe it by the blue curve.

Its probabilities will be areas under the curve, and a probability is never negative. So the curve never goes below the horizontal axis, where a region would have negative area.

Step 2: Probability is area

The probability that X lies between 2 and 4 is the shaded area under the curve over [2,4]:

P(2<X<4)=0.34

Step 3: The total area is 1

The whole region under the curve has area 1: X is certain to take some value, and by the axioms the certain event has probability 1. The whole region lies over [0,10], so

P(0<X<10)=1

Step 4: The PDF

The curve is the graph of a function f, labelled y=f(x). We call f the probability density function (PDF) of X.

Step 5: Area as an integral

An area under a graph is an integral, so the probability that X lies between a and b is

P(a<X<b)=∫abf(x)dx

Drag the red points to move a and b.

P( <X< ) = 

Probability density function

Definition

The probability density function (PDF) of a continuous random variable XX is the function ff with f(x)≥0f(x) \ge 0 for every xx and

P(a<X<b)=∫abf(x) dxP(a < X < b) = \int_a^b f(x)\,dx

for all numbers a<ba < b.

So P(a<X<b)P(a < X < b) is the area under the graph of ff over [a,b][a, b].

The interval where f(x)>0f(x) > 0 is the support of XX.

Key Point

The interval with more area over it is more probable. A wider interval is not always more probable: where ff is low, a wide region can have less area than a narrow region where ff is tall.

Example

A delivery time XX, in hours, lies in [0,6][0, 6]. The sketch shows the graph of the PDF ff of XX, with the areas over [0,1][0, 1] and [1,3][1, 3]. Find P(X>3)P(X > 3).

123456
0
x
0.15
0.5

Solution

P(X>3)P(X > 3) is the area under the graph of ff to the right of 33, which is the area over [3,6][3, 6].

The regions over [0,1][0, 1], [1,3][1, 3] and [3,6][3, 6] together make up the whole region under the graph of ff, so their areas add to the total area, 11:

0.15+0.5+P(X>3)=10.15 + 0.5 + P(X > 3) = 1

We subtract the two given areas from 11:

P(X>3)=1−0.15−0.5=0.35\begin{align*} P(X > 3) &= 1 - 0.15 - 0.5 \\ &= 0.35 \end{align*}

The probability that the delivery takes more than 33 hours is 0.350.35.

Practice questions

4 questions

The sketch shows the graph of the PDF ff of a continuous random variable XX, which lies in [0,8][0, 8]. The regions over [1,3][1, 3] and [5,7][5, 7] are shaded. Which statement is true?

12345678
0
x

Select the correct answer:

+ 3 more questions · unlocked with a subscription

The probability of a single value is 00

Explanation

What is the probability that a continuous random variable XX takes one exact value, such as P(X=3)P(X = 3)?

Surprisingly, the answer is 00, and the same holds for every value:

Single values have probability 00

Theorem

If XX is a continuous random variable, then for every number xx,

P(X=x)=0P(X = x) = 0

So an endpoint adds nothing to a probability. For every number aa,

P(X≤a)=P(X<a)andP(X≥a)=P(X>a)P(X \le a) = P(X < a) \quad \text{and} \quad P(X \ge a) = P(X > a)
Why P(X=3)=0P(X = 3) = 0

Advanced

Earlier, we found P(a<X<b)P(a < X < b) as the area over [a,b][a, b]. The strict inequalities in a<X<ba < X < b leave out the endpoints aa and bb, but the interval [a,b][a, b] includes them. There is no conflict: each endpoint has probability 00, so including it or leaving it out gives the same probability.

Probability 00 does not mean impossible. Suppose XX is the time we wait for a bus that is sure to arrive within 1010 minutes. The bus arrives at some exact moment, yet that exact moment had probability 00, like every other. For a continuous random variable, probability belongs to intervals, not to single values.

A discrete random variable is different: each value in its support has positive probability, so including it as an endpoint adds that probability.

If every value has probability 00, how can the total be 11?

Details

Practice questions

4 questions

A bus is sure to arrive within 1515 minutes, and XX is the time we wait for it, in minutes. What is P(X=3)P(X = 3)?

Select the correct answer:

+ 3 more questions · unlocked with a subscription

Memory is built by recalling, not by reading.

Every time you pull an answer from memory, the memory gets stronger. Reading doesn't do that. Nodeledge asks you questions on every step of every lesson, then asks again after days, weeks and months.

Get full access

£29/month or £249/year · 30-day money-back guarantee

See the learning path