Probability and Statistics 201-SN1-RE • CEGEP, Montreal
Corrected exercises: discrete and continuous random variables (201-SN1-RE)
These are ten corrected exercises on discrete and continuous random variables, at the level of Probability and Statistics 201-SN1-RE in the CEGEP Science program: probability distribution, cumulative distribution function, expected value, variance and standard deviation, properties of E(aX+b) and V(aX+b), probability density function and normalizing constant, median and quartiles, continuous uniform distribution.
What the set covers, the traps it targets
The integral calculus of 201-SN3-RE is put to real use: substitution, integration by parts and improper integrals.
By the end of the set, you can build a distribution from data and draw its cumulative distribution function (exercise 1), prove V(X)=E(X2)−E(X)2 and V(aX+b)=a2V(X) (exercise 2), normalize a density and compute a probability by integration (exercise 3), derive the median and a quartile from it (exercise 4), compute expected value and variance by integration (exercises 5 and 7) and prove the formulas of the uniform distribution (exercise 6). The situations come from the natural sciences: tree swallow nests, mutations in a cloned gene, hailstones from a storm, seed germination, a lake echo sounder, the dispersal of yellow birch seeds. Exercise 9 is a full study, from field counts to the recommended buffer zone, and exercise 10 shows how a once-a-day observation turns a continuous duration into a discrete variable.
The pitfalls covered in detail: confusing P(X<a) and P(X≤a) for a discrete variable (exercises 1 and 8), writing V(−X)=−V(X) or V(2.5X+1)=2.5V(X)+1 (exercises 2 and 8), reading a density value as a probability (exercises 3, 6 and 8), taking the expected value for the most probable value or for the median (exercises 5, 7 and 8), correcting a bias while believing the spread is reduced (exercise 6), forgetting the class width in a histogram (exercise 9) and publishing a mean biased by the observation protocol (exercise 10).
The thread of the set: discrete or continuous, a variable is read from its distribution. In the discrete case, a probability is the height of a bar, and you add; in the continuous case, it is an area under the density, and you integrate. A density is therefore never a probability, and the expected value, a weighted average, is never to be confused with the most probable value. The binomial and normal distributions have their own set, linked at the bottom of the page. Work each exercise through before opening the solution.
•DISCRETE VARIABLE: its distribution gives P(X=xi)=pi, with pi≥0 and ∑pi=1. A probability is the HEIGHT of a bar; P(X<a) and P(X≤a) differ by the bar P(X=a).
•DISCRETE EXPECTED VALUE AND VARIANCE: E(X)=∑xipi; V(X)=E((X−μ)2)=E(X2)−E(X)2; σ(X)=V(X).
•LINEAR TRANSFORMATION: E(aX+b)=aE(X)+b, V(aX+b)=a2V(X), σ(aX+b)=∣a∣σ(X). A shift moves the distribution without spreading it.
•DENSITY: f(x)≥0 and ∫−∞+∞f(x)dx=1. P(a≤X≤b)=∫abf(x)dx, and P(X=a)=0. A value f(x) is a probability per unit: it can exceed 1.
•CUMULATIVE DISTRIBUTION FUNCTION: F(x)=P(X≤x), increasing from 0 to 1. In the discrete case, a staircase whose every jump is a P(X=xi); in the continuous case, F(x)=∫−∞xf(t)dt, continuous, and F′=f. The median solves F(m)=0.5.
•CONTINUOUS EXPECTED VALUE AND VARIANCE: E(X)=∫xf(x)dx, E(X2)=∫x2f(x)dx, V(X)=E(X2)−E(X)2. On [0,+∞), the integral is improper: integrate up to A, then let A→+∞.
•UNIFORM DISTRIBUTION on [a,b]: f(x)=b−a1, E(X)=2a+b, V(X)=12(b−a)2.
•MODE, MEDIAN, EXPECTED VALUE: three different numbers. For a density skewed to the right, mode < median < expected value, and P(X>E(X))<0.5.
Calculations: expected values, variances, densities and integrals
Exercise 0.1: Computing an expected value, a variance, a constant and an integral: eleven direct calculations
14 answers to check
For each line, compute the requested value, without justifying the model. Lines a) to f) are about the discrete variable X that takes the values 0, 1, 2, 3 with probabilities 0.1, 0.3, 0.4, 0.2 (except line e). Lines g) to k) are about a continuous variable with density f, equal to zero outside the given interval. Give exact values when they come out evenly, otherwise round to two decimal places.
Two moves for the whole list. In the discrete case, you SUM: E(X)=∑xipi and E(X2)=∑xi2pi, then V(X)=E(X2)−E(X)2. In the continuous case, you INTEGRATE the density: P(a≤X≤b)=∫abf(x)dx, E(X)=∫xf(x)dx, and an unknown constant is found by writing that the total integral equals 1.
a) Compute E(X).
b) Compute V(X).
c) Compute the standard deviation σ(X).
d) Let Y=3X−2. Compute E(Y) and V(Y).
e) A variable takes the values 1, 2, 3, 4 with probabilities 0.2, 0.35, p, 0.15. Compute p.
f) Compute P(X≤1) and P(X<1).
g) f(x)=kx2 on [0,3]: compute the constant k.
h) f(x)=83x2 on [0,2]: compute P(1≤X≤2).
i) f(x)=2x on [0,1]: compute E(X).
j) Uniform distribution on [2,8]: compute E(X) and V(X).
k) The cumulative distribution function is F(x)=27x3 on [0,3]: compute the median m.
Show the solution
Answers
a)E(X)=1.7
b)E(X2)=3.7; V(X)=0.81
c)σ(X)=0.9
d)E(Y)=3.1; V(Y)=7.29
e)p=0.3
f)P(X≤1)=0.4; P(X<1)=0.1
g)k=91
h)P(1≤X≤2)=87=0.875
i)E(X)=32
j)E(X)=5; V(X)=3
k)m=323≈2.38
The move that decides everything: in the discrete case you add point probabilities, in the continuous case you integrate a density. A density is never a probability; only its integral is one.
a)
E(X)=0×0.1+1×0.3+2×0.4+3×0.2=0.3+0.8+0.6=1.7.
b)
E(X2)=0×0.1+1×0.3+4×0.4+9×0.2=3.7.
V(X)=E(X2)−E(X)2=3.7−2.89=0.81.
Pitfall: squaring the probabilities instead of the values.
c)
σ(X)=0.81=0.9, in the unit of X.
d)
E(Y)=3E(X)−2=3×1.7−2=3.1.
V(Y)=32V(X)=9×0.81=7.29: a shift does not change the spread, a factor 3 multiplies it by 9.
e)
The probabilities of a distribution add up to 1: 0.2+0.35+p+0.15=1, so p=0.3, which is indeed positive.
f)
P(X≤1)=0.1+0.3=0.4 and P(X<1)=P(X=0)=0.1.
In the discrete case, ≤ and < do not give the same number: the difference is the bar P(X=1)=0.3.
g)
∫03kx2dx=k[3x3]03=9k=1, so k=91. The density is positive on [0,3]: it is indeed a density.
h)
∫1283x2dx=81[x3]12=88−1=87=0.875.
i)
E(X)=∫01x⋅2xdx=[32x3]01=32.
The expected value is not the midpoint 0.5 of the support: the density weighs more toward 1.
j)
E(X)=22+8=5 and V(X)=12(8−2)2=1236=3.
k)
F(m)=27m3=21 gives m3=13.5, so m=313.5=323≈2.38.
Points are earned before the solution; after it, you can keep practising.
For you:
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: The distribution of a discrete variable: the number of eggs per tree swallow nest
14 answers to check
A team of ornithologists monitors 200 nest boxes occupied by tree swallows during one breeding season. For each nest, it records the number X of eggs in the complete clutch. The counts (fictitious but plausible data) are given in the table and shown below.
A nest is chosen at random among the 200: the probability of each value of X is its relative frequency. X is a DISCRETE random variable: its values can be counted, and its distribution is drawn with bars.
Number of eggs x
3
4
5
6
7
Number of nests
10
30
70
64
26
a) Set up the probability distribution of X, then justify that it is indeed a probability distribution. Give P(X=6).
b) Compute F(5)=P(X≤5) and P(X<5).
c) Compute P(X≥6) and P(4<X≤6).
d) Compute the expected value E(X).
e) Compute E(X2), then the variance V(X) and the standard deviation σ(X).
f) Sketch the cumulative distribution function F of X. Give F(5.5) and the height of the jump of F at x=6.
g) Give the mode and the median of X. Is the expected value a value that X can take? Interpret E(X) for the team.
Show the solution
Answers
a)0.05; 0.15; 0.35; 0.32; 0.13, positive and adding up to 1; P(X=6)=0.32
b)F(5)=0.55; P(X<5)=0.20
c)P(X≥6)=0.45; P(4<X≤6)=0.67
d)E(X)=5.33 eggs
e)E(X2)=29.49; V(X)≈1.081; σ(X)≈1.04 egg
f)Step function; F(5.5)=0.55; jump of 0.32 at x=6
g)Mode 5, median 5; E(X)=5.33 is not a possible value: it is the long-run average per nest
These numbers are positive and 0.05+0.15+0.35+0.32+0.13=1: both conditions of a probability distribution are met.
In particular P(X=6)=20064=0.32.
b)
F(5)=P(X≤5)=0.05+0.15+0.35=0.55.
P(X<5)=P(X≤4)=0.05+0.15=0.20.
Pitfall: writing P(X<5)=P(X≤5). For a discrete variable, the value 5 alone carries 0.35: the strict inequality removes it. This equality will only hold for a continuous variable (exercise 3).
c)
By the complement: P(X≥6)=1−P(X≤5)=1−0.55=0.45.
P(4<X≤6)=P(X=5)+P(X=6)=0.35+0.32=0.67, or else F(6)−F(4)=0.87−0.20=0.67.
d)
The expected value is the average of the values weighted by their probabilities:
E(X)=3×0.05+4×0.15+5×0.35+6×0.32+7×0.13
E(X)=0.15+0.60+1.75+1.92+0.91=5.33 eggs.
Order-of-magnitude check: the value lies between the mode 5 and the next value 6, on the side of the main mass.
e)
E(X2)=9×0.05+16×0.15+25×0.35+36×0.32+49×0.13
E(X2)=0.45+2.40+8.75+11.52+6.37=29.49.
V(X)=E(X2)−E(X)2=29.49−28.4089=1.0811, so V(X)≈1.081.
σ(X)=1.0811≈1.04 egg: a typical deviation of about one egg around the mean.
Pitfall: rounding E(X) to 5.3 before squaring it gives 29.49−28.09=1.40, a 30% error. The formula E(X2)−E(X)2 subtracts two large, close numbers: keep E(X) exact.
f)
F(x)=P(X≤x) is defined for EVERY real number x. It equals 0 before 3, then it stays constant between two values and jumps at each value of X:
F=0.05 on [3,4), 0.20 on [4,5), 0.55 on [5,6), 0.87 on [6,7), and 1 from 7 on.
So F(5.5)=F(5)=0.55: no nest has 5.5 eggs, but the question “at most 5.5” makes sense.
The height of the jump at 6 is 0.87−0.55=0.32=P(X=6): in the discrete case, each jump of F IS a point probability. The filled dot marks the value taken at x=6, on the right of the jump.
g)
The mode is the most probable value: 5, with 0.35.
The median: F(4)=0.20<0.5 and F(5)=0.55≥0.5, so the median is 5.
E(X)=5.33 is not a possible number of eggs. It is interpreted in the long run: over a large number of comparable nests, the team can expect about 5.33 eggs per nest on average, roughly 1066 eggs for 200 nests.
Pitfall: reading the expected value as “the most probable number of eggs”. That is the role of the mode, and the two numbers differ here.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 2: Proving the properties of expected value and variance: mutations in a cloned gene
10 answers to check
A laboratory introduces random mutations into a gene of 1500 base pairs, clones the product and sequences each clone. The number X of point mutations in a clone follows the distribution below (model drawn from earlier sequencing runs, fictitious values).
In questions a) to c), X is ANY discrete variable with values x1,…,xn, probabilities p1,…,pn and expected value μ=E(X); a and b are two real numbers. Start from the definitions alone: E(X)=∑ixipi and V(X)=E((X−μ)2)=∑i(xi−μ)2pi.
k
0
1
2
3
P(X=k)
0.30
0.40
0.20
0.10
a) Prove that E(aX+b)=aE(X)+b.
b) Prove that V(X)=E(X2)−E(X)2.
c) Prove that V(aX+b)=a2V(X), then that σ(aX+b)=∣a∣σ(X).
d) For the gene under study, compute E(X), E(X2) and V(X).
e) Let Y=1500−X be the number of intact base pairs in a clone. Use c) to deduce E(Y), V(Y) and σ(Y).
f) Repairing a clone takes 2.5 hours per mutation, plus 1 hour of control sequencing, done in every case. Express the duration T in terms of X, then compute E(T), V(T) and σ(T).
g) A student claims that E(X2)=E(X)2 for every variable. Refute the claim with this gene, then use b) to justify that E(X2)≥E(X)2 in every case.
Show the solution
Answers
a)E(aX+b)=a∑xipi+b∑pi=aE(X)+b
b)Expand (xi−μ)2: V(X)=E(X2)−2μ2+μ2=E(X2)−μ2
c)(aX+b)−(aμ+b)=a(X−μ), hence V(aX+b)=a2V(X) and σ(aX+b)=∣a∣σ(X)
d)E(X)=1.1; E(X2)=2.1; V(X)=0.89
e)E(Y)=1498.9; V(Y)=0.89; σ(Y)≈0.94
f)T=2.5X+1; E(T)=3.75 h; V(T)=5.5625 h²; σ(T)≈2.36 h
g)Here 2.1=1.21; E(X2)−E(X)2=V(X)≥0, with equality only if X is constant
μ is a fixed NUMBER: it comes out of the sums. This is the computational formula; the definition is still the mean of the squared deviations.
c)
By a), E(aX+b)=aμ+b, so the deviation of aX+b from its mean is (axi+b)−(aμ+b)=a(xi−μ).
V(aX+b)=∑ia2(xi−μ)2pi=a2V(X).
Finally σ(aX+b)=a2V(X)=∣a∣σ(X), since a2=∣a∣.
Interpretation: adding b moves the whole distribution without spreading it; multiplying by a stretches the deviations by a factor ∣a∣, hence their squares by a factor a2.
d)
E(X)=0×0.3+1×0.4+2×0.2+3×0.1=1.1 mutations.
E(X2)=0+1×0.4+4×0.2+9×0.1=2.1.
V(X)=2.1−1.12=2.1−1.21=0.89.
e)
Y=−X+1500, with a=−1 and b=1500.
E(Y)=−1.1+1500=1498.9 intact pairs on average.
V(Y)=(−1)2×0.89=0.89 and σ(Y)=∣−1∣0.89≈0.94.
Pitfall: writing V(Y)=−0.89. Counting intact bases or mutated bases carries the same uncertainty: a variance is a mean of squares, it is never negative.
f)
T=2.5X+1 hours.
E(T)=2.5×1.1+1=3.75 h.
V(T)=2.52×0.89=6.25×0.89=5.5625 h² and σ(T)=2.5×0.89≈2.36 h.
Pitfall:V(T)=2.5×0.89+1=3.225. The constant 1 shifts every duration by the same hour without changing their spread, and the factor 2.5 acts squared. The figure of the solution shows it: same bar heights, gaps multiplied by 2.5.
g)
Here E(X2)=2.1 and E(X)2=1.21: the claim is false.
In general, b) gives E(X2)−E(X)2=V(X), and V(X)=∑(xi−μ)2pi is a sum of non-negative terms: E(X2)≥E(X)2.
Equality requires every term to be zero, that is xi=μ for every value of non-zero probability: X is constant. A truly random variable always has E(X2)>E(X)2.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 3: Density, conditions and normalizing constant: the diameter of hailstones in a storm
7 answers to check
After a storm, a meteorology team collects hail impacts on polystyrene plates and measures the diameter D, in centimetres, of each hailstone. For this storm, it adopts the following model: D is a CONTINUOUS random variable with density
f(x)=k(4−x)2 for 0≤x≤4, and f(x)=0 elsewhere, where k is a constant.
The figure shows the function x↦(4−x)2, that is f up to the factor k, and shades the region that corresponds to the event D≥2.
a) Show that k=643.
b) Check that f satisfies the non-negativity condition. Compute f(0), then explain why this number is not a probability.
c) Compute P(D≥2).
d) Compute P(1≤D≤3).
e) Compute P(D=2), then P(1<D<3). Compare with exercise 1, question b.
f) The team collected 320 hailstones. How many does it expect with a diameter of at least 2 cm? A colleague claimed that “half of the hailstones exceed 2 cm, since 2 is the midpoint of [0,4]”. Correct the claim.
Show the solution
Answers
a)∫04(4−x)2dx=364, so k=643
b)f≥0 everywhere; f(0)=0.75cm−1 is a density (probability per centimetre), not a probability
c)P(D≥2)=81=0.125
d)P(1≤D≤3)=3213≈0.4063
e)P(D=2)=0; P(1<D<3)=3213, as in d), whereas in the discrete case < and ≤ differed
f)40 hailstones; half are not above 2 cm: the density decreases, only 12.5% are there
a)
The total area under a density equals 1. With the substitution u=4−x (or a direct antiderivative):
∫04(4−x)2dx=[−3(4−x)3]04=0+364=364.
The condition k⋅364=1 gives k=643.
Pitfall: forgetting the minus sign in the antiderivative of (4−x)2 and finding a negative area, hence a negative k. The area under a positive curve is positive: a negative sign at this step signals the error.
b)
On [0,4], k>0 and (4−x)2≥0, so f(x)≥0; elsewhere f(x)=0. Both conditions of a density hold: f≥0 and ∫−∞+∞f(x)dx=1.
f(0)=643×16=43=0.75.
This number is a DENSITY, in cm−1: a probability per centimetre of diameter. It says that small diameters are the most concentrated, and over a small width, P(0≤D≤0.1) is roughly 0.75×0.1=0.075 (exactly 0.0731). A density can even exceed 1 (exercise 6).
This is the opposite of the discrete case: in exercise 1, removing the value 5 removed a bar of 0.35. Here, no single value carries any probability; only intervals do.
Pitfall: concluding that a 2 cm hailstone “does not exist”. P(D=2)=0 says that a diameter of EXACTLY 2.000… cm has probability zero; a diameter between 1.95 and 2.05 cm, on the other hand, has a positive probability.
f)
The team expects 320×81=40 hailstones of at least 2 cm.
The colleague's reasoning assumes a constant density, that of the uniform distribution. Here the density decreases from 0.75 to 0: the area to the right of 2 is only 81 of the total area, not half. The midpoint of the support is the median only for a symmetric density; the median is computed in exercise 4.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 4: Cumulative distribution function, median and quartile by integration: back to the hailstones
8 answers to check
We return to the diameter D, in centimetres, of the hailstones of exercise 3, with density f(x)=643(4−x)2 on [0,4] and zero elsewhere.
The CUMULATIVE DISTRIBUTION FUNCTION of D is F(x)=P(D≤x)=∫−∞xf(t)dt: the area accumulated under the density up to the abscissa x.
a) Show that F(x)=1−64(4−x)3 for 0≤x≤4. Give F(x) for x<0 and for x>4, then compute F(1).
b) Check that F′(x)=f(x) on (0,4) and that F is continuous at 0 and at 4.
c) Using F, compute P(D≤1.5) and P(0.5≤D≤1.5).
d) Find the median m of D, as an exact value and then to two decimal places.
e) Find the third quartile Q3, to two decimal places. Interpret it for the hailstones.
f) Compute the expected value E(D) by an integral, using the substitution u=4−x. Compare it with the median and say what the gap reveals about the distribution.
Show the solution
Answers
a)F(x)=0 if x<0, 1−64(4−x)3 on [0,4], 1 if x>4; F(1)=6437≈0.5781
b)F′(x)=643(4−x)2=f(x); F(0)=0 and F(4)=1 join the pieces
c)P(D≤1.5)≈0.7559; P(0.5≤D≤1.5)≈0.4258
d)m=4−332=4−234≈0.83 cm
e)Q3=4−316≈1.48 cm: three quarters of the hailstones have a diameter of at most 1.48 cm
f)E(D)=1 cm >m≈0.83 cm: tail stretched toward large diameters
a)
For 0≤x≤4: F(x)=∫0x643(4−t)2dt=643[−3(4−t)3]0x=641(64−(4−x)3)=1−64(4−x)3.
For x<0, no area has accumulated yet: F(x)=0. For x>4, all of it has: F(x)=1.
F(1)=1−6427=6437≈0.5781.
Pitfall: writing F(x)=1−64(4−x)3 for EVERY real x. For x=5 this formula gives 1.0156, a probability greater than 1: a cumulative distribution function is given piecewise.
b)
F′(x)=−643(4−x)2×(−1)=643(4−x)2=f(x): this is the fundamental theorem of calculus, the cumulative distribution function is an antiderivative of the density.
At 0: 1−6464=0, equal to the value on the left. At 4: 1−0=1, equal to the value on the right. F is continuous everywhere, without any jump: this is the signature of a continuous variable, in contrast with the staircase of exercise 1.
A single subtraction replaces an integral: that is the whole point of F.
d)
The median satisfies F(m)=21: 64(4−m)3=21, so (4−m)3=32.
4−m=332=234, hence m=4−234≈0.83 cm, which does belong to [0,4].
Check: F(0.83)≈1−643.173≈0.502. Half of the hailstones have a diameter below 8.3 mm.
e)
F(Q3)=43 gives (4−Q3)3=16, so Q3=4−316≈1.48 cm.
Three hailstones out of four have a diameter of at most 1.48 cm, and one in four exceeds it. The figure of the solution reads both quantiles off the graph of F: start from the height 0.5 or 0.75 and go down to the axis.
f)
E(D)=∫04x⋅643(4−x)2dx. With u=4−x, du=−dx, and the bounds 0 and 4 swap:
E(D)=1 cm, larger than the median 0.83 cm: a few large hailstones pull the mean up, whereas the median only looks at rank. The distribution is stretched toward large diameters (skewed to the right).
Pitfall: taking the midpoint of the support, 2 cm, or the “centre” of the figure, as the expected value. It is computed by integrating xf(x).
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 5: Expected value and variance by integration: the germination time of a meadow seed
11 answers to check
In a growth chamber, seeds of a meadow plant are sown at time t=0. Let T be the germination time of a seed, in days. A model fitted to earlier trials gives T the density
f(t)=k(t−1)(7−t)2 for 1≤t≤7, and f(t)=0 elsewhere.
In this model, no seed germinates before one day or after seven days. You may set u=t−1, which turns f into ku(6−u)2 on [0,6], and you may use without proof that the cumulative distribution function is F(t)=1081(18u2−4u3+4u4) for 1≤t≤7, with u=t−1.
a) Show that k=1081.
b) Find the mode of T, that is the abscissa of the maximum of f, by differentiation. Compute f(3) to two decimal places.
c) Compute the expected value E(T) by an integral.
d) Compute E(T2), then the variance V(T) and the standard deviation σ(T).
e) Compute F(3.3) and F(3.4). Deduce an interval that contains the median of T.
f) Compute P(T>E(T)). Order the mode, the median and the expected value, and explain why more than half of the seeds germinate before the mean time.
Show the solution
Answers
a)∫17(t−1)(7−t)2dt=108, so k=1081
b)f′(t)=108(7−t)(9−3t) vanishes at t=3: mode 3 days; f(3)=278≈0.30
c)E(T)=3.4 days
d)E(T2)=13; V(T)=1.44; σ(T)=1.2 days
e)F(3.3)≈0.4958<0.5<F(3.4)≈0.5248: median in [3.3,3.4]
f)P(T>3.4)≈0.4752; mode 3< median ≈3.31<E(T)=3.4: tail stretched toward long germination times
Pitfall: computing ∫tf(t)dt on [0,6] after the substitution without changing t into u+1. Either integrate tf(t) on [1,7], or uf on [0,6] and then add 1.
V(T)=V(U)=E(U2)−E(U)2=7.2−5.76=1.44, since a shift does not change the variance.
E(T2)=V(T)+E(T)2=1.44+11.56=13, and σ(T)=1.44=1.2 days.
Order-of-magnitude check: a uniform distribution on a 6-day support would have a standard deviation of 126≈1.73 days; our density, more concentrated around its peak, logically has a smaller one.
e)
For t=3.3, u=2.3: F(3.3)=10895.22−48.668+6.996≈0.4958.
For t=3.4, u=2.4: F(3.4)=108103.68−55.296+8.2944≈0.5248.
F is continuous and increasing, and 0.4958<0.5<0.5248: the median lies between 3.3 and 3.4 days (it is about 3.31).
f)
P(T>E(T))=1−F(3.4)≈1−0.5248=0.4752.
In order: mode 3< median ≈3.31< expected value 3.4. The density rises quickly then falls slowly toward 7: a few late seeds lengthen the mean without moving the median much.
So 52.5% of the seeds germinate before the mean time. “The mean time” is neither the most frequent time nor the time that splits the seeds into two halves.
Pitfall: believing that P(T>E(T))=0.5 for every variable. It is true for a symmetric density, false as soon as the density is skewed.
Points are earned before the solution; after it, you can keep practising.
For you:
Part B: problems and reasoning (/50)
Exercise 6: The continuous uniform distribution proved: the hidden bias of an echo sounder that truncates
10 answers to check
A limnology team's boat maps the bottom of a lake. Its echo sounder displays the depth TRUNCATED to the decimetre below: the display 12.3 m means that the true depth is in [12.3,12.4), as the figure shows.
Let ε, in metres, be the display error: true depth minus displayed depth. With no other information, ε is modelled by the UNIFORM distribution on [0,0.1]: every centimetre beyond the display is equally plausible.
a) Let U be a variable with a uniform distribution on [a,b], where a<b. Give its density and check that it is a density. Prove with integrals that E(U)=2a+b and V(U)=12(b−a)2.
b) Give the density of the error ε on [0,0.1]. Its value exceeds 1: is this a contradiction? Justify.
c) Compute the expected value E(ε) and the standard deviation σ(ε), in metres.
d) Compute P(ε>0.08) and P(ε=0.05).
e) To correct the bias, the team adds 0.05 m to each displayed depth. The error becomes ε′=ε−0.05. Give the distribution of ε′, then E(ε′) and σ(ε′).
f) Compute P(∣ε′∣>0.04). Has the correction reduced the spread of the errors? Justify with a property from exercise 2.
Show the solution
Answers
a)f(x)=b−a1 on [a,b]; E(U)=2a+b; E(U2)=3a2+ab+b2; V(U)=12(b−a)2
b)f(x)=10m−1 on [0,0.1]; no: the area is 10×0.1=1
c)E(ε)=0.05 m; σ(ε)=120.1≈0.0289 m
d)P(ε>0.08)=0.2; P(ε=0.05)=0
e)ε′ uniform on [−0.05,0.05]; E(ε′)=0; σ(ε′)≈0.0289 m
f)P(∣ε′∣>0.04)=0.2; no: the correction removes the bias, not the spread
a)
The density is constant on [a,b] and zero elsewhere; the total area c(b−a)=1 forces c=b−a1. It is positive with integral 1: it is a density.
The formula V=E(X2)−E(X)2 proved in the discrete case in exercise 2 is proved the same way in the continuous case, by replacing the sum with the integral.
b)
f(x)=0.1−01=10m−1 for 0≤x≤0.1, and 0 elsewhere.
This is not a contradiction: 10 is a density, a probability PER METRE. The only constraint is on the area, and 10×0.1=1. A density exceeds 1 as soon as the support is shorter than one unit.
Pitfall: rejecting this model because “a probability cannot exceed 1”. No probability equals 10 here.
c)
By a) with a=0, b=0.1: E(ε)=0.05 m and V(ε)=120.01, so σ(ε)=120.1≈0.0289 m.
Interpretation: the device underestimates the depth by 5 cm on average. Truncation is not rounding: its errors are all positive, they never cancel out.
d)
P(ε>0.08)=∫0.080.110dx=10×0.02=0.2: the area of a rectangle, that of the dark band in the figure of the solution.
P(ε=0.05)=0: continuous variable, no isolated value carries any probability.
e)
If ε is uniform on [0,0.1], then ε−0.05 takes its values in [−0.05,0.05] with a density that is still constant: ε′ is uniform on [−0.05,0.05], dashed in orange on the figure.
The spread has not decreased: V(ε−0.05)=V(ε), the property V(aX+b)=a2V(X) with a=1 (exercise 2). The correction recentres the errors around zero; only a finer device, for instance to the centimetre, would reduce σ.
Pitfall: confusing accuracy and precision. Correcting the bias makes the measurement accurate on average; the precision, measured by σ, has stayed the same.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 7: Integration by parts and improper integrals: the dispersal distance of yellow birch seeds
10 answers to check
An isolated yellow birch in the middle of a logging cut disperses its seeds by wind. Let X be the distance, in metres, between the trunk and the point where a seed lands. A forest ecology team adopts the density model
f(x)=cxe−x/5 for x≥0, and f(x)=0 for x<0.
The factor x reflects the fact that few seeds fall right below the trunk, since the wind carries them away; the exponential, that very long distances are rare. You may use without proof that limA→+∞Ane−A/5=0 for every integer n≥0. The figure shows f with the value of c found in a).
a) Using integration by parts, show that ∫0Axe−x/5dx=25−(5A+25)e−A/5 for every A>0. Deduce that c=251.
b) Find by differentiation the most probable distance, that is the mode of X.
c) Deduce from a) that F(x)=1−(1+5x)e−x/5 for x≥0. Compute P(X≤5) and P(X>20).
d) With a second integration by parts, show that ∫0+∞x2e−x/5dx=250. Deduce the expected value E(X).
e) You may use without proof that ∫0+∞x3e−x/5dx=3750. Compute V(X) and σ(X).
f) Compute F(8) and F(9), then F(8.3) and F(8.4). Give the median to one decimal place and order the mode, the median and the expected value.
Show the solution
Answers
a)∫0Axe−x/5dx=25−(5A+25)e−A/5→25, so c=251
b)f′(x)=251(1−5x)e−x/5 vanishes at x=5: mode 5 m
c)P(X≤5)=1−2e−1≈0.2642; P(X>20)=5e−4≈0.0916
d)∫0+∞x2e−x/5dx=10×25=250; E(X)=10 m
e)E(X2)=150; V(X)=50 m²; σ(X)≈7.07 m
f)F(8)≈0.4751; F(9)≈0.5372; median ≈8.4 m; mode 5< median 8.4<E(X)=10
As A→+∞, Ae−A/5→0 and e−A/5→0: the improper integral ∫0+∞xe−x/5dx converges and equals 25.
f≥0, and the condition 25c=1 gives c=251=0.04.
Pitfall: integrating straight “to infinity” by replacing A with ∞. An improper integral is a LIMIT: compute on [0,A], then let A tend to +∞, citing the given limit.
b)
f′(x)=251(e−x/5−5xe−x/5)=251(1−5x)e−x/5.
The exponential is strictly positive: f′ has the sign of 1−5x, positive before 5, negative after. The maximum is at x=5: the most probable distance is 5 m.
f(5)=255e−1≈0.0736m−1, the peak of the figure.
c)
By a) with A=x: F(x)=251(25−(5x+25)e−x/5)=1−(1+5x)e−x/5.
P(X≤5)=F(5)=1−2e−1≈0.2642: barely more than one seed in four lands within 5 m.
P(X>20)=1−F(20)=5e−4≈0.0916: about 9% of the seeds travel beyond 20 m, the orange area of the figure.
Check: F(0)=1−1=0 and F(x)→1 as x→+∞, like every cumulative distribution function.
d)
Let u=x2, v′=e−x/5, so u′=2x, v=−5e−x/5:
∫0Ax2e−x/5dx=−5A2e−A/5+10∫0Axe−x/5dx.
As A→+∞, A2e−A/5→0 and the last integral tends to 25: ∫0+∞x2e−x/5dx=10×25=250.
E(X)=∫0+∞xf(x)dx=251∫0+∞x2e−x/5dx=25250=10 m.
e)
E(X2)=251∫0+∞x3e−x/5dx=253750=150.
V(X)=E(X2)−E(X)2=150−100=50 m² and σ(X)=50≈7.07 m.
The standard deviation is of the same order as the mean: seed dispersal is very spread out, as the long tail of the figure suggested.
f)
F(8)=1−2.6e−1.6≈0.4751 and F(9)=1−2.8e−1.8≈0.5372: the median lies between 8 and 9 m.
F(8.3)=1−2.66e−1.66≈0.4942 and F(8.4)=1−2.68e−1.68≈0.5005: the median lies between 8.3 and 8.4, very close to 8.4. To one decimal place, m≈8.4 m (more precisely 8.39 m).
The equation F(m)=0.5 has no algebraic solution: it is bracketed, as here, by the intermediate value theorem (F is continuous and increasing).
In order: mode 5 m < median ≈8.4 m < expected value 10 m. The right tail pulls the expected value beyond the median, as for the hailstones of exercise 4.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 8: Five claims to correct
10 answers to check
Each of the following five claims was found in a student's paper. Each one is FALSE. Say why, give the correct statement, and support the correction with a calculation taken from the previous exercises.
a) “For the seeds of exercise 5, f(3)≈0.30: so 30% of the seeds germinate exactly three days after sowing.”
b) “A probability density can never exceed 1.”
c) “The expected value of a random variable is its most probable value.”
d) “V(−X)=−V(X), and V(2.5X+1)=2.5V(X)+1.”
e) “For every random variable, P(X<a)=P(X≤a).”
Show the solution
Answers
a)P(T=3)=0; f(3) is a density: P(2.95≤T≤3.05)≈0.0296≈f(3)×0.1
b)False: the sounder's density is 10m−1; only the total area equals 1
c)False: distances, mode 5 m but E(X)=10 m; eggs, E(X)=5.33 is not even a possible value
d)V(aX+b)=a2V(X): V(1500−X)=0.89 and V(2.5X+1)=5.5625
e)True only in the continuous case; eggs: P(X<5)=0.20=P(X≤5)=0.55
a)
False. f(3) is a DENSITY, in probability per day, not a probability. For a continuous variable, P(T=3)=0.
What makes sense is the probability of an interval: P(2.95≤T≤3.05)=F(3.05)−F(2.95)≈0.0296.
This is roughly f(3)×0.1=0.0296: over a small width h, P(t≤T≤t+h)≈f(t)h. Correct statement: “about 3% of the seeds germinate within the tenth of a day centred on the third day”.
b)
False. The error of the sounder in exercise 6 has a density equal to 10m−1 on [0,0.1], and it is a genuine density: positive, with area 10×0.1=1.
Correct statement: a density is non-negative with a total integral equal to 1; its VALUE has no ceiling. It is the probabilities, hence the areas, that cannot exceed 1.
c)
False. The most probable value is the MODE. For the dispersal distances of exercise 7, the mode is 5 m and the expected value 10 m: twice as much.
For the eggs of exercise 1, E(X)=5.33 is not a possible number of eggs; its probability is zero.
Correct statement: the expected value is the weighted average of the values, the average value over a large number of repetitions; it coincides with the mode only in special cases, for example a symmetric density with a single peak.
d)
False twice. The property proved in exercise 2 is V(aX+b)=a2V(X).
V(−X)=(−1)2V(X)=V(X): for the mutations, V(1500−X)=0.89, not −0.89. A variance is a mean of squares: it is never negative.
V(2.5X+1)=6.25×0.89=5.5625, not 2.5×0.89+1=3.225: the constant spreads nothing, the factor acts squared.
e)
False in general. For the eggs of exercise 1, P(X<5)=0.20 whereas P(X≤5)=0.55: the difference is the bar P(X=5)=0.35.
Correct statement: P(X<a)=P(X≤a) for a CONTINUOUS variable, because P(X=a)=0 (exercise 3, question e); for a discrete variable, the equality fails as soon as a is a value of X.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 9: Full study: the dispersal model against field data, and the buffer zone to protect
13 answers to check
The following summer, the team of exercise 7 counts 400 yellow birch seedlings around the same isolated tree and measures the distance from each one to the trunk. Assume that every seedling comes from a seed of this tree. The counts by distance class are given below (fictitious data).
The goal is to find out whether the density model f(x)=25xe−x/5, with cumulative distribution function F(x)=1−(1+5x)e−x/5 for x≥0, describes these data, then to set the width of a buffer zone around the seed trees. The figure shows the model, cut along the classes of the table.
Distance (m)
[0,5)
[5,10)
[10,15)
[15,20)
[20,30)
30 or more
Observed count
103
128
86
44
31
8
Model probability
0.2642
?
0.2069
0.1076
?
0.0174
Expected count
105.7
?
82.7
43.0
?
6.9
a) Using F, compute the two missing probabilities of the model, P(5≤X<10) and P(20≤X<30).
b) Compute the two missing expected counts out of 400 seedlings, then check that the row of expected counts adds up to 400, up to rounding.
c) To compare the data with the density, draw the histogram of frequency densities: count divided by 400 and by the class width. Compute the height of the classes [5,10) and [20,30), and explain why we divide by the width.
d) Find the largest gap, in absolute value, between an observed count and the corresponding expected count. Is the model consistent with the data?
e) The management plan calls for a buffer zone of radius d around each seed tree, receiving 95% of the seeds according to the model. Compute F(23) and F(24), then find d to the nearest tenth of a metre.
f) Beyond the minimum of the course framework. Another common model is the exponential distribution with the same mean of 10 m, for which P(X>x)=e−x/10. Compute the expected count in the class [0,5) and the radius d′ that receives 95% of the seeds under this model.
g) Write the conclusion of the study in three sentences: the model adopted and why, the recommended buffer zone, the limitation of the approach.
c)400×5128=0.064 and 400×1031≈0.0078: the AREA of a rectangle must be the frequency
d)3.9 seedlings, class [5,10) (less than 3% of the expected count): consistent
e)F(23)≈0.9437; F(24)≈0.9523; d≈23.7 m
f)157.4 seedlings expected against 103 observed; d′=10ln20≈30.0 m
g)Model 25xe−x/5 adopted (gaps of a few seedlings, the exponential predicts 54 too many near the trunk); buffer zone of about 24 m; limitation: one tree, one season, comparison without a formal test
We divide by the width so that the AREA of each rectangle is the frequency of the class, just as the area under f is a probability. Without this division, the class [20,30), twice as wide, would look twice too tall.
The figure of the solution overlays the histogram and the density: both are read in the same unit, m−1. The last class, with no right endpoint, is not drawn: its 8 seedlings stay in the table.
The largest is 3.9 seedlings, in the class [5,10), less than 3% of the expected count. The gaps change sign from one class to the next, with no trend: these are plausible sampling fluctuations.
The model is consistent with the data. The chi-square goodness-of-fit test, in the chapter on regression and the chi-square test, will make this judgment rigorous; here we conclude without a test, and say so.
e)
F(23)=1−5.6e−4.6≈0.9437 and F(24)=1−5.8e−4.8≈0.9523: d lies between 23 and 24 m.
Narrowing down, F(23.7)≈0.9498<0.95 and F(23.8)≈0.9507>0.95: d≈23.7 m.
For a protection zone, round UP: a radius of 24 m guarantees at least 95% according to the model. Rounding to 23 m would cover only 94.4%.
f)
Exponential: P(X<5)=1−e−0.5≈0.3935, that is 400×0.3935≈157.4 seedlings expected near the trunk, against 103 observed: a gap of 54 seedlings.
e−d′/10=0.05 gives d′=10ln20≈30.0 m.
The two models have the same mean, and yet they differ by 6 m on the buffer zone. The exponential puts its maximum right below the trunk and has a heavier tail; the data contradict the first point. Choosing a model means confronting it with the data, not only with the mean.
g)
The density model 25xe−x/5 describes the observed dispersal well: its expected counts differ by at most 4 seedlings from the observations, whereas the exponential distribution with the same mean predicts 54 too many near the trunk.
According to this model, a buffer zone of radius 24 m around each seed tree receives at least 95% of the seeds.
This conclusion rests on a single tree, a single season and seedlings rather than seeds; it needs to be confirmed on other trees and by a goodness-of-fit test.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 10: Problem: observing once a day turns a continuous duration into a discrete variable
11 answers to check
We return to the germination time T, in days, of exercise 5, with density f(t)=1081(t−1)(7−t)2 on [1,7], expected value 3.4 days and variance 1.44.
In the laboratory, the technician does not watch the seeds continuously, but examines them once a day, at the time of sowing. A seed that germinates at time T is recorded as germinated at the first examination that follows, on day N, the smallest integer greater than or equal to T. Thus T=2.4 gives N=3. The figure cuts the density of T day by day, and the table gives the cumulative distribution function F of T at whole days.
t
1
2
3
4
5
6
7
F(t)
0
0.1319
0.4074
0.6875
0.8889
0.9838
1
a) Explain why N is a discrete variable, and give the number of its possible values.
b) Justify that P(N=k)=F(k)−F(k−1). Compute P(N=3) and P(N=4).
c) Set up the complete distribution of N, check that it is a probability distribution, then compute E(N).
d) Compute V(N) and compare it with V(T).
e) Compute the gap E(N)−E(T). Explain this gap by relating it to exercise 6, then give the estimate of E(T) that the technician should publish from E(N).
f) Find the median of N. Does the daily protocol make it possible to tell whether the median of T is less than 3.5 days?
g) The laboratory switches to an examination every 12 hours. Compute F(3.5) and conclude about the median of T. Write a two-sentence recommendation.
Show the solution
Answers
a)N takes only whole values: 2, 3, 4, 5, 6, 7, that is 6 values
b){N=k}={k−1<T≤k}; P(N=3)≈0.2755; P(N=4)≈0.2801
c)0.1319; 0.2755; 0.2801; 0.2014; 0.0949; 0.0162, adding up to 1; E(N)≈3.90 days
d)V(N)≈1.52>V(T)=1.44
e)Gap ≈0.50 day: the observation delay, like the sounder's truncation; estimate E(N)−0.5≈3.40 days
f)Median of N: 4; no, we only know that the median of T is in (3,4)
g)F(3.5)≈0.5534>0.5: median of T less than 3.5 days; examine every 12 h and correct the bias by half a period
a)
N is a WHOLE number of days: between two consecutive values, there is no other one. It is a discrete variable, built from a continuous variable.
T is in (1,7] (a seed that would germinate exactly at t=1 has probability zero), so N∈{2,3,4,5,6,7}: six values.
b)
By definition of N, N=k exactly when k−1<T≤k. So P(N=k)=P(k−1<T≤k)=F(k)−F(k−1).
P(N=3)=0.4074−0.1319=0.2755 and P(N=4)=0.6875−0.4074=0.2801.
Each bar of N is an AREA of T: that of a one-day band on the figure. This is the thread of the set, seen in both directions at once.
V(N)=E(N2)−E(N)2≈16.734−15.214≈1.52, with E(N) unrounded.
V(N) slightly exceeds V(T)=1.44: rounding to the whole day adds its own spread, of about 121≈0.08 day², the variance of a uniform distribution on an interval of length 1 (exercise 6).
e)
E(N)−E(T)≈3.9005−3.4=0.50 day.
The delay R=N−T lies between 0 and 1 day, and is spread roughly uniformly: on average, a seed waits half a day before being seen. This is the same bias as the truncation of the sounder in exercise 6, reversed: there, the display rounded down; here, the observation rounds up.
The corrected estimate is E(N)−0.5≈3.40 days, within 0.0005 day of the true value.
Pitfall: publishing 3.9 days as the mean germination time. The number measures the protocol as much as the seeds.
f)
P(N≤3)=0.4074<0.5 and P(N≤4)=0.6875≥0.5: the median of N is 4.
For T, we only know that F(3)<0.5<F(4): its median is in (3,4). The daily protocol cannot place it relative to 3.5 days.
g)
With u=2.5 in the formula of exercise 5: F(3.5)=108112.5−62.5+9.765625≈0.5534>0.5.
With an examination at t=3.5, the team sees that more than half of the seeds have germinated: the median of T is less than 3.5 days (it is about 3.31).
Recommendation: examine the seeds every 12 hours, which locates the median and halves the observation bias. Then publish the mean time corrected by half a period, not the raw mean of the recorded days.
Points are earned before the solution; after it, you can keep practising.
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.
This chapter comes back in
The chapters that build on it, later in the year or in the years that follow.
Looking for a 201-SN1-RE probability and statistics tutor in Montreal?
Get in touch for a first session. Random variables are the chapter where integral calculus meets probability: marks are lost by reading a density as a probability far more often than by integrating.