Advanced Statistics 201-337 • CEGEP, Montreal

Corrected exercises: the continuous random variable and its density function (201-337)

This is the corrected exercise set on the continuous random variable and its probability density function for Advanced Statistics 201-337, the CEGEP probability and statistics course. The course covers probability distributions of discrete AND continuous variables: the discrete side is treated elsewhere in this course, and here we cross over to the other side. Part A sets up Kolmogorov's axioms, reading a density, the constant that normalizes it, the cumulative distribution function, then the uniform distribution and the exponential distribution. Part B takes up the normal distribution through its density, computes expected value and variance in the continuous case, corrects five statements, and ends with two problems on waiting time, lifetime and measurement error.

Exercise 0.1 opens the set with eleven direct calculations under a given density function, as in textbook drill lists: a probability under a step density, the constant of a uniform distribution and that of a linear density f(x)=kxf(x)=kx, areas of rectangles and triangles, the expected value and a quantile of a uniform distribution, then the exponential distribution with P(X>x)=e−λxP(X>x)=e^{-\lambda x}, its median and a quantile, each with a value to find that is checked as you type it.

This set is written for CEGEP students taking the probability and statistics course 201-337, in the Science program (Sciences de la nature) as well as in Social Science (Sciences humaines).

The common thread fits in one sentence: for a continuous variable, probability is no longer a height, it is an AREA. The density f(a)f(a) is not a probability and can perfectly well exceed 1, the total area equals 1, the probability of an interval is the area above that interval, and two shocking facts follow: P(X=a)=0P(X=a)=0 for every value aa, and strict and non-strict inequalities give the same result. A student who carries over the reflexes of the discrete case goes wrong on these three points, and every exercise asks the same question again: which area are we computing?

No integral calculus is needed here: every area asked for is a rectangle, a triangle or a trapezoid, except those of the normal distribution, which are read from the table, and those of the exponential distribution, which the formula F(x)=1−e−λxF(x)=1-e^{-\lambda x} gives directly.

11 corrected exercises • 110 points • 150 minutes

This chapter is part of 201-337, every chapter with its set and sheet Before you start Revision sheet: the traps and the method for this chapter

Self-checking set Type your answers and check them question by question: the page tells you right or wrong before you open the solution. With an account, every answer right on the first try earns points, and your right answers stay filled in when you come back.

Course recap

  • • KOLMOGOROV'S AXIOMS: for every event AA, P(A)≥0P(A)\geq 0; P(Ω)=1P(\Omega)=1; and if AA and BB are mutually exclusive, P(A∪B)=P(A)+P(B)P(A\cup B)=P(A)+P(B). Everything else follows from them, including P(A‾)=1−P(A)P\left(\overline{A}\right)=1-P(A).
  • • DENSITY: a function ff is a probability density function if f(x)≥0f(x)\geq 0 everywhere and the total area under its curve equals 1. These are the only two conditions, and the second one is the axiom P(Ω)=1P(\Omega)=1 translated into an area.
  • • PROBABILITY IS AN AREA: P(a≤X≤b)P(a\leq X\leq b) is the area between the curve of ff, 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, and it can exceed 1.
  • • 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): strict or non-strict, same result, which is FALSE in the discrete case.
  • • CUMULATIVE DISTRIBUTION FUNCTION: F(x)=P(X≤x)F(x)=P(X\leq x) is the area accumulated up to xx. It increases from 0 to 1, it is continuous, 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.
  • • EXPECTED VALUE AND VARIANCE: these are the same weighted means as in the discrete case, with the density replacing the point probabilities. Geometrically, E(X)E(X) is the xx-COORDINATE OF THE CENTRE OF GRAVITY of the area under the curve.
  • • UNIFORM DISTRIBUTION on [a,b][a, b]: f(x)=1b−af(x)=\dfrac{1}{b-a}, 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 DISTRIBUTION with parameter λ\lambda: f(x)=λe−λxf(x)=\lambda e^{-\lambda x} for x≥0x\geq 0, F(x)=1−e−λxF(x)=1-e^{-\lambda x}, P(X>x)=e−λxP(X>x)=e^{-\lambda x}, E(X)=σ=1λE(X)=\sigma=\dfrac{1}{\lambda} and median ln⁡2λ\dfrac{\ln 2}{\lambda}.
  • • MEMORYLESS PROPERTY: P(X>s+t∣X>s)=P(X>t)P(X>s+t\mid X>s)=P(X>t). The exponential is the only continuous distribution that has it, and it says that the object DOES NOT AGE.
  • • THE NORMAL DISTRIBUTION seen as a density: its maximum height is f(μ)=1σ2πf(\mu)=\dfrac{1}{\sigma\sqrt{2\pi}}, so it exceeds 1 as soon as σ<0.399\sigma<0.399. The 68, 95 and 99.7 percent benchmarks are AREAS, those 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 change: that is why a single table is enough for every normal distribution.

Calculations: areas, constants and quantiles to compute

Exercise 0.1: Computing a probability under a given density: eleven direct calculations

For each line, compute the probability, the constant or the value asked for the given continuous distribution, without any integral: every area is a rectangle or a triangle, and an exponential distribution with parameter λ\lambda is handled with P(X>x)=e−λxP(X>x)=e^{-\lambda x}, hence P(X≤x)=1−e−λxP(X\leq x)=1-e^{-\lambda x}. Give the exact value when it comes out evenly, otherwise give probabilities to four decimal places and the median and quantile to two decimal places.

The move is always the same: sketch the density, shade the interval asked for and compute the shaded area, base times height for a rectangle, half the base times the height for a triangle. An unknown constant is found by writing that the TOTAL area equals 1. A quantile is found backwards: write that the area to the left of tt equals the required proportion, then isolate tt, using the natural logarithm if needed.

  • a) f(x)=0.2f(x)=0.2 on [0,3)[0, 3), f(x)=0.1f(x)=0.1 on [3,7][3, 7] and f(x)=0f(x)=0 elsewhere: compute P(2≤X≤5)P(2\leq X\leq 5).
  • b) Uniform distribution on [2,10][2, 10]: compute the constant cc of its density.
  • c) Uniform distribution on [4,20][4, 20]: compute P(X≤7)P(X\leq 7).
  • d) f(x)=kxf(x)=kx on [0,5][0, 5] and f(x)=0f(x)=0 elsewhere: compute the constant kk.
  • e) f(x)=0.08xf(x)=0.08x on [0,5][0, 5] and f(x)=0f(x)=0 elsewhere: compute P(X≤3)P(X\leq 3).
  • f) Uniform distribution on [3,15][3, 15]: compute the expected value E(X)E(X).
  • g) Uniform distribution on [5,25][5, 25]: find tt such that P(X≤t)=0.3P(X\leq t)=0.3.
  • h) Exponential distribution with parameter λ=0.4\lambda=0.4: compute P(X>3)P(X>3).
  • i) Exponential distribution with mean 2: compute P(1≤X≤4)P(1\leq X\leq 4).
  • j) Exponential distribution with mean 8: compute the median mm.
  • k) Exponential distribution with parameter λ=0.3\lambda=0.3: find tt such that P(X≤t)=0.75P(X\leq t)=0.75.

Type your answers, the page tells you right or wrong 0/11

a)
b)
c)
d)
e)
f)
g)
h)
i)
j)
k)
Show the solution

Answers

  • a) 1×0.2+2×0.1=0.41\times 0.2+2\times 0.1=0.4
  • b) c=18=0.125c=\frac{1}{8}=0.125
  • c) P(X≤7)=316=0.1875P(X\leq 7)=\frac{3}{16}=0.1875
  • d) 12.5k=112.5k=1; k=0.08k=0.08
  • e) 12×3×0.24=0.36\frac{1}{2}\times 3\times 0.24=0.36
  • f) E(X)=3+152=9E(X)=\frac{3+15}{2}=9
  • g) t−520=0.3\frac{t-5}{20}=0.3; t=11t=11
  • h) P(X>3)=e−1.2≈0.3012P(X>3)=e^{-1.2}\approx 0.3012
  • i) e−0.5−e−2≈0.4712e^{-0.5}-e^{-2}\approx 0.4712
  • j) m=8ln⁡2≈5.55m=8\ln 2\approx 5.55
  • k) t=ln⁡40.3≈4.62t=\frac{\ln 4}{0.3}\approx 4.62

The move that decides everything: a probability is an AREA, never a height. Reading f(3)f(3) off the curve gives nothing; you need a width and a height, or the formula e−λxe^{-\lambda x}, which has already done the area calculation.

a)

The interval [2,5][2, 5] straddles the two steps. From 2 to 3: 1×0.2=0.21\times 0.2=0.2. From 3 to 5: 2×0.1=0.22\times 0.1=0.2. So P(2≤X≤5)=0.4P(2\leq X\leq 5)=0.4. Pitfall: using a single height for the whole width of 3.

b)

A rectangle of width 10−2=810-2=8 and height cc: 8c=18c=1, so c=18=0.125c=\frac{1}{8}=0.125. Pitfall: dividing by the endpoint 1010 instead of the width 88.

