Advanced Statistics 201-337 • CEGEP, Montreal

Revision sheet: the continuous random variable and its density (201-337)

This revision sheet covers the continuous random variable and its probability density function, part of the probability and statistics course 201-337 at CEGEP. It does not summarize the course: it answers a single question, what costs marks on the exam in this chapter, and which precise move avoids each loss.

The central move fits in three words, AREA VERSUS HEIGHT. The density f(a)f(a) is not a probability and can exceed 1, the probability of an interval is the area above that interval, P(X=a)=0P(X=a)=0 for every value, and strict and non-strict inequalities give the same result. No integral calculus is used here: the areas are rectangles, triangles or trapezoids, and the normal distribution is read from the table or through its three bands.

Mark this sheet as read or add it to your favourites: a free account, no password, keeps your read sheets and favourites from one visit to the next, tells you which chapter to tackle next and lets you ask for the method or exercise you are missing. Create your space, an email is enough.

The thread of the chapter

A density is a HEIGHT, a probability is an AREA: on every question, say which area you are computing and on which figure, rectangle, triangle, trapezoid or band under the bell curve.

This chapter is part of 201-337, Advanced Statistics

The essentials

The two conditions, and nothing else

  • • ff is a density if and only if TWO things are true: f(x)≥0f(x)\geq 0 everywhere, and the total area under its curve is exactly 1.
  • • The second condition is Kolmogorov's axiom P(Ω)=1P(\Omega)=1 translated into an area. It is this condition, and never a value of ff, that fixes the constant of a density known only up to a factor.
  • • A probability is the AREA under ff above an interval: P(a≤X≤b)P(a\leq X\leq b) is read between the curve, the horizontal axis and the vertical lines x=ax=a and x=bx=b.
  • • A height f(a)f(a) is NOT a probability: it is a probability per unit, it carries a unit (per hour, per metre, per degree) and it can exceed 1.
  • • Immediate consequence: P(X=a)=0P(X=a)=0 for every value aa, because a segment of zero width has zero area. Hence P(a≤X≤b)=P(a<X<b)P(a\leq X\leq b)=P(a<X<b), which is FALSE in the discrete case.
123456-0.050.050.10.150.20.250.30.350.40.100.250.15shaded area = 0.35x (hours)f(x) (per hour)
The three numbers 0.10, 0.25 and 0.15 are HEIGHTS, in probability per hour; the required probability is the shaded area, 1×0.10+1×0.25=0.351\times 0.10+1\times 0.25=0.35.

Writing “the required probability is the area of the trapezoid with parallel sides f(1)f(1) and f(3)f(3) and width 2” before computing regularly earns half a mark for method, and above all keeps you from taking a triangle for a trapezoid.

The cumulative distribution function, the median and the expected value, without integrals

  • • F(x)=P(X≤x)F(x)=P(X\leq x) is the area ACCUMULATED from the left. It increases from 0 to 1, it is continuous (no jump), and P(a≤X≤b)=F(b)−F(a)P(a\leq X\leq b)=F(b)-F(a).
  • • The median mm is the solution of F(m)=0.5F(m)=0.5: it cuts the area into two halves, it does not cut the support in two.
  • • E(X)E(X) is the xx-COORDINATE OF THE CENTRE OF GRAVITY of the area under ff. For a triangle, it is the mean of the xx-coordinates of its three vertices, which gives the expected value in one line.
  • • The peak of ff is the MODE, not the expected value. The three measures coincide only if the density is symmetric with a single peak, as for the uniform and the normal distributions.
  • • An approximate value of E(X)E(X) is always obtained by cutting the support into strips and placing the weight of each strip at its centre: this is exactly the weighted mean of the discrete case.
0.511.522.533.544.50.10.20.30.40.50.60.50.5median √8 ≈ 2.83E(X) ≈ 2.67x (metres)
For f(x)=x8f(x)=\dfrac{x}{8} on [0,4][0, 4], the median 8≈2.83\sqrt{8}\approx 2.83 cuts the AREA into two halves (blue, orange), not the support; the centre of gravity, E(X)=83≈2.67E(X)=\dfrac{8}{3}\approx 2.67, is a little to the left.

No integral calculus is needed in this course. If the area is neither a rectangle, nor a triangle, nor a trapezoid, then the distribution is exponential or normal, and those two are read with a formula or from the table.

