Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Probability  ›  Lesson

Random Variables and PDFs

Random Variances, PDFs 15 minA random variable is a number decided by chance; a discrete one puts probability on single values, while a continuous one spreads it as a density whose area gives probability.

Random Variables and PDFs

Pick one of the five flats at random. Its number of rooms is not fixed until you pick, but you can still say exactly how likely each value is. A number decided by chance is a random variable, and models describe their uncertainty with them all the time: "rent is probably around 20, give or take 4".

The rule

Discrete: probability sits on points. Continuous: probability is area under the density.

Discrete random variables take separate values you can list. Let RR be the rooms of a random flat from A to E. The rooms are 1, 2, 3, 2 and 2, so the probability mass function is:

Rooms 1 2 3
Probability 0.2 0.6 0.2

The probabilities sum to 1. The expected value is the probability-weighted average:

E[R]=1(0.2)+2(0.6)+3(0.2)=2.0E[R] = 1(0.2) + 2(0.6) + 3(0.2) = 2.0

Continuous random variables can take any value in a range, like the exact rent of a flat in a new city. There are infinitely many possible values, so any single exact value has probability 0. Instead, a probability density function (PDF) f(x)f(x) is a curve, and the probability of landing in a range is the area under the curve over that range. The total area is 1.

Suppose rents in a new city are equally likely anywhere from 10 to 30 thousand. The density is flat, and to make the total area 1 over a width of 20, its height is 1/20=0.051/20 = 0.05. Then

P(15≤X≤20)=5×0.05=0.25P(15 \le X \le 20) = 5 \times 0.05 = 0.25

A density is probability per unit, not a probability. So it can be bigger than 1: a density spread evenly from 0 to 0.5 must have height 2 to give area 1. The cumulative distribution function F(x)=P(X≤x)F(x) = P(X \le x) is the area to the left of xx, and it always climbs from 0 to 1.

The shortcut

Discrete: add the bars. Continuous: find the area (for a flat density, width times height).

P(rent above 24) in the new cityStep 1 of 3
  1. Find the height

    Range 10 to 30, width 20, so height 1/20 = 0.05.

The trap is reading a density's height as a probability. Height times width is what counts.

Drills

Answer fast — trust the rule.

quick drill

For R, the rooms of a random flat from A to E, what is the expected value?

quick drill

What is P(R ≥ 2)?

quick drill

Rents are spread evenly from 10 to 30. What is P(12 ≤ rent ≤ 22)?

quick drill

A density function has the value 2 at some point. Is that a mistake?

quick drill

For a continuous rent, what is P(rent is exactly 20.000...)?

Remember

  • Discrete: probability sits on points. Continuous: probability is area under the density.
  • Shortcut: add the bars, or multiply width by height for a flat density.
  • Trap: reading a density's height as a probability.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainArea, not height

A new city's rents are uniformly spread between 10 and 30 thousand. Explain what the density's height is, how to find the probability that a rent lies between 15 and 20, why the probability of exactly 20 is zero, and why a density can be bigger than 1.