c)

c=116c=\frac{1}{16} and the relevant width is 7−4=37-4=3: P(X≤7)=316=0.1875P(X\leq 7)=\frac{3}{16}=0.1875. Pitfall: taking the width 77, as if the support started at 0, which gives 716\frac{7}{16}.

d)

The area under ff is a triangle with base 5 and height f(5)=5kf(5)=5k: 12×5×5k=12.5k=1\frac{1}{2}\times 5\times 5k=12.5k=1, so k=112.5=0.08k=\frac{1}{12.5}=0.08. Pitfall: forgetting the 12\frac{1}{2} of the triangle, which gives k=0.04k=0.04.

e)

A triangle with base 3 and height f(3)=0.24f(3)=0.24: P(X≤3)=12×3×0.24=0.36P(X\leq 3)=\frac{1}{2}\times 3\times 0.24=0.36. Pitfall: answering f(3)=0.24f(3)=0.24, the height instead of the area.

f)

The density is symmetric about the midpoint of the support: E(X)=3+152=9E(X)=\frac{3+15}{2}=9.

g)

Density 120\frac{1}{20} on [5,25][5, 25]. We want t−520=0.3\frac{t-5}{20}=0.3, so t−5=6t-5=6 and t=11t=11. Pitfall: writing 0.3×20=60.3\times 20=6 and forgetting that the support starts at 5.

h)

P(X>3)=e−0.4×3=e−1.2≈0.3012P(X>3)=e^{-0.4\times 3}=e^{-1.2}\approx 0.3012. Pitfall: computing 1−e−1.2=0.69881-e^{-1.2}=0.6988, which is P(X≤3)P(X\leq 3).

i)

Mean 2, so λ=12=0.5\lambda=\frac{1}{2}=0.5. P(1≤X≤4)=P(X>1)−P(X>4)=e−0.5−e−2=0.606531−0.135335≈0.4712P(1\leq X\leq 4)=P(X>1)-P(X>4)=e^{-0.5}-e^{-2}=0.606531-0.135335\approx 0.4712. Pitfall: taking λ=2\lambda=2, the mean itself, which gives e−2−e−8≈0.1350e^{-2}-e^{-8}\approx 0.1350.

j)

λ=18\lambda=\frac{1}{8}. The median satisfies P(X>m)=0.5P(X>m)=0.5, that is e−m/8=0.5e^{-m/8}=0.5, so −m8=ln⁡0.5-\frac{m}{8}=\ln 0.5 and m=8ln⁡2≈5.55m=8\ln 2\approx 5.55. Pitfall: answering with the mean, 88; the median of an exponential is smaller than its mean.

k)

P(X≤t)=0.75P(X\leq t)=0.75 means P(X>t)=0.25P(X>t)=0.25, that is e−0.3t=0.25e^{-0.3t}=0.25. So −0.3t=ln⁡0.25-0.3t=\ln 0.25 and t=ln⁡40.3≈4.62t=\frac{\ln 4}{0.3}\approx 4.62. Pitfall: writing e−0.3t=0.75e^{-0.3t}=0.75, which gives the quantile of order 0.250.25, about 0.960.96.

Check: a probability stays between 0 and 1, a shaded area larger than half the sketch is worth more than 0.50.5, and a quantile is checked by substituting it back: in k), 1−e−0.3×4.62≈0.7501-e^{-0.3\times 4.62}\approx 0.750.

Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.

Part A: the basics (/50)

Exercise 1: Probability is no longer a height, it is an area

The duration XX, in hours, of a network outage at a CEGEP is a CONTINUOUS random variable: between any two values there is always a third, and the list of outcomes cannot be written down. So we can no longer attach a probability table to it, as we would to a die.

It is described by a DENSITY function ff, piecewise constant here: f(x)=0.10f(x)=0.10 for 0≤x<20\leq x<2, f(x)=0.25f(x)=0.25 for 2≤x<42\leq x<4, f(x)=0.15f(x)=0.15 for 4≤x≤64\leq x\leq 6, and f(x)=0f(x)=0 elsewhere. The figure shows it, with the shaded region corresponding to the interval [1,3][1, 3].

The rule of the chapter fits in one line: a probability is the AREA under the curve of ff above the interval considered.

123456-0.050.050.10.150.20.250.30.100.250.15x (hours)f(x) (per hour)
  • a) Check that ff is indeed a probability density function by verifying the two required conditions. Give the area of each of the three rectangles.
  • b) Compute P(1≤X≤3)P(1\leq X\leq 3), the probability that the outage lasts between one and three hours.
  • c) Compute P(X=2)P(X=2), then P(1<X<3)P(1<X<3). Compare with b) and explain.
  • d) Compute P(X>4)P(X>4) and P(X≤2)P(X\leq 2).
  • e) State Kolmogorov's three axioms and say which one requires the total area to equal 1. Does the result of c) contradict any of them?

Type your answers, the page tells you right or wrong 0/10

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) Nonnegativity checked, and 0.20+0.50+0.30=1.000.20+0.50+0.30=1.00: ff is indeed a density.
  • b) P(1≤X≤3)=0.10+0.25=0.35P(1\leq X\leq 3)=0.10+0.25=0.35.
  • c) P(X=2)=0P(X=2)=0 and P(1<X<3)=0.35P(1<X<3)=0.35, identical to b): strict or non-strict changes nothing.
  • d) P(X>4)=0.30P(X>4)=0.30 and P(X≤2)=0.20P(X\leq 2)=0.20.
  • e) Nonnegativity, P(Ω)=1P(\Omega)=1, additivity of mutually exclusive events. The second one gives the area 1, and c) contradicts nothing: probability zero is not impossibility.
a)

Two conditions, and not one more. NONNEGATIVITY: ff only takes the values 0.100.10, 0.250.25, 0.150.15 and 00, all positive or zero. TOTAL AREA EQUAL TO 1: the curve bounds three rectangles, all of width 2. The first has area 2×0.10=0.202\times 0.10=0.20, the second 2×0.25=0.502\times 0.25=0.50, the third 2×0.15=0.302\times 0.15=0.30. The sum is 0.20+0.50+0.30=1.000.20+0.50+0.30=1.00, so ff is a density. Note in passing that 0.200.20, 0.500.50 and 0.300.30 are the probabilities that the outage falls in each of the three two-hour slices: the long outage, between 2 h and 4 h, is the most frequent. The pitfall here is to add up the HEIGHTS, 0.10+0.25+0.15=0.500.10+0.25+0.15=0.50, and conclude that something is wrong. Heights never add up: they are probabilities PER HOUR, and only multiplying them by a width gives a probability.

b)

The interval [1,3][1, 3] straddles two steps. Split it: from 1 to 2, the height is 0.100.10 and the width 1, so the area is 1×0.10=0.101\times 0.10=0.10; from 2 to 3, the height is 0.250.25 and the width 1, so the area is 1×0.25=0.251\times 0.25=0.25. In total P(1≤X≤3)=0.10+0.25=0.35P(1\leq X\leq 3)=0.10+0.25=0.35. Roughly one outage in three lasts between one and three hours. The check is immediate: 0.350.35 lies between 0 and 1, and it is smaller than P(0≤X≤4)=0.70P(0\leq X\leq 4)=0.70, which is consistent since [1,3][1, 3] is contained in [0,4][0, 4].

c)

P(X=2)=0P(X=2)=0. The event “the outage lasts exactly two hours, to the billionth of a second” corresponds to a segment of ZERO width under the curve: its area is zero, whatever the height of the curve at that point. Going from [1,3][1, 3] to (1,3)(1, 3) amounts to removing the two values 1 and 3, so two zero areas: P(1<X<3)=0.35−0−0=0.35P(1<X<3)=0.35-0-0=0.35, exactly as in b). This is the second surprise of the chapter: strict or non-strict, the result is the same for a continuous variable. In the discrete case this is false, and the gap P(X≤3)−P(X<3)P(X\leq 3)-P(X<3) is precisely P(X=3)P(X=3), which is not zero.

d)

P(X>4)P(X>4) is the area of the third rectangle alone: 2×0.15=0.302\times 0.15=0.30. P(X≤2)P(X\leq 2) is the area of the first: 2×0.10=0.202\times 0.10=0.20. Check with the complement: P(X≤4)=0.20+0.50=0.70P(X\leq 4)=0.20+0.50=0.70 and 1−0.70=0.301-0.70=0.30, which gives P(X>4)P(X>4) back. And since P(X=4)=0P(X=4)=0, writing P(X≥4)P(X\geq 4) or P(X>4)P(X>4) changes nothing.

e)

Kolmogorov's three axioms, on which the whole theory rests. FIRST, nonnegativity: for every event AA, P(A)≥0P(A)\geq 0. SECOND, normalization: P(Ω)=1P(\Omega)=1, the whole sample space is certain. THIRD, additivity: if AA and BB are mutually exclusive, P(A∪B)=P(A)+P(B)P(A\cup B)=P(A)+P(B), and this extends to a sequence of pairwise mutually exclusive events. It is the SECOND that requires the total area to equal 1: the area under the density represents P(Ω)P(\Omega), since the outage necessarily lasts some amount of time. The result of c) contradicts no axiom. An event of probability zero is not an impossible event: the outage does take a value, and each of those values has probability zero. That is the price of moving to the continuous case, and it is exactly what countable additivity allows, since the values of an interval do not form a sequence.