The three usual distributions, and how to take their area

  • • UNIFORM on [a,b][a, b]: f(x)=1b−af(x)=\dfrac{1}{b-a}, the area is a rectangle, so P(c≤X≤d)=d−cb−aP(c\leq X\leq d)=\dfrac{d-c}{b-a}, E(X)=a+b2E(X)=\dfrac{a+b}{2} and V(X)=(b−a)212V(X)=\dfrac{(b-a)^{2}}{12}.
  • • EXPONENTIAL with parameter λ\lambda: F(x)=1−e−λxF(x)=1-e^{-\lambda x} and P(X>x)=e−λxP(X>x)=e^{-\lambda x}, so there is no area to cut up. E(X)=σ=1λE(X)=\sigma=\dfrac{1}{\lambda} and median ln⁡2λ\dfrac{\ln 2}{\lambda}, always smaller than the mean.
  • • NORMAL: maximum height f(μ)=1σ2πf(\mu)=\dfrac{1}{\sigma\sqrt{2\pi}}, which exceeds 1 as soon as σ<0.399\sigma<0.399. The 68, 95 and 99.7 percent benchmarks are the AREAS of the bands μ±σ\mu\pm\sigma, μ±2σ\mu\pm 2\sigma and μ±3σ\mu\pm 3\sigma.
  • • Standardization Z=X−μσZ=\dfrac{X-\mu}{\sigma} divides widths by σ\sigma and multiplies heights by σ\sigma: the product, and therefore the area, does not move. That is why a single table serves every normal distribution.
  • • The exponential is MEMORYLESS, P(X>s+t∣X>s)=P(X>t)P(X>s+t\mid X>s)=P(X>t): the object does not age. The uniform, on the other hand, AGES: the waiting already done brings the bus closer.
uniforma rectangleexponential1 − exp(−λx)normalthe table
Uniform: a rectangle; exponential: a curve decreasing from λ\lambda, area through 1−e−λx1-e^{-\lambda x}; normal: a bell, area from the table.

The rules in table form

Each row reads from left to right: the assumptions, then the result. A red cell is not an answer, it is the finding that the form settles nothing and the instruction to rewrite it. Every case is followed by a worked example.

Discrete versus continuous, line by line

Half the marks lost in this chapter come from a reflex of the discrete case applied to the continuous case. The last column is the answer that holds HERE. A red cell means that the reading asked for does not exist and that you must switch to another object, not look harder.

The questionDiscrete variableContinuous variable
Describe the distribution table of the P(xi)P(x_{i}) density ff, area =1=1

Example: Die: six probabilities of 16\frac{1}{6}. Steel bar: f(x)=x8f(x)=\frac{x}{8} on [0,4][0, 4], with area 12×4×0.5=1\frac{1}{2}\times 4\times 0.5=1.

What you read at aa P(X=a)P(X=a) f(a)f(a), per unit

Example: f(4)=0.50f(4)=0.50 per metre, which gives about 0.50×0.01=0.0050.50\times 0.01=0.005 over one centimetre.

P(X=a)P(X=a) height of the bar 00

Example: P(X=3)=16≈0.167P(X=3)=\frac{1}{6}\approx 0.167 for the die, against P(X=3)=0P(X=3)=0 on the bar.

Read PP at a POINT possible nothing to read reading impossible

Example: On the bar, f(3)=0.375f(3)=0.375 is not a probability; the area over [2.95,3.05][2.95, 3.05] is 0.375×0.1=0.03750.375\times 0.1=0.0375.

What to do: Take an AREA over an interval of nonzero width, never a value at a point.

≤\leq or << different results same result

Example: On the step density, P(1≤X≤3)=P(1<X<3)=0.35P(1\leq X\leq 3)=P(1<X<3)=0.35.

Maximum height ≤1\leq 1 no ceiling

Example: Uniform on [0,0.25][0, 0.25]: f=4f=4. Normal with standard deviation 0.250.25: f(μ)=1.5958f(\mu)=1.5958.

The cumulative distribution function FF step function continuous

Example: For the die, FF jumps by 16\frac{1}{6} at 3. Here F(x)=x216F(x)=\frac{x^{2}}{16}, so F(2)=0.25F(2)=0.25, without any jump.

E(X)E(X) ∑xiP(xi)\sum x_{i}P(x_{i}) centre of gravity

Example: Triangle with vertices (0,0)(0, 0), (4,0)(4, 0) and (4,0.5)(4, 0.5): E(X)=0+4+43≈2.67E(X)=\frac{0+4+4}{3}\approx 2.67 m.