Exercise 2: The two conditions of a density, and the constant that normalizes it

An ultrasonic inspection looks for the most serious flaw in a 4-metre steel bar. Let XX be its position, in metres, measured from the left end. Flaws become more frequent the farther you move from that end, and this is modelled by a density PROPORTIONAL to the distance: f(x)=kxf(x)=kx for 0≤x≤40\leq x\leq 4, and f(x)=0f(x)=0 elsewhere.

The constant kk is not free: it is the total-area condition that fixes it.

The figure below shows the situation.

4 m bar01234f(4) = 4kf(x) = kxx (m)
  • a) Find the value of kk, then write ff.
  • b) Compute f(2)f(2) and f(4)f(4). Check the nonnegativity condition.
  • c) Compute P(X≤2)P(X\leq 2) and P(2≤X≤4)P(2\leq X\leq 4). What must these two numbers satisfy?
  • d) Compute P(1≤X≤3)P(1\leq X\leq 3) as the area of a trapezoid, then check it as a difference of triangles.
  • e) Can a density exceed 1? Answer by giving the density of the uniform distribution on [0,0.25][0, 0.25], and say what is capped at 1 in a continuous model.

Type your answers, the page tells you right or wrong 0/9

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 8k=18k=1, so k=0.125k=0.125 and f(x)=x8f(x)=\dfrac{x}{8} on [0,4][0, 4].
  • b) f(2)=0.25f(2)=0.25 and f(4)=0.50f(4)=0.50, both nonnegative: the condition holds.
  • c) P(X≤2)=0.25P(X\leq 2)=0.25 and P(2≤X≤4)=0.75P(2\leq X\leq 4)=0.75, adding up to 1.
  • d) P(1≤X≤3)=0.50P(1\leq X\leq 3)=0.50, with the trapezoid as well as with the difference of triangles.
  • e) Yes: the uniform distribution on [0,0.25][0, 0.25] has a density of 4. It is the AREA that is capped at 1, never the height.
a)

The graph of ff is the segment joining the origin to the point (4,4k)(4, 4k). The area under this graph, between 0 and 4, is that of a right TRIANGLE with base 4 and height 4k4k, namely 12×4×4k=8k\frac{1}{2}\times 4\times 4k=8k. The total-area condition requires 8k=18k=1, so k=18=0.125k=\frac{1}{8}=0.125 and f(x)=x8f(x)=\frac{x}{8} on [0,4][0, 4], zero elsewhere. No integration is needed: the density is linear, so the area is that of a triangle. The classic pitfall is to write f(4)=1f(4)=1 “so that it adds up to 1”: it is the AREA that equals 1, never the height at the end.

b)

f(2)=28=0.25f(2)=\frac{2}{8}=0.25 and f(4)=48=0.50f(4)=\frac{4}{8}=0.50. On [0,4][0, 4], xx is nonnegative so x8\frac{x}{8} is too, and ff is zero elsewhere: nonnegativity holds everywhere. Both conditions are therefore met, and ff is a density. Be careful about what these numbers say: f(4)=0.50f(4)=0.50 is not a 50 percent probability of finding the flaw at the end of the bar, it is a probability PER METRE near 4 m. Over one centimetre around 4 m, the probability is about 0.50×0.01=0.0050.50\times 0.01=0.005.

c)

P(X≤2)P(X\leq 2) is the area of the triangle with base 2 and height f(2)=0.25f(2)=0.25, namely 12×2×0.25=0.25\frac{1}{2}\times 2\times 0.25=0.25. P(2≤X≤4)P(2\leq X\leq 4) is the area of the trapezoid of width 2 with parallel sides f(2)=0.25f(2)=0.25 and f(4)=0.50f(4)=0.50, namely 0.25+0.502×2=0.75\frac{0.25+0.50}{2}\times 2=0.75. These two numbers must add up to 1, since the two intervals are mutually exclusive and cover the whole support: 0.25+0.75=1.000.25+0.75=1.00, and the check passes. The result reads clearly: three flaws out of four are in the right half of the bar, which is what the model was meant to say.

d)

With the trapezoid: parallel sides f(1)=0.125f(1)=0.125 and f(3)=0.375f(3)=0.375, width 2, so 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. As a difference of triangles: the area up to 3 is 12×3×0.375=0.5625\frac{1}{2}\times 3\times 0.375=0.5625, the area up to 1 is 12×1×0.125=0.0625\frac{1}{2}\times 1\times 0.125=0.0625, and 0.5625−0.0625=0.500.5625-0.0625=0.50. The two methods agree, as they should: a trapezoid is a difference of two similar triangles. A striking result: the interval [1,3][1, 3] covers only half the bar, and yet it carries exactly half the probability.

e)

Yes, without the slightest difficulty. The uniform distribution on [0,0.25][0, 0.25] has a constant density f(x)=10.25=4f(x)=\frac{1}{0.25}=4, four times greater than 1, and yet its area is 0.25×4=10.25\times 4=1. What is capped at 1 is the AREA, never the height: a density is a probability per unit, and if the unit is small, the density is large. The same thing happens in physics, where a density in kilograms per cubic metre is not a mass. Here ff stays below 1 because the bar is long; if it were 1 metre long with the same shape, we would have f(x)=2xf(x)=2x and f(1)=2f(1)=2, with an area still equal to 12×1×2=1\frac{1}{2}\times 1\times 2=1. Confusing height with probability costs marks on every question of the chapter, and it is the error that then leads students to write P(X=a)=f(a)P(X=a)=f(a).

0.511.522.533.54-0.10.10.20.30.40.50.6f(x) = x/8area = 1x (metres)f(x) (per metre)

Exercise 3: The cumulative distribution function, and the median it gives

We keep the steel bar of exercise 2 and its density f(x)=x8f(x)=\dfrac{x}{8} on [0,4][0, 4].

The CUMULATIVE DISTRIBUTION FUNCTION is the function FF defined by F(x)=P(X≤x)F(x)=P(X\leq x): it is the area accumulated under the density from the left up to the value xx. It answers every probability question of the chapter in one go.

The figure below shows the situation.

0.511.522.533.544.50.10.20.30.40.50.6f(x) = x/8x (metres)
  • a) Show, using the area of a triangle, that F(x)=x216F(x)=\dfrac{x^{2}}{16} for 0≤x≤40\leq x\leq 4. Give F(2)F(2) and F(4)F(4), and the expression of FF outside [0,4][0, 4].
  • b) Compute P(X≤1.5)P(X\leq 1.5), P(X>1.5)P(X>1.5) and P(0.5≤X≤1.5)P(0.5\leq X\leq 1.5) using FF.
  • c) Find the median mm of XX, as an exact value and then to two decimal places.
  • d) Find the first and third quartiles.
  • e) State three properties of FF, then explain how the cumulative distribution function of a DISCRETE variable differs from this one, and why that difference alone explains that P(X=a)=0P(X=a)=0 here.

Type your answers, the page tells you right or wrong 0/10

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) F(x)=x216F(x)=\dfrac{x^{2}}{16} on [0,4][0, 4], with F(2)=0.25F(2)=0.25 and F(4)=1F(4)=1; F=0F=0 before 0 and F=1F=1 after 4.
  • b) 0.14060.1406, 0.85940.8594 and 0.1250.125.
  • c) m=8=22≈2.83m=\sqrt{8}=2\sqrt{2}\approx 2.83, to the right of the midpoint of the bar.
  • d) Q1=2Q_{1}=2 and Q3=23≈3.46Q_{3}=2\sqrt{3}\approx 3.46.
  • e) Increasing, from 0 to 1, and P(a≤X≤b)=F(b)−F(a)P(a\leq X\leq b)=F(b)-F(a). In the discrete case it is a step function and the jump at aa equals P(X=a)P(X=a); here it is continuous, so P(X=a)=0P(X=a)=0.
a)

For xx between 0 and 4, the accumulated area is that of the right triangle with base xx and height f(x)=x8f(x)=\frac{x}{8}, namely F(x)=12×x×x8=x216F(x)=\frac{1}{2}\times x\times\frac{x}{8}=\frac{x^{2}}{16}. No integration: a triangle is enough. We get F(2)=416=0.25F(2)=\frac{4}{16}=0.25 and F(4)=1616=1F(4)=\frac{16}{16}=1, which is the mandatory check: the cumulative distribution function must reach 1 at the end of the support. Outside, F(x)=0F(x)=0 for x<0x<0, since no area has been accumulated yet, and F(x)=1F(x)=1 for x>4x>4, since all of it has. Compare with part c) of exercise 2: F(2)=0.25F(2)=0.25 indeed gives P(X≤2)P(X\leq 2) back.

b)

P(X≤1.5)=F(1.5)=2.2516=0.140625P(X\leq 1.5)=F(1.5)=\frac{2.25}{16}=0.140625, about 0.14060.1406. The complement gives P(X>1.5)=1−0.140625=0.859375P(X>1.5)=1-0.140625=0.859375, about 0.85940.8594. Finally P(0.5≤X≤1.5)=F(1.5)−F(0.5)=0.140625−0.2516=0.140625−0.015625=0.125P(0.5\leq X\leq 1.5)=F(1.5)-F(0.5)=0.140625-\frac{0.25}{16}=0.140625-0.015625=0.125. Exactly one eighth. That is the whole point of FF: a subtraction replaces cutting the region into trapezoids, and you can no longer pick the wrong figure. A check with the trapezoid, just for fun: parallel sides f(0.5)=0.0625f(0.5)=0.0625 and f(1.5)=0.1875f(1.5)=0.1875, width 1, area 0.0625+0.18752=0.125\frac{0.0625+0.1875}{2}=0.125. The two routes agree.

c)

The median splits the area into two equal parts, so it solves F(m)=0.5F(m)=0.5, that is m216=0.5\frac{m^{2}}{16}=0.5, so m2=8m^{2}=8 and m=8=22≈2.83m=\sqrt{8}=2\sqrt{2}\approx 2.83. The negative root is rejected, since it lies outside the support [0,4][0, 4]. A common-sense check: the density increases, so the right half of the bar is more heavily loaded than the left, and the median must fall to the RIGHT of the midpoint 2, which it does.

d)

Same method. First quartile: q1216=0.25\frac{q_{1}^{2}}{16}=0.25, so q12=4q_{1}^{2}=4 and q1=2q_{1}=2. Third quartile: q3216=0.75\frac{q_{3}^{2}}{16}=0.75, so q32=12q_{3}^{2}=12 and q3=23≈3.46q_{3}=2\sqrt{3}\approx 3.46. The three numbers 22, 2.832.83 and 3.463.46 cut the bar into four zones of equal probability, of widths 22, 0.830.83, 0.630.63 and 0.540.54: the zones get narrower towards the right, since the density is higher there. The interquartile range is 3.46−2=1.463.46-2=1.46.

e)

Three properties of FF: it is INCREASING, since area keeps being added; it goes from 0 to 1, F(−∞)=0F(-\infty)=0 and F(+∞)=1F(+\infty)=1; and it satisfies P(a≤X≤b)=F(b)−F(a)P(a\leq X\leq b)=F(b)-F(a). Add a fourth, the decisive one: here FF is CONTINUOUS, without any jump. In the discrete case, on the contrary, FF is a STEP function, and the height of the jump at aa is exactly P(X=a)P(X=a): for a fair die, FF jumps by 16\frac{1}{6} at each integer from 1 to 6. That is the complete explanation of P(X=a)=0P(X=a)=0: the probability of an isolated value is the height of the jump of FF at that value, and a continuous function does not jump. The two worlds part ways right there, and nowhere else.

-112345-0.20.20.40.60.811.2medianF(x)x (metres)

Exercise 4: The continuous uniform distribution, and why it ages

A bus comes by a stop on the boulevard exactly every 12 minutes. A rider arrives without checking the schedule, at an arbitrary moment. Her waiting time XX, in minutes, then follows the UNIFORM distribution on [0,12][0, 12]: its density is CONSTANT on this interval, and zero elsewhere.

The figure shows this density, with the shaded region corresponding to the interval [3,7][3, 7].

123456789101112-0.050.050.10.15x (minutes)f(x) (per minute)
  • a) What value must this constant take for the total area to equal 1? Give it to four decimal places.
  • b) Compute P(X≤5)P(X\leq 5) and P(3≤X≤7)P(3\leq X\leq 7).
  • c) Compute E(X)E(X), V(X)V(X) and the standard deviation of XX.
  • d) The rider has already been waiting for 6 minutes. Compute P(X≥9∣X≥6)P(X\geq 9\mid X\geq 6), then compare with P(X≥3)P(X\geq 3). What do you conclude?
  • e) A student writes: “the probability of waiting exactly 5 minutes is 112\frac{1}{12}”. Correct this, then give the density of a uniform distribution on [0,0.5][0, 0.5].

Type your answers, the page tells you right or wrong 0/11

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) c=112≈0.0833c=\dfrac{1}{12}\approx 0.0833 per minute.
  • b) P(X≤5)=512≈0.4167P(X\leq 5)=\dfrac{5}{12}\approx 0.4167 and P(3≤X≤7)=13≈0.3333P(3\leq X\leq 7)=\dfrac{1}{3}\approx 0.3333.
  • c) E(X)=6E(X)=6 min, V(X)=12V(X)=12 and σ=23≈3.46\sigma=2\sqrt{3}\approx 3.46 min.
  • d) 0.500.50 versus 0.750.75: the two differ, the uniform distribution ages.
  • e) P(X=5)=0P(X=5)=0, because 112\frac{1}{12} is a density and not a probability; on [0,0.5][0, 0.5] the density equals 2.
a)

The area under a constant density cc on [0,12][0, 12] is that of a RECTANGLE of width 12 and height cc, namely 12c12c. The condition 12c=112c=1 gives c=112≈0.0833c=\frac{1}{12}\approx 0.0833. The general formula follows: on [a,b][a, b], the uniform density equals 1b−a\frac{1}{b-a}. Note that this number has a unit, reciprocal minutes, and that is precisely what forbids reading it as a probability.

b)

Everything is read as a ratio of lengths, since the height is the same everywhere. P(X≤5)P(X\leq 5) is the area of the rectangle of width 5, namely 5×112=512≈0.41675\times\frac{1}{12}=\frac{5}{12}\approx 0.4167. P(3≤X≤7)P(3\leq X\leq 7) is the area of the rectangle of width 7−3=47-3=4, namely 412=13≈0.3333\frac{4}{12}=\frac{1}{3}\approx 0.3333. Check: the interval [3,7][3, 7] takes up one third of [0,12][0, 12], and the probability is indeed one third. For a uniform distribution, a probability is nothing more than the proportion of the length covered, and it is the only distribution in the chapter where this is true.

c)

The density is symmetric about the midpoint, so E(X)=0+122=6E(X)=\frac{0+12}{2}=6 minutes: on average, the rider waits six minutes, half the interval between two buses. The variance of a uniform distribution on [a,b][a, b] is (b−a)212\frac{(b-a)^{2}}{12}, here 14412=12\frac{144}{12}=12, and the standard deviation is 12=23≈3.46\sqrt{12}=2\sqrt{3}\approx 3.46 minutes. The plausibility check passes: a standard deviation of 3.46 minutes over an interval of 12 minutes means a large spread, which is what we expect from a distribution in which all waiting times are equally likely. Beware of the 12 in the denominator, which here has nothing to do with the 12 minutes: the formula would read (b−a)212\frac{(b-a)^{2}}{12} even on an interval of 5 units.

d)

Conditioning is read in areas, like everything else: P(X≥9∣X≥6)=P(9≤X≤12)P(6≤X≤12)=3/126/12=36=0.50P(X\geq 9\mid X\geq 6)=\frac{P(9\leq X\leq 12)}{P(6\leq X\leq 12)}=\frac{3/12}{6/12}=\frac{3}{6}=0.50. Compare with the probability of waiting at least 3 minutes from the moment of arrival, P(X≥3)=912=0.75P(X\geq 3)=\frac{9}{12}=0.75. The two numbers DIFFER, and that is the whole point of the question: the waiting time already spent changes what follows. Here it improves things, since 0.50<0.750.50<0.75: the probability of waiting three more minutes has gone down. In other words, the uniform model AGES: the longer you have waited, the closer the bus is. This matches intuition, and it is exactly what is about to break down in the next exercise.

e)

The sentence confuses height and area. 112\frac{1}{12} is the DENSITY, a probability per minute; the probability of waiting exactly 5 minutes is P(X=5)=0P(X=5)=0, because the corresponding segment has zero width. What 112\frac{1}{12} measures is, for example, P(4.5≤X≤5.5)=1×112≈0.0833P(4.5\leq X\leq 5.5)=1\times\frac{1}{12}\approx 0.0833, the probability of a wait within a one-minute window around 5. On [0,0.5][0, 0.5], the uniform density equals 10.5=2\frac{1}{0.5}=2, greater than 1 without any contradiction: the area is 0.5×2=10.5\times 2=1. That would happen if the bus came every thirty seconds, and the density would double again if the interval were fifteen seconds. Writing P(X=5)=112P(X=5)=\frac{1}{12} costs the whole question and, worse, leads to the same mistake with the normal distribution, where students then start reading probabilities off the height of the bell curve.

Exercise 5: The exponential distribution, and the result that shocks

The lifetime XX, in years, of an LED light bulb follows an EXPONENTIAL distribution with mean 5 years, hence with parameter λ=15=0.2\lambda=\dfrac{1}{5}=0.2 per year.

Its density is f(x)=λe−λxf(x)=\lambda e^{-\lambda x} for x≥0x\geq 0, zero for x<0x<0, and its cumulative distribution function is F(x)=1−e−λxF(x)=1-e^{-\lambda x}. We take these two expressions as given: the second one is read directly, with no area to cut up.