Only one line of this table carries over from discrete to continuous unchanged, the one for the expected value: the mean is still weighted, with the density replacing the point probabilities.

The mistakes that cost marks

These are the errors I correct most often in session. Each one costs marks on a paper, even when the reasoning behind it is right.

1. Reading a density as a probability

2 marks, and the mistake repeats on every question of the chapter

What not to write

“f(4)=0.50f(4)=0.50, so there is a 50 percent chance that the flaw is at 4 metres.”

What to write

“f(4)=0.50f(4)=0.50 is a density, in probability per metre. Over one centimetre around 4 metres, P≈0.50×0.01=0.005P\approx 0.50\times 0.01=0.005.”

Why: The test that settles it in one second is the UNITS test: a probability has none, a density always has one. It is also the mistake that then leads to writing P(X=a)=f(a)P(X=a)=f(a).

2. Believing that a density cannot exceed 1

1.5 marks, plus the time lost looking for an error that does not exist

What not to write

“I get f(x)=4f(x)=4, that is impossible: a probability never exceeds 1, I must have made a mistake somewhere.”

What to write

“f(x)=4f(x)=4 on [0,0.25][0, 0.25] is correct: it is the AREA that equals 1, 0.25×4=10.25\times 4=1, and the height is not capped.”

0.511.522.533.54-0.50.511.522.5area = 1height 0.5height 2area= 1xf(x) (per unit)
Two uniform densities with the same area, 1. The one on the right is four times taller because it is four times narrower: a height of 2 breaks no rule.

Why: The more concentrated the variable, the taller the density: for a normal distribution, 1σ2π\frac{1}{\sigma\sqrt{2\pi}} exceeds 1 as soon as σ<0.399\sigma<0.399, which happens as soon as you measure in fine units.

3. Looking for the probability of an exact value on the curve

2 marks, and everything that follows rests on a number that does not exist

What not to write

“P(X=3)P(X=3) is read at the value 3: P(X=3)=f(3)=0.375P(X=3)=f(3)=0.375.”

What to write

“P(X=3)=0P(X=3)=0: the area above a point is zero. For a nonzero number, you need a width: P(2.95≤X≤3.05)≈0.375×0.1=0.0375P(2.95\leq X\leq 3.05)\approx 0.375\times 0.1=0.0375.”

0.511.522.533.544.50.10.20.30.40.50.6f(3) = 0.375: a heightarea ≈ 0.0375x (metres)
f(3)=0.375f(3)=0.375 is a HEIGHT (red); a probability needs a width: the band of width 0.10.1 around 33 (green) has area 0.03750.0375, and a single point, 00.

Why: In the discrete case, P(X=3)P(X=3) is the height of the jump of FF at 3. Here FF is CONTINUOUS, so it does not jump, so the probability of an isolated value is zero. The two worlds part ways exactly there.

4. Believing that a strict inequality changes the result

1 mark, and the result obtained is often absurd

What not to write

“P(1<X<3)=P(1≤X≤3)−f(1)−f(3)=0.35−0.10−0.25=0P(1<X<3)=P(1\leq X\leq 3)-f(1)-f(3)=0.35-0.10-0.25=0.”

What to write

“P(1<X<3)=P(1≤X≤3)=0.35P(1<X<3)=P(1\leq X\leq 3)=0.35: we remove two isolated values, so two ZERO areas.”

Why: The reflex comes from the discrete case, where the subtraction is right and equals exactly P(X=1)+P(X=3)P(X=1)+P(X=3). In the continuous case these two terms are zero, and what gets subtracted by mistake are heights.

5. Fixing the constant with a value of the function instead of the area

the whole question, and the four parts that build on it

What not to write

“f(x)=kxf(x)=kx on [0,4][0, 4], and it has to come to 1 at the end, so f(4)=4k=1f(4)=4k=1 and k=0.25k=0.25.”

What to write

“The area equals 1: the curve bounds a triangle with base 4 and height 4k4k, so 12×4×4k=8k=1\frac{1}{2}\times 4\times 4k=8k=1 and k=18=0.125k=\frac{1}{8}=0.125.”

0.511.522.533.544.50.20.40.60.811.2f(4) = 1: area 2k = 1/8: area 1x
Requiring f(4)=1f(4)=1 gives the red triangle, of area 22; the condition bears on the area: height 0.50.5, area 11, k=18k=\dfrac{1}{8} (green).