The figure shows the density, with the shaded region corresponding to the interval [3,8][3, 8].

2468101214161820-0.040.040.080.120.160.20.24x (years)f(x) (per year)
  • a) Compute f(0)f(0). What is the total area under the curve, and how can you see it on FF?
  • b) Compute P(X≤3)P(X\leq 3), P(X>8)P(X>8) and P(3≤X≤8)P(3\leq X\leq 8), to four decimal places.
  • c) Give E(X)E(X) and the standard deviation of XX, then compute the median. Compare the median and the mean and interpret.
  • d) Compute P(X>8∣X>3)P(X>8\mid X>3), then compare with P(X>5)P(X>5). Name the property you obtain.
  • e) Contrast this result with that of part d) of exercise 4, then say for which kind of equipment the exponential distribution is a good model, and for which kind it is a poor model.

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) f(0)=0.2f(0)=0.2 per year, and the total area equals 1 because F(x)=1−e−0.2xF(x)=1-e^{-0.2x} tends to 1.
  • b) 0.45120.4512, 0.20190.2019 and 0.34690.3469, adding up to 1.
  • c) E(X)=σ=5E(X)=\sigma=5 years and median ln⁡20.2≈3.47\dfrac{\ln 2}{0.2}\approx 3.47 years: the median is well below the mean, the distribution is skewed to the right.
  • d) P(X>8∣X>3)=e−1=0.3679=P(X>5)P(X>8\mid X>3)=e^{-1}=0.3679=P(X>5): this is the memoryless property.
  • e) The uniform distribution ages, the exponential does not. Good for a random electronic failure or a radioactive decay, poor for a tire or any part that wears out.
a)

f(0)=0.2×e0=0.2f(0)=0.2\times e^{0}=0.2: the density starts at 0.20.2 and then decreases towards zero without ever reaching it. The total area equals 1, as for any density, and FF says so without any calculation: F(x)=1−e−0.2xF(x)=1-e^{-0.2x} tends to 1−0=11-0=1 as xx grows, since e−0.2xe^{-0.2x} tends to 0. The support is unbounded, the curve stretches out indefinitely to the right, and yet the area stays finite and equals exactly 1: this is the same as saying P(X>x)=e−0.2xP(X>x)=e^{-0.2x}, a tail that thins out fast enough for the total to converge.

b)

P(X≤3)=F(3)=1−e−0.6=1−0.548812=0.451188P(X\leq 3)=F(3)=1-e^{-0.6}=1-0.548812=0.451188, about 0.45120.4512. P(X>8)=e−0.2×8=e−1.6=0.201897P(X>8)=e^{-0.2\times 8}=e^{-1.6}=0.201897, about 0.20190.2019. Finally P(3≤X≤8)=F(8)−F(3)=e−0.6−e−1.6=0.548812−0.201897=0.346915P(3\leq X\leq 8)=F(8)-F(3)=e^{-0.6}-e^{-1.6}=0.548812-0.201897=0.346915, about 0.34690.3469, the shaded area in the figure. Check with the sum: 0.4512+0.3469+0.2019=1.00000.4512+0.3469+0.2019=1.0000, the three pieces of the support fit back together. Remember the short form P(X>x)=e−λxP(X>x)=e^{-\lambda x}, which saves a complement on every line. The most frequent numerical slip is to key in e−0.2e^{-0.2} and then multiply by 3 instead of cubing, or to drop the minus sign: you then get a probability greater than 1, which must stop the calculation at once.

c)

For an exponential, E(X)=1λ=5E(X)=\frac{1}{\lambda}=5 years, as the statement announced, and the standard deviation is ALSO 1λ=5\frac{1}{\lambda}=5 years, a remarkable property of this distribution. The median solves F(m)=0.5F(m)=0.5, that is 1−e−0.2m=0.51-e^{-0.2m}=0.5, so e−0.2m=0.5e^{-0.2m}=0.5, so −0.2m=ln⁡0.5-0.2m=\ln 0.5 and m=ln⁡20.2≈3.47m=\frac{\ln 2}{0.2}\approx 3.47 years. The median is clearly LOWER than the mean, 3.473.47 versus 55: half the bulbs die before three and a half years, while the mean lifetime is five years. The explanation is the right skew: a minority of very long-lasting bulbs pulls the mean up without moving the median. Telling a customer “five years” is therefore misleading; the typical value is closer to three and a half years.

d)

P(X>8∣X>3)=P(X>8)P(X>3)=e−1.6e−0.6=e−1=0.367879P(X>8\mid X>3)=\frac{P(X>8)}{P(X>3)}=\frac{e^{-1.6}}{e^{-0.6}}=e^{-1}=0.367879, about 0.36790.3679. And P(X>5)=e−1=0.3679P(X>5)=e^{-1}=0.3679 as well. The two numbers are EQUAL, and this is no coincidence of the statement: the quotient of two exponentials keeps only the difference of the exponents, so e−λ(s+t)e−λs=e−λt\frac{e^{-\lambda(s+t)}}{e^{-\lambda s}}=e^{-\lambda t} for all ss and tt. This is the MEMORYLESS PROPERTY, P(X>s+t∣X>s)=P(X>t)P(X>s+t\mid X>s)=P(X>t), and the exponential is the only continuous distribution that has it.

e)

The contrast is head-on. With the uniform distribution, conditioning changed everything, 0.500.50 instead of 0.750.75: the bus was getting closer. Here, conditioning changes nothing: a bulb that has been on for three years has exactly the same prospects as a new one. The model asserts that the object DOES NOT AGE, that a failure is an accident and not wear. It is a good model for a random electronic failure, a component that fails because a power surge comes through, for the time between two calls to a switchboard, or for the decay of a radioactive nucleus, for which it is the exact model. It is a poor model for a tire, a mechanical part or a living being, all subject to wear: their failure rate INCREASES with age, whereas the exponential imposes a constant rate. Applying the exponential to equipment that wears out leads to a gross overestimate of the remaining lifetime of parts that are already old, and that is a sizing error that is costly in maintenance.

Part B: problems and reasoning (/50)

Exercise 6: The normal distribution seen as a density, not as a table

A storage room is regulated by a thermostat. The temperature XX, in degrees Celsius, follows a normal distribution with mean μ=21.0\mu=21.0 and standard deviation σ=0.25\sigma=0.25.

No exotic z-score is asked for here: we look at the normal distribution for what it is, a DENSITY whose maximum height is f(μ)=1σ2πf(\mu)=\dfrac{1}{\sigma\sqrt{2\pi}} and whose famous 68, 95 and 99.7 percent are AREAS of bands.

The figure shows the bell curve, with the shaded band equal to μ±σ\mu\pm\sigma and the four dashed lines marking μ±2σ\mu\pm 2\sigma and μ±3σ\mu\pm 3\sigma, each one stopping at the curve.

2020.52121.522-0.250.250.50.7511.251.51.7568%x (degrees Celsius)f(x) (per degree)
  • a) Compute f(μ)f(\mu), the maximum height of the density, to four decimal places. Is the result a mistake?
  • b) Give the endpoints of the three bands and the area of each. What do these areas represent?
  • c) Compute P(X≥21.5)P(X\geq 21.5) using the two-standard-deviation band and symmetry, without looking anything up in the table.
  • d) Standardization Z=X−μσZ=\dfrac{X-\mu}{\sigma} divides widths by σ\sigma and multiplies heights by σ\sigma. Check this numerically on f(μ)f(\mu), and say why a single table is enough for every normal distribution.
  • e) Compute P(X=21.0)P(X=21.0), then estimate P(20.995≤X≤21.005)P(20.995\leq X\leq 21.005) with a rectangle. So what does f(21.0)f(21.0) measure?

Type your answers, the page tells you right or wrong 0/12

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) f(μ)=1.5958f(\mu)=1.5958 per degree, greater than 1 without contradiction: only the area is capped.
  • b) [20.75,21.25][20.75, 21.25] for 0.68270.6827, [20.50,21.50][20.50, 21.50] for 0.95450.9545, [20.25,21.75][20.25, 21.75] for 0.99730.9973. These are probabilities.
  • c) P(X≥21.5)=1−0.95452=0.0228P(X\geq 21.5)=\dfrac{1-0.9545}{2}=0.0228.
  • d) 0.25×1.5958=0.3989=12π0.25\times 1.5958=0.3989=\frac{1}{\sqrt{2\pi}}: the area is preserved, so a single table is enough.
  • e) P(X=21.0)=0P(X=21.0)=0 and P(20.995≤X≤21.005)≈0.0160P(20.995\leq X\leq 21.005)\approx 0.0160: f(21.0)f(21.0) is a probability per degree.
a)