Why: No condition bears on the value of ff at a point: normalization is the SECOND condition of a density and it is written on the area. Here the error factor is exactly 2, that of the triangle.

6. Believing that the exponential distribution ages

2 marks on the interpretation question, which comes up on every exam

What not to write

“The component has already lasted 6 years, so it is closer to failing: its probability of lasting 5 more years is lower than that of a new one.”

What to write

“P(X>11∣X>6)=e−2.2e−1.2=e−1=0.3679=P(X>5)P(X>11\mid X>6)=\frac{e^{-2.2}}{e^{-1.2}}=e^{-1}=0.3679=P(X>5): the exponential is memoryless, and the used component has the same survival distribution as a new one.”

2468101214161820-0.050.050.10.150.20.25newalready 6 yearsx (years)f(x) (per year)
The red curve, the survival curve of a component that has already lasted 6 years, is the curve of a new one simply shifted: same starting height, same decay.

Why: The density decreases, which suggests ageing, whereas it decreases only because fewer and fewer objects are still in service. The failure rate itself is CONSTANT. It is the UNIFORM distribution that ages, with the bus getting closer while you wait.

7. Confusing the density and the cumulative distribution function

2 marks, and the error spreads to the median and the quartiles

What not to write

“F(3)F(3), I read it off the curve: F(3)=0.375F(3)=0.375.”

What to write

“f(3)=0.375f(3)=0.375 is the HEIGHT at 3; F(3)=P(X≤3)F(3)=P(X\leq 3) is the area accumulated up to 3, namely 916=0.5625\frac{9}{16}=0.5625.”

1234567-0.20.20.40.60.811.2f(x)F(x)F ends at 1x (metres)f(x) and F(x)
Same steel bar, two curves: ff rises to 0.50.5 then drops, FF rises to 11 and stays there. Reading F(3)F(3) off the straight line gives 0.3750.375 instead of 0.56250.5625.

Why: The two curves often live in the same window and look alike when ff is increasing. The sign that never misleads: FF starts at 0, rises without ever coming back down and ends at 1, whereas ff has no reason to do so.

8. Taking the peak of the density for the expected value

1.5 marks, and you lose the free visual check

What not to write

“The density is highest at x=4x=4, so the most probable value is 4 and E(X)=4E(X)=4.”

What to write

“The maximum of ff is the MODE, here 4. The expected value is the centre of gravity of the area: E(X)=0+4+43=83≈2.67E(X)=\frac{0+4+4}{3}=\frac{8}{3}\approx 2.67, and the median is 8≈2.83\sqrt{8}\approx 2.83.”

0.511.522.533.544.50.10.20.30.40.50.6peak: mode 4E(X) ≈ 2.67x (metres)
The peak of ff is at 44: that is the mode (red). The expected value is the centre of gravity of the area, 0+4+43≈2.67\dfrac{0+4+4}{3}\approx 2.67 (green).

Why: Mode, median and mean coincide only if the density is symmetric with a single peak, which is the case for the uniform and the normal distributions: it is this special case that keeps the confusion alive.

9. Forgetting to split what lies outside a band in two

2 marks, and the announced risk is twice the real risk

What not to write

“The two-standard-deviation band carries 0.95450.9545, so P(X≥21.5)=1−0.9545=0.0455P(X\geq 21.5)=1-0.9545=0.0455.”

What to write

“The remaining 0.04550.0455 is shared between the TWO tails, which are symmetric: P(X≥21.5)=0.04552=0.0228P(X\geq 21.5)=\frac{0.0455}{2}=0.0228.”

2020.52121.522-0.250.250.50.7511.251.51.752area 0.95450.02280.0228x (degrees Celsius)f(x) (per degree)
The central band, two standard deviations wide on each side, carries 0.95450.9545. The remaining 0.04550.0455 is shared between the TWO tails, that is 0.02280.0228 on each side.

Why: The complement of a CENTRED band is not one tail, it is two tails. The same division by two comes back in every calculation of the type P(∣X−μ∣≤k)P(\left|X-\mu\right|\leq k), and the table, which gives the area to the left, does not do it for you.

Which method to choose

Which area, and on which figure

Look at the SHAPE of the density, not the topic of the statement. Each shape has its figure, and each figure has its area.

rectangletriangletrapezoidcurve: table
The figures the tree chooses between: a rectangle (uniform), a triangle or a trapezoid (linear density), a curve whose area is read with a formula or from the table.
  • If CONSTANT density on [a,b][a, b] (uniform distribution) → rectangle: the probability is the ratio of lengths, d−cb−a\dfrac{d-c}{b-a}

    Example: P(3≤X≤7)P(3\leq X\leq 7) on [0,12][0, 12] equals 412=13≈0.3333\frac{4}{12}=\frac{1}{3}\approx 0.3333

    it is the only distribution of the chapter where a probability is a proportion of length

  • If LINEAR density, of the type f(x)=kxf(x)=kx or f(x)=k(b−x)f(x)=k(b-x) → trapezoid with parallel sides f(c)f(c) and f(d)f(d), or a difference of two triangles

    Example: f(x)=x8f(x)=\frac{x}{8}: P(1≤X≤3)=0.125+0.3752×2=0.50P(1\leq X\leq 3)=\frac{0.125+0.375}{2}\times 2=0.50

    both routes give the same number, since a trapezoid is a difference of triangles

  • If STEP density and an interval straddling two steps → cut into rectangles, one per step, then add up the areas

    Example: P(1≤X≤3)=1×0.10+1×0.25=0.35P(1\leq X\leq 3)=1\times 0.10+1\times 0.25=0.35

    you add AREAS, never heights

  • If density f(x)=λe−λxf(x)=\lambda e^{-\lambda x} (exponential distribution) → no area to cut up: P(X>x)=e−λxP(X>x)=e^{-\lambda x} and F(x)=1−e−λxF(x)=1-e^{-\lambda x}

    Example: λ=0.2\lambda=0.2: P(X>8)=e−1.6≈0.2019P(X>8)=e^{-1.6}\approx 0.2019

    keeping the form P(X>x)=e−λxP(X>x)=e^{-\lambda x} saves a complement on every line

  • If BELL-shaped density (normal distribution) → either the table after z=x−μσz=\dfrac{x-\mu}{\sigma}, or the 68, 95 and 99.7 percent bands

    Example: μ=21\mu=21, σ=0.25\sigma=0.25: z=21.5−210.25=2z=\frac{21.5-21}{0.25}=2 so P(X≥21.5)=0.0228P(X\geq 21.5)=0.0228

    the band avoids the table when the endpoint falls exactly on a whole number of standard deviations

  • If the statement asks for a CUTOFF value, not a probability → work back through the cumulative distribution function: solve F(t)=pF(t)=p, with the logarithm for the exponential

    Example: 1−e−0.25t=0.901-e^{-0.25t}=0.90 gives t=ln⁡100.25≈9.21t=\frac{\ln 10}{0.25}\approx 9.21 minutes

    the median is the case p=0.5p=0.5, the quartiles the cases 0.250.25 and 0.750.75

No branch calls for an integral, and that is deliberate: this course assumes none. If the area you are looking for is neither a rectangle, nor a triangle, nor a trapezoid, then the distribution is exponential or normal, and those two are read with a formula or from the table.

How the answer is expected to be written

A marker ticks steps. Here they are in order, with the concluding sentence expected word for word.

Showing that a function is a density and finding the constant

When to use it: The statement gives f(x)=kxf(x)=kx, f(x)=k(b−x)f(x)=k(b-x) or a step function, and asks for kk, or asks you to check that ff is indeed a density.

  1. 1 State the TWO conditions, by name: nonnegativity of ff everywhere, and total area equal to 1.
  2. 2 Check nonnegativity by giving the reason, not by asserting it: “on [0,4][0, 4], x≥0x\geq 0, so kx≥0kx\geq 0 as long as k>0k>0; elsewhere ff is zero”.
  3. 3 Name the FIGURE whose area you take before computing: “the curve bounds a right triangle with base 4 and height 4k4k”.
  4. 4 Write the area equation and solve it: 12×4×4k=8k=1\frac{1}{2}\times 4\times 4k=8k=1, so k=18=0.125k=\frac{1}{8}=0.125.
  5. 5 Write ff out in full, piece by piece, zero included: f(x)=x8f(x)=\frac{x}{8} on [0,4][0, 4] and f(x)=0f(x)=0 elsewhere.

Concluding sentence

“ff is nonnegative on R\mathbb{R} and the area under its curve is 8k8k. The normalization condition requires 8k=18k=1, so ff is a probability density function if and only if k=18k=\frac{1}{8}, with f(x)=x8f(x)=\frac{x}{8} on [0,4][0, 4] and f(x)=0f(x)=0 elsewhere.”