f(μ)=1σ2π=10.25×2.506628=10.626657=1.5958f(\mu)=\frac{1}{\sigma\sqrt{2\pi}}=\frac{1}{0.25\times 2.506628}=\frac{1}{0.626657}=1.5958. The density therefore exceeds 1, and this is in no way a mistake. The maximum height of a normal density is 0.39894σ\frac{0.39894}{\sigma}: it goes above 1 as soon as σ<0.39894\sigma<0.39894, which happens all the time once you measure in fine units, degrees Celsius on a tight thermostat, millimetres on a machined part. What stays capped at 1 is the total area, and it equals exactly 1 here as everywhere: the bell is tall because it is NARROW, and the product of height and width does not move.

b)

The three bands. At one standard deviation, [μ−σ,μ+σ]=[20.75,21.25][\mu-\sigma, \mu+\sigma]=[20.75, 21.25], with area 0.68270.6827. At two, [20.50,21.50][20.50, 21.50], with area 0.95450.9545. At three, [20.25,21.75][20.25, 21.75], with area 0.99730.9973. These areas are PROBABILITIES: 68.27 percent of the time the temperature stays between 20.75 and 21.25 degrees, 99.73 percent of the time it stays between 20.25 and 21.75. The point of method, and it holds for the whole chapter: the empirical rule is not a separate formula, it is the reading of three particular areas under the same curve. The pitfall would be to believe that these three percentages depend on the thermostat: they are the SAME for every normal distribution, whatever μ\mu and σ\sigma, because they are measured in standard deviations.

c)

The two-standard-deviation band, [20.50,21.50][20.50, 21.50], contains an area of 0.95450.9545. So 1−0.9545=0.04551-0.9545=0.0455 remains outside, spread over the TWO tails. Since the bell is symmetric about μ\mu, each tail carries half of it: P(X≥21.5)=0.04552=0.02275P(X\geq 21.5)=\frac{0.0455}{2}=0.02275, about 0.02280.0228. A check with the table, for those who want it: z=21.5−21.00.25=2.00z=\frac{21.5-21.0}{0.25}=2.00 and the area to the right of 2 is 1−0.9772=0.02281-0.9772=0.0228. The two routes give the same number, and the first one required no lookup. Forgetting to DIVIDE BY TWO is the classic error: you then announce 4.55 percent, twice the real risk, and every adjustment decision that follows is wrong.

d)

A numerical check in one product: σ×f(μ)=0.25×1.595769=0.398942\sigma\times f(\mu)=0.25\times 1.595769=0.398942, and that is exactly 12π=0.398942\frac{1}{\sqrt{2\pi}}=0.398942, the height of the STANDARD normal density at zero. The transformation has therefore compressed the horizontal axis by a factor σ\sigma and stretched the vertical axis by the same factor. Since an area is the product of a width and a height, the factor σ\sigma comes in on one side and cancels on the other: the area is PRESERVED. That is why a single table, the standard normal table, is enough to handle every normal distribution in the world: they are all the same bell, seen through a change of unit. It is also why the z-score has no unit: it counts standard deviations.

e)

P(X=21.0)=0P(X=21.0)=0, as for any continuous variable, even though the density reaches 1.59581.5958 there, its maximum. The two statements do not contradict each other, they are about different objects, an area of zero width and a height. For a narrow band of width 0.010.01 degree, the area is almost that of a rectangle: P(20.995≤X≤21.005)≈f(21.0)×0.01=1.595769×0.01=0.015958P(20.995\leq X\leq 21.005)\approx f(21.0)\times 0.01=1.595769\times 0.01=0.015958, about 1.60 percent. The exact calculation with the table gives 0.0159570.015957; the rectangle approximation is excellent because the curve is almost flat at its peak. Conclusion: f(21.0)=1.5958f(21.0)=1.5958 reads “1.5958 per degree”, it is a probability PER DEGREE, and only after multiplying by a width in degrees does it become a probability.

Exercise 7: Continuous expected value and variance, read as a centre of gravity

We return to the steel bar of exercises 2 and 3, with density f(x)=x8f(x)=\dfrac{x}{8} on [0,4][0, 4].

In the discrete case, E(X)=∑xiP(xi)E(X)=\sum x_{i}P(x_{i}): a mean of the values, weighted by their probabilities. In the continuous case the idea does not change; the density replaces the point probabilities. Two readings are possible without any integral calculus: an APPROXIMATE weighted mean, obtained by cutting the support into strips, and the EXACT value, which is the xx-coordinate of the centre of gravity of the area under the curve.

The figure shows the division into four strips one unit wide. For the variance, we take as given the formula for the triangular distribution on [a,b][a, b] with peak cc: V(X)=a2+b2+c2−ab−ac−bc18V(X)=\dfrac{a^{2}+b^{2}+c^{2}-ab-ac-bc}{18}.

0.511.522.533.54-0.10.10.20.30.40.50.6x (metres)f(x) (per metre)
  • a) Compute the probabilities p1p_{1} to p4p_{4} of the four strips [0,1][0, 1], [1,2][1, 2], [2,3][2, 3] and [3,4][3, 4], as areas of trapezoids. Check their sum.
  • b) Replacing each strip by its centre, compute an approximate value of E(X)E(X).
  • c) Give the EXACT value of E(X)E(X), taking the xx-coordinate of the centre of gravity of the triangle with vertices (0,0)(0, 0), (4,0)(4, 0) and (4,0.5)(4, 0.5). Explain the gap with b).
  • d) Compute V(X)V(X) and the standard deviation with the given formula.
  • e) Give the mode, the median and the mean of XX, put them in order, and correct the sentence “the expected value is the most probable value”.

Type your answers, the page tells you right or wrong 0/12

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) p1=0.0625p_{1}=0.0625, p2=0.1875p_{2}=0.1875, p3=0.3125p_{3}=0.3125, p4=0.4375p_{4}=0.4375, adding up to 1.
  • b) E(X)≈2.625E(X)\approx 2.625 m.
  • c) E(X)=83≈2.67E(X)=\dfrac{8}{3}\approx 2.67 m, the centre of gravity of the triangle. The gap comes from the mass being concentrated at the centre of each strip.
  • d) V(X)=1618≈0.8889V(X)=\dfrac{16}{18}\approx 0.8889 and σ≈0.9428\sigma\approx 0.9428 m.
  • e) Mode 4, median 2.83, mean 2.67, so mean < median < mode. The most probable value is the MODE, not the expected value.
a)

Since the density is LINEAR, the area above each strip is exactly that of a trapezoid, and the calculation is exact, not approximate. With f(0)=0f(0)=0, f(1)=0.125f(1)=0.125, f(2)=0.25f(2)=0.25, f(3)=0.375f(3)=0.375 and f(4)=0.5f(4)=0.5, we get p1=0+0.1252×1=0.0625p_{1}=\frac{0+0.125}{2}\times 1=0.0625, p2=0.125+0.252=0.1875p_{2}=\frac{0.125+0.25}{2}=0.1875, p3=0.25+0.3752=0.3125p_{3}=\frac{0.25+0.375}{2}=0.3125 and p4=0.375+0.52=0.4375p_{4}=\frac{0.375+0.5}{2}=0.4375. The sum is 0.0625+0.1875+0.3125+0.4375=1.00000.0625+0.1875+0.3125+0.4375=1.0000, which is the mandatory check: the variable necessarily takes a value in the support. You can also cross-check with the cumulative distribution function of exercise 3, p1=F(1)=116=0.0625p_{1}=F(1)=\frac{1}{16}=0.0625, and p1+p2=F(2)=0.25p_{1}+p_{2}=F(2)=0.25, which agrees.

b)

Treat the four strips as four discrete values placed at their centres, 0.50.5, 1.51.5, 2.52.5 and 3.53.5, with the weights found in a). The weighted mean is 0.5(0.0625)+1.5(0.1875)+2.5(0.3125)+3.5(0.4375)=0.03125+0.28125+0.78125+1.53125=2.6250.5(0.0625)+1.5(0.1875)+2.5(0.3125)+3.5(0.4375)=0.03125+0.28125+0.78125+1.53125=2.625. This is exactly the discrete formula, and it is the right way to understand what a continuous expected value does: it weighs each zone of the support by the probability it carries. The right-hand zone, which carries 43.75 percent of the probability, pulls the mean towards it.

c)

The area under the curve is a triangle with vertices (0,0)(0, 0), (4,0)(4, 0) and (4,0.5)(4, 0.5). The xx-coordinate of its centre of gravity is the mean of the xx-coordinates of the three vertices, 0+4+43=83≈2.6667\frac{0+4+4}{3}=\frac{8}{3}\approx 2.6667 metres, and that is the EXACT value of E(X)E(X). The approximation in b) gave 2.6252.625, a gap of 0.0420.042, about 1.6 percent. The gap comes from having concentrated the whole mass of a strip at its centre, whereas inside each strip the density keeps increasing: the true centre of gravity of each slice is a little to the right of its midpoint. Refining the division reduces the gap, and that is precisely what an integral would do, an integral being nothing other than this weighted mean pushed to the limit.

d)