The trap: Forgetting the last line, the one that says ff is zero outside the support. Without it, the total area is not the one you have just computed and the proof is incomplete.

Marking: 1 mark for the justified nonnegativity, 2 marks for the area equation and its solution, 1 mark for writing ff out in full.

Computing a probability by naming the area

When to use it: Any question that starts with “compute P(… )P(\dots)” on a continuous variable, including when the event is written with an absolute value or with the words “at least”.

  1. 1 Translate the event into an INTERVAL: ∣E∣≤0.2\left|E\right|\leq 0.2 becomes [−0.2,0.2][-0.2, 0.2], “at least 3 hours” becomes [3,+∞)[3, +\infty).
  2. 2 Say which figure carries this area: rectangle, trapezoid, difference of triangles, or band under the bell curve.
  3. 3 Compute the area with both dimensions written out in full, width then height, and never a height alone.
  4. 4 Check that the result falls between 0 and 1, and that it is smaller than the probability of an interval that contains it.

Concluding sentence

“The event 1≤X≤31\leq X\leq 3 corresponds to the area under ff between the vertical lines x=1x=1 and x=3x=3. This area splits into two rectangles: P(1≤X≤3)=1×0.10+1×0.25=0.35P(1\leq X\leq 3)=1\times 0.10+1\times 0.25=0.35.”

The trap: Answering with the height when the interval is narrow. A width of 0.010.01 does not exempt you from multiplying: f(21.0)×0.01=1.5958×0.01=0.0160f(21.0)\times 0.01=1.5958\times 0.01=0.0160, and it is this last number that is the probability.

Marking: 0.5 mark for the interval written down, 0.5 for the name of the figure, 1 mark for the area calculation.

Check before you hand in

Five minutes of checking recover more marks than one more problem started in a hurry.

The typical problem, taken apart

A linear density on a narrow support, from the constant to the centre of gravity

A workshop measures the EXCESS thickness XX, in millimetres, of a coat of paint. This excess never exceeds 0.50.5 mm, and the larger an excess, the more frequent it is: the density is therefore modelled by f(x)=kxf(x)=kx for 0≤x≤0.50\leq x\leq 0.5, and f(x)=0f(x)=0 elsewhere.

Find kk, comment on the value of f(0.5)f(0.5), write FF, then compute P(X≥0.3)P(X\geq 0.3), the median, the expected value, the variance, and finally P(X=0.3)P(X=0.3).

We take as given that the variance of a triangular density on [a,b][a, b] with peak cc is V(X)=a2+b2+c2−ab−ac−bc18V(X)=\dfrac{a^{2}+b^{2}+c^{2}-ab-ac-bc}{18}.

00.50.5kf(x) = kxx (mm)
The density is zero outside [0,0.5][0, 0.5] and rises in a straight line from the origin: the area under it is a triangle with base 0.50.5 and height f(0.5)=0.5kf(0.5)=0.5k.

Step 1

Two conditions. NONNEGATIVITY: on [0,0.5][0, 0.5], x≥0x\geq 0 so kx≥0kx\geq 0 as long as k>0k>0, and ff is zero elsewhere. AREA: the curve bounds a right triangle with base 0.50.5 and height 0.5k0.5k, of area 12×0.5×0.5k=0.125k\frac{1}{2}\times 0.5\times 0.5k=0.125k. Solve 0.125k=10.125k=1, so k=8k=8 and f(x)=8xf(x)=8x on [0,0.5][0, 0.5].

Why

The equation that gives the constant is ALWAYS the area equation, never a value of ff. Naming the triangle before computing earns half a mark for method and keeps you from confusing it with a trapezoid.

Step 2

f(0.5)=8×0.5=4f(0.5)=8\times 0.5=4, in reciprocal millimetres. The density exceeds 1, and yet the area is 12×0.5×4=1\frac{1}{2}\times 0.5\times 4=1.

Why

This is the check that reassures instead of worrying. The support is only half a millimetre long, so the probability PER millimetre is bound to be large: a tall height and an area equal to 1 do not contradict each other.

Step 3

F(x)=P(X≤x)F(x)=P(X\leq x) is the area of the triangle with base xx and height f(x)=8xf(x)=8x, namely F(x)=12×x×8x=4x2F(x)=\frac{1}{2}\times x\times 8x=4x^{2} on [0,0.5][0, 0.5], with F(x)=0F(x)=0 before 0 and F(x)=1F(x)=1 after 0.50.5. Check: F(0.5)=4×0.25=1F(0.5)=4\times 0.25=1.

Why

A cumulative distribution function that does not end at 1 is wrong, and this check takes two seconds. In particular it catches the factor 12\frac{1}{2} of the triangle, which is the most frequent omission at this step.

Step 4

P(X≥0.3)=1−F(0.3)=1−4×0.09=1−0.36=0.64P(X\geq 0.3)=1-F(0.3)=1-4\times 0.09=1-0.36=0.64.

0.10.20.30.40.50.6-0.50.511.522.533.544.55f(x) = 8x0.64f(0.5) = 4x (millimetres)f(x) (per millimetre)

Why

The complement saves a trapezoid and an error in the endpoints. The result is plausible: the density increases, so the right half of the support carries most of the probability.

Step 5

Median: F(m)=0.5F(m)=0.5, so 4m2=0.54m^{2}=0.5, so m2=0.125m^{2}=0.125 and m=0.125≈0.354m=\sqrt{0.125}\approx 0.354 mm.

Why

The median is read from FF and never from ff. Immediate check: it falls to the RIGHT of the midpoint 0.250.25, as an increasing density requires.

Step 6

Expected value: the area under ff is the triangle with vertices (0,0)(0, 0), (0.5,0)(0.5, 0) and (0.5,4)(0.5, 4). The xx-coordinate of its centre of gravity is the mean of the xx-coordinates of the three vertices, 0+0.5+0.53=13≈0.333\frac{0+0.5+0.5}{3}=\frac{1}{3}\approx 0.333 mm.

Why

No integral: the centre of gravity of a triangle is the mean of its three vertices, and that is exactly the geometric definition of the continuous expected value. One line replaces a calculation that this course does not ask for.

Step 7

Variance, with a=0a=0, b=0.5b=0.5 and a peak at c=0.5c=0.5: V(X)=0+0.25+0.25−0−0−0.2518=0.2518≈0.013889V(X)=\frac{0+0.25+0.25-0-0-0.25}{18}=\frac{0.25}{18}\approx 0.013889 and σ=0.013889≈0.1179\sigma=\sqrt{0.013889}\approx 0.1179 mm.

Why

The standard deviation must stay small compared with the width of the support, here 0.120.12 against 0.50.5. A standard deviation larger than the whole support would signal a formula error, not a very spread-out variable.

Step 8

P(X=0.3)=0P(X=0.3)=0, whereas f(0.3)=8×0.3=2.4f(0.3)=8\times 0.3=2.4. To get a nonzero number, you need a width: P(0.29≤X≤0.31)=f(0.29)+f(0.31)2×0.02=2.4×0.02=0.048P(0.29\leq X\leq 0.31)=\frac{f(0.29)+f(0.31)}{2}\times 0.02=2.4\times 0.02=0.048.

Why

This is the question that separates the papers. The two statements do not contradict each other: one is about an area of zero width, the other about a height. And here the trapezoid gives exactly F(0.31)−F(0.29)F(0.31)-F(0.29).

Step 9

Final check: E(X)≈0.333E(X)\approx 0.333, m≈0.354m\approx 0.354 and the mode is 0.50.5, so mean, then median, then mode. And F(0.5)=1F(0.5)=1.

Why

This order is the signature of a density skewed to the LEFT, which the sketch confirms. If it came out reversed, the error would be in the centre of gravity, not in the median, which has been checked on FF.

The conclusion, written out

The excess thickness has density f(x)=8xf(x)=8x on [0,0.5][0, 0.5] and cumulative distribution function F(x)=4x2F(x)=4x^{2}. Its median is 0.125≈0.354\sqrt{0.125}\approx 0.354 mm, its expected value 13≈0.333\frac{1}{3}\approx 0.333 mm and its standard deviation ≈0.118\approx 0.118 mm; 6464 percent of the parts exceed 0.30.3 mm of excess, and the probability of an excess EXACTLY equal to 0.30.3 mm is zero.

The classic mistake on this problem: Writing f(0.5)=1f(0.5)=1 “so that it comes to 1”, hence k=2k=2. Everything that follows stays consistent with itself, FF, the median and the expected value come out without any warning, and only the check F(0.5)=1F(0.5)=1 catches the mistake: it would give 0.250.25.