With a=0a=0, b=4b=4 and the peak at c=4c=4, the formula gives V(X)=0+16+16−0−0−1618=1618=0.8889V(X)=\frac{0+16+16-0-0-16}{18}=\frac{16}{18}=0.8889 square metre, and σ=0.8889=0.9428\sigma=\sqrt{0.8889}=0.9428 metre. A check with the division of a): E(X2)≈0.25(0.0625)+2.25(0.1875)+6.25(0.3125)+12.25(0.4375)=7.75E(X^{2})\approx 0.25(0.0625)+2.25(0.1875)+6.25(0.3125)+12.25(0.4375)=7.75, so V≈7.75−2.6252=7.75−6.890625=0.8594V\approx 7.75-2.625^{2}=7.75-6.890625=0.8594, and σ≈0.927\sigma\approx 0.927. The two routes give the same order of magnitude, which validates the given formula. Interpretation: a standard deviation of 0.94 metre on a 4-metre bar is a very spread-out location; the flaw can fall more or less anywhere, with a marked preference for the right.

e)

The MODE is the value where the density is highest, here x=4x=4, at the right edge of the support, since ff increases all the way to the end. The MEDIAN is 8≈2.83\sqrt{8}\approx 2.83, computed in exercise 3. The MEAN is 83≈2.67\frac{8}{3}\approx 2.67. The three numbers are different and come in the order mean, then median, then mode: 2.67<2.83<42.67<2.83<4. The sentence to correct confuses expected value and mode: the most probable value, in the sense of the highest density, is the MODE, and here the expected value does not coincide with it. The expected value is the centre of gravity, the median cuts the area into two equal halves, the mode is the peak. The three coincide only if the density is symmetric with a single peak, which is the case for the normal distribution and the uniform distribution, and it is this special case that keeps the confusion alive. The order obtained, mean below median below mode, signals a distribution skewed to the LEFT, its long tail lying on the side of the small values.

Exercise 8: Five statements to correct

Here are five sentences taken from student papers. Each one is false. For each, say why and give the correction, supported by a numerical example taken from the previous exercises.

  • a) “A density is a probability.”
  • b) “A density cannot exceed 1.”
  • c) “P(X=3)P(X=3) is read off the density curve.”
  • d) “Replacing ≤\leq with << changes the result.”
  • e) “The exponential ages: the longer a component has lasted, the more likely it is to fail.”

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) False: a density is a probability per unit. f(4)=0.50f(4)=0.50 per metre gives 0.0050.005 over one centimetre.
  • b) False: the uniform distribution on [0,0.25][0, 0.25] has a density of 4, and the normal distribution of exercise 6 rises to 1.59581.5958. Only the area is capped.
  • c) False: P(X=3)=0P(X=3)=0; what you read at 3 is f(3)f(3), a height.
  • d) False in the continuous case, both equal 0.350.35 in exercise 1. True in the discrete case, where the gap equals P(X=3)P(X=3).
  • e) False: the exponential is memoryless, P(X>8∣X>3)=e−1=0.3679=P(X>5)P(X>8\mid X>3)=e^{-1}=0.3679=P(X>5). Its failure rate is constant.
a)

FALSE. A density is a probability PER UNIT, and you have to multiply it by a width to obtain a probability. In exercise 2, f(4)=0.50f(4)=0.50 per metre does not mean a 50 percent chance of finding the flaw at the end of the bar: over one centimetre around 4 metres, the probability is about 0.50×0.01=0.0050.50\times 0.01=0.005. The test that settles the question in one second is the UNITS test: a probability has none, a density always has one, reciprocal metres, minutes or degrees. Correction: a density becomes a probability only after multiplying by a width, in other words once you have taken an AREA.

b)

FALSE. What is capped at 1 is the total area, never the height. The uniform distribution on [0,0.25][0, 0.25] has a constant density equal to 10.25=4\frac{1}{0.25}=4, and yet its area is 0.25×4=10.25\times 4=1. The normal distribution of exercise 6, with σ=0.25\sigma=0.25, rises to f(μ)=1.5958f(\mu)=1.5958. The general rule: the more concentrated the variable, the taller the density, and 1σ2π\frac{1}{\sigma\sqrt{2\pi}} exceeds 1 as soon as σ<0.399\sigma<0.399. Correction: only the area is bounded by 1, the height is not.

c)

FALSE, twice over. First, P(X=3)=0P(X=3)=0 for any continuous variable, because the area of a segment of zero width is zero: there is nothing to read. Second, what you read at the value 3 on the curve is f(3)f(3), the height of the density, which is not a probability. In the discrete case, on the other hand, P(X=3)P(X=3) really is read off, on a bar chart or in a table. Correction: on a density, you never read a probability at a POINT, you measure an area over an INTERVAL.

d)

FALSE for a continuous variable. Going from P(1≤X≤3)P(1\leq X\leq 3) to P(1<X<3)P(1<X<3) amounts to removing two isolated values, so two zero probabilities: in exercise 1, both equal 0.350.35. It is TRUE in the discrete case, and there the gap is exactly P(X≤3)−P(X<3)=P(X=3)P(X\leq 3)-P(X<3)=P(X=3), which has no reason to be zero. This difference in treatment is the trace of the continuity of the cumulative distribution function: in the discrete case, FF jumps, and the height of the jump is precisely P(X=3)P(X=3). Correction: in the continuous case, strict and non-strict give the same result; in the discrete case, never.

e)

FALSE, and it is the exact opposite. The exponential is the ONLY MEMORYLESS continuous distribution: P(X>s+t∣X>s)=P(X>t)P(X>s+t\mid X>s)=P(X>t), whatever ss and tt. In exercise 5, a bulb that had been on for three years had a probability e−1=0.3679e^{-1}=0.3679 of lasting five more years, exactly the same as a new bulb. The model therefore asserts that the object does NOT age, that its failure is an accident and not wear. Beware of the reading trap: the density decreases, which suggests ageing, whereas it decreases simply because fewer and fewer objects are still in service. Correction: the exponential imposes a CONSTANT failure rate, and that is why it does not suit equipment that wears out, such as a tire.

Exercise 9: Problem: waiting at the counter and the lifetime of a component

PART ONE. At a registration counter, the waiting time XX, in minutes, follows an exponential distribution with mean 4 minutes, so λ=0.25\lambda=0.25 per minute. Recall that P(X>x)=e−λxP(X>x)=e^{-\lambda x}.

PART TWO, in d). A manufacturer sells an electronic module whose lifetime TT, in hours, follows an exponential distribution with mean 2000 hours.

  • a) Compute P(X<2)P(X<2) and P(X>10)P(X>10), to four decimal places.
  • b) The service wants to post: “90 percent of our customers are served in less than tt minutes.” Find tt, to the hundredth of a minute.
  • c) A customer has already been waiting for 6 minutes. Compute the probability that she waits more than 10 minutes in total, then compare with P(X>4)P(X>4).
  • d) Compute P(T>3000)P(T>3000). Then find the warranty period gg such that 95 percent of the modules outlast it, to the tenth of an hour.
  • e) For which of these two items would the exponential be a poor model, an electronic module or a tire? Put a number on what the model would wrongly predict.

Type your answers, the page tells you right or wrong 0/10

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) P(X<2)=0.3935P(X<2)=0.3935 and P(X>10)=0.0821P(X>10)=0.0821.
  • b) t=ln⁡100.25≈9.21t=\dfrac{\ln 10}{0.25}\approx 9.21 minutes.
  • c) P(X>10∣X>6)=e−1=0.3679P(X>10\mid X>6)=e^{-1}=0.3679, identical to P(X>4)P(X>4): the waiting already done brings nothing.
  • d) P(T>3000)=e−1.5=0.2231P(T>3000)=e^{-1.5}=0.2231 and g=−2000ln⁡0.95≈102.6g=-2000\ln 0.95\approx 102.6 hours.
  • e) The tire: the model would wrongly predict a probability of 0.22310.2231 that it lasts 3000 h more after 5000 h, the same as a new one.
a)

P(X<2)=1−e−0.25×2=1−e−0.5=1−0.606531=0.393469P(X<2)=1-e^{-0.25\times 2}=1-e^{-0.5}=1-0.606531=0.393469, about 0.39350.3935: nearly four customers in ten get through in less than two minutes. P(X>10)=e−0.25×10=e−2.5=0.082085P(X>10)=e^{-0.25\times 10}=e^{-2.5}=0.082085, about 0.08210.0821: roughly one customer in twelve waits more than ten minutes. A consistency check: the mean is 4 minutes, and it is normal for a wait of more than twice the mean to remain rare but not negligible, since the exponential has a long tail. Because the variable is continuous, P(X<2)P(X<2) and P(X≤2)P(X\leq 2) are the same number.

b)

We look for tt such that P(X≤t)=0.90P(X\leq t)=0.90, so 1−e−0.25t=0.901-e^{-0.25t}=0.90, so e−0.25t=0.10e^{-0.25t}=0.10. Take logarithms: −0.25t=ln⁡0.10=−2.302585-0.25t=\ln 0.10=-2.302585, so t=2.3025850.25=9.2103t=\frac{2.302585}{0.25}=9.2103, about 9.219.21 minutes. A check working backwards: e−0.25×9.2103=e−2.302585=0.100e^{-0.25\times 9.2103}=e^{-2.302585}=0.100, and the remaining probability is indeed 10 percent. The service can therefore post nine minutes and thirteen seconds, or more cautiously ten minutes. The frequent mistake is to write e−0.25t=0.90e^{-0.25t}=0.90, which answers the wrong question and gives t=0.42t=0.42 minute, an absurd figure next to a mean of 4 minutes: plausibility alone is enough to reject it.