Learn by heart

  • • Two conditions, never one more: f(x)≥0f(x)\geq 0 EVERYWHERE, and total area equal to 1. It is the second one that gives the constant.
  • • A probability is an AREA and has no unit; a density is a HEIGHT and always has one. It can exceed 1.
  • • P(X=a)=0P(X=a)=0 for every value, so P(a≤X≤b)=P(a<X<b)P(a\leq X\leq b)=P(a<X<b). True for continuous, FALSE for discrete.
  • • F(x)=P(X≤x)F(x)=P(X\leq x) increases from 0 to 1 WITHOUT JUMPS; P(a≤X≤b)=F(b)−F(a)P(a\leq X\leq b)=F(b)-F(a) and the median solves F(m)=0.5F(m)=0.5.
  • • Uniform on [a,b][a, b]: f=1b−af=\frac{1}{b-a}, E=a+b2E=\frac{a+b}{2}, V=(b−a)212V=\frac{(b-a)^{2}}{12}. It AGES.
  • • Exponential: F(x)=1−e−λxF(x)=1-e^{-\lambda x}, P(X>x)=e−λxP(X>x)=e^{-\lambda x}, E=σ=1λE=\sigma=\frac{1}{\lambda}, median ln⁡2λ\frac{\ln 2}{\lambda}. It is MEMORYLESS.
  • • Normal: f(μ)=1σ2πf(\mu)=\frac{1}{\sigma\sqrt{2\pi}} exceeds 1 as soon as σ<0.399\sigma<0.399, and 68, 95 then 99.7 percent are the AREAS of the bands μ±σ\mu\pm\sigma, μ±2σ\mu\pm 2\sigma and μ±3σ\mu\pm 3\sigma.
  • • E(X)E(X) is the CENTRE OF GRAVITY of the area under ff; the peak of ff is the MODE, and the two coincide only for a symmetric density.

Frequently asked questions

Can a probability density exceed 1?

Yes, without any contradiction. What is capped at 1 is the total area under the curve, never the height. A uniform distribution on an interval of length 0.25 has a constant density equal to 4, and its area is indeed 0.25 times 4, which is 1. A density is a probability per unit: the more concentrated the variable, the taller it is.

Why is the probability of an exact value zero?

Because a probability is an area, and the area above a single point, of zero width, is zero. That does not make the value impossible: the variable does take a value, and each one has probability zero. It is the reason why strict and non-strict inequalities give the same result in the continuous case, whereas they differ in the discrete case.

How do you compute a continuous probability without integrals at CEGEP?

By computing a geometric area. A constant density gives a rectangle, a linear density a trapezoid or a difference of triangles, a step density a sum of rectangles. For the exponential distribution, the formula gives the answer directly, and for the normal distribution you read the table after computing the z-score. None of these moves requires integral calculus.

What is the difference between a density and a cumulative distribution function?

The density is a height, the cumulative distribution function an accumulated area. The cumulative distribution function at x is the probability that the variable is less than or equal to x: it starts at 0, rises without ever coming back down and ends at 1. The density has no reason to do that and can go up, go down or exceed 1. The median is read from the cumulative distribution function, never from the density.

What is the memoryless property of the exponential distribution?

It is the fact that a component already in service has exactly the same survival distribution as a new one. The probability of lasting five more years does not depend on the years already gone by: the failure rate is constant. The model suits an accidental electronic failure, but not a tire or a part that wears out, whose failure rate increases with age.

How do you read the 68, 95 and 99.7 percent of the normal distribution?

They are areas, not heights, and they are the same for every normal distribution because they are measured in standard deviations. The band extending one standard deviation on each side of the mean carries 68.27 percent of the probability, the band at two standard deviations 95.45 percent, the one at three 99.73 percent. The rest is shared equally between the two tails.

Practise it

Corrected exercises: Continuous random variables and density, 201-337

A method is proved on a paper, not on a sheet. The set for the same chapter takes each of these traps into a problem, with the solution written out step by step.

  • 11 corrected exercises
  • 110 points
  • 150 minutes
Do the exercises
Something missing from this sheet? A method, a trap, an exercise to practise it, a mistake you spotted: tell me, I read every request.

Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space. Rather not create an account? Write to me directly.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous sheet Probability and distributions Next sheet Estimation and hypothesis testing

© Ahmed Squalli Houssaini. Revision sheet published at www.letuteurscientifique.ca/en/fiches/cegep-337-continuous-random-variables. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a 201-337 tutor in Montreal?

Get in touch for a first session. Moving from discrete to continuous comes down to a single idea, probability becomes an area, and half an hour is often enough to make it click.

Site by Studio Squalli