c)

The question asks for P(X>10∣X>6)=P(X>10)P(X>6)=e−2.5e−1.5=e−1=0.367879P(X>10\mid X>6)=\frac{P(X>10)}{P(X>6)}=\frac{e^{-2.5}}{e^{-1.5}}=e^{-1}=0.367879, about 0.36790.3679. And P(X>4)=e−1=0.3679P(X>4)=e^{-1}=0.3679 as well. The six minutes already spent have changed nothing: the customer is in exactly the position of someone who has just arrived. This is the memoryless property, checked a second time, and it explains why a queue governed by this model is so frustrating to live through: the time already invested buys no advantage. It would be false for a bus on a fixed schedule, the case of exercise 4, where the waiting already done brings you closer to the next bus.

d)

For the module, λ=12000=0.0005\lambda=\frac{1}{2000}=0.0005 per hour. P(T>3000)=e−0.0005×3000=e−1.5=0.223130P(T>3000)=e^{-0.0005\times 3000}=e^{-1.5}=0.223130, about 0.22310.2231: barely 22 percent of the modules last beyond 3000 hours, while the advertised mean is 2000 hours, which always comes as a surprise. For the warranty, we want P(T>g)=0.95P(T>g)=0.95, so e−g/2000=0.95e^{-g/2000}=0.95, so −g2000=ln⁡0.95=−0.051293-\frac{g}{2000}=\ln 0.95=-0.051293 and g=2000×0.051293=102.6g=2000\times 0.051293=102.6 hours. The manufacturer can therefore guarantee only about a hundred hours if it wants no more than 5 percent of returns, roughly one twentieth of the mean lifetime. That is why warranties always look stingy next to advertised lifetimes: the mean is pulled up by a minority of very long-lasting modules.

e)

For the TIRE. A tire wears out, its failure rate INCREASES with mileage, whereas the exponential imposes a constant rate, which is the memoryless property of c). Let us put a number on what the model would wrongly predict. If the lifetime of a tire were modelled by an exponential with mean 2000 hours, then a tire that had already run 5000 hours would still have a probability e−1.5=0.2231e^{-1.5}=0.2231 of lasting 3000 more hours, exactly like a new tire. No mechanic would sign that sentence. The electronic module, on the other hand, fails by accident, a power surge or a latent defect, and there a constant rate is a reasonable assumption. Using the exponential on equipment that wears out leads to overestimating the remaining lifetime of old parts, hence to under-sizing maintenance, and that is a costly error.

Exercise 10: Problem: two instruments with the same standard deviation, two densities

A laboratory compares two scales. SCALE A displays to the nearest gram: its rounding error EE is therefore uniform on [−0.5,0.5][-0.5, 0.5] gram. SCALE B is analogue, and its error follows a normal distribution with mean 0 and a standard deviation EQUAL to that of scale A.

The two instruments therefore have the same spread in the sense of the standard deviation. The whole question is whether that is enough to declare them equivalent.

Recall that the variance of a uniform distribution on [a,b][a, b] is (b−a)212\dfrac{(b-a)^{2}}{12}.

  • a) Give the density of the error of scale A, then its expected value, its variance and its standard deviation, to four decimal places.
  • b) Compute P(∣E∣≤0.2)P(\left|E\right|\leq 0.2) for scale A.
  • c) Compute the same probability for scale B. Which of the two concentrates its errors more closely around zero?
  • d) Compute P(∣E∣>0.5)P(\left|E\right|>0.5) for each of the two scales. What does the comparison reveal?
  • e) The laboratory requires an error below 0.5 gram in 99 percent of weighings. What maximum standard deviation must scale B achieve? Conclude on comparing two instruments by their standard deviation alone.

Type your answers, the page tells you right or wrong 0/12

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) f=1f=1 on [−0.5,0.5][-0.5, 0.5], E(E)=0E(E)=0, V(E)=112≈0.0833V(E)=\dfrac{1}{12}\approx 0.0833 and σ≈0.2887\sigma\approx 0.2887 g.
  • b) P(∣E∣≤0.2)=0.40P(\left|E\right|\leq 0.2)=0.40 for scale A.
  • c) z=0.6928z=0.6928 and P=0.5116P=0.5116 for scale B: it is the one that concentrates more closely around zero.
  • d) 00 for A, bounded support; 0.08330.0833 for B. The normal is better at the centre and worse in the tails.
  • e) z=2.5758z=2.5758 so σ≤0.1941\sigma\leq 0.1941 g. The standard deviation alone is not enough to compare two instruments; the shape of the density decides.
a)

The error is uniform on an interval of width 1, so its density is f(x)=11=1f(x)=\frac{1}{1}=1 on [−0.5,0.5][-0.5, 0.5], and zero elsewhere. The area is 1×1=11\times 1=1, the condition is met, and note that this density equals exactly 1 through nothing more than a coincidence of units. By symmetry, E(E)=0E(E)=0: the scale is not biased, it rounds up as often as down. The variance is (0.5−(−0.5))212=112=0.083333\frac{(0.5-(-0.5))^{2}}{12}=\frac{1}{12}=0.083333 and the standard deviation 112=0.288675\sqrt{\frac{1}{12}}=0.288675, about 0.28870.2887 gram. This is the standard deviation that scale B reproduces.

b)

For the uniform distribution, everything is a ratio of lengths. The event ∣E∣≤0.2\left|E\right|\leq 0.2 corresponds to the interval [−0.2,0.2][-0.2, 0.2], of width 0.40.4, on a support of width 1: P(∣E∣≤0.2)=0.4×1=0.40P(\left|E\right|\leq 0.2)=0.4\times 1=0.40. Forty percent of weighings have a rounding error smaller than two tenths of a gram. A check with the figure: it is indeed the area of a rectangle with base 0.40.4 and height 1.

c)

For scale B, standardize: z=0.20.288675=0.6928z=\frac{0.2}{0.288675}=0.6928. The table gives Φ(0.6928)=0.7558\Phi(0.6928)=0.7558, so P(∣E∣≤0.2)=2×0.7558−1=0.5116P(\left|E\right|\leq 0.2)=2\times 0.7558-1=0.5116. Scale B therefore keeps 51.2 percent of its errors below two tenths of a gram, against 40 percent for scale A, even though the two have EXACTLY the same standard deviation. The bell piles its values up near the centre, the rectangle spreads them evenly: for equal overall spread, the normal is better at the centre. The mistake to avoid is to forget the 2Φ(z)−12\Phi(z)-1 and announce 0.75580.7558, which is the area to the left of +0.6928+0.6928 and therefore counts the whole left half of the bell.

d)

For scale A, P(∣E∣>0.5)=0P(\left|E\right|>0.5)=0, strictly: its support is BOUNDED, it cannot be off by more than half a gram, which is a property of rounding itself. For scale B, z=0.50.288675=1.7321z=\frac{0.5}{0.288675}=1.7321, the table gives Φ(1.7321)=0.9584\Phi(1.7321)=0.9584 and P(∣E∣>0.5)=2×(1−0.9584)=0.0833P(\left|E\right|>0.5)=2\times(1-0.9584)=0.0833, that is 8.3 percent. So one weighing in twelve is off by more than half a gram on scale B, and nothing bounds the size of those errors. This is the complete reversal of c): better at the centre, the normal is clearly worse in the tails. Two densities with the same standard deviation can therefore behave in opposite ways exactly where it matters, and the standard deviation alone does not say so.

e)

We want P(∣E∣≤0.5)=0.99P(\left|E\right|\leq 0.5)=0.99, so 0.50.5 percent in each tail, so an area of 0.9950.995 to the left of the cutoff: the table gives z=2.5758z=2.5758. We then need 0.5=2.5758 σ0.5=2.5758\,\sigma, that is σ≤0.52.5758=0.1941\sigma\leq\frac{0.5}{2.5758}=0.1941 gram. Scale B must therefore be about one and a half times more precise than scale A just to EQUAL a guarantee that scale A provides automatically. And it will never quite equal it: no normal distribution reaches 100 percent on a bounded interval, its support is the whole real line, whereas scale A never goes beyond half a gram. The practical conclusion, and it is the real result of the problem: comparing two instruments by their standard deviation alone is not enough. The SHAPE of the density decides what happens in the tails, and the tails are what produce rejected parts, alarms and disputes.

-1-0.75-0.5-0.250.250.50.7510.751.5A: uniformB: normalerror (g)
Something missing from this set? A type of exercise your teacher gives, a problem you are stuck on, 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 chapter Probability and distributions, 201-337 Next chapter Estimation and hypothesis testing, 201-337

© Ahmed Squalli Houssaini. Exercise set published at www.letuteurscientifique.ca/en/exercices/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 statistics 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