MATH 236
Engineering Statistics
Week 4: Student Workbook
Probability and Random Variables:
From Counting Outcomes to Areas Under Curves
Textbook Reference: Montgomery & Runger, 7th Ed., Chapters 2–4 (2.1–2.8, 3.1–3.3, 4.1–4.4)
This Week’s Learning Outcome:
“Apply the axioms and rules of probability, including conditional probability, independence and Bayes’ theorem; define a random variable as a function on a sample
space and distinguish the discrete and continuous cases; and compute probabilities,
means and variances from probability mass functions, probability density functions
and cumulative distribution functions.”
Sessions this week
1. Probability and its postulates; conditional probability and Bayes (2.1–2.8)
2. Random variables; discrete distributions, mean and variance (2.9, 3.1–3.3)
3. Continuous random variables; density, distribution, probability as area (4.1–
4.4)
Each session ends with You Try It! (in class) and Extra Practice (on your own).
Student Workbook
Student Name:
Student ID:
Section:
Date:
Learning Outcomes for This Week
After completing this week’s material, you will be able to:
✓ State the axioms of probability and use the addition rule and the complement rule
✓ Compute conditional probabilities and apply the multiplication and total probability
rules
✓ Test two events for independence, and distinguish independence from mutual exclusivity
✓ Apply Bayes’ theorem to invert a conditional probability
✓ Define a random variable as a function from the sample space to the real numbers, and
classify it as discrete or continuous
✓ Build a probability mass function and its cumulative distribution function, and check
that the probabilities sum to 1
✓ Compute E(X) and V (X) for a discrete random variable, using V (X) = E(X 2 ) − µ2
∫︁
✓ State the properties of a probability density function and use f (x) dx = 1
✓ Compute probabilities as areas: P (a ≤ X ≤ b) = F (b) − F (a), and explain why
P (X = x) = 0
✓ Compute the mean and variance of a continuous random variable, and use the continuous uniform distribution
Chapter Objectives Addressed (Montgomery & Runger 2–4):
“To interpret probabilities and use the rules of probability to calculate probabilities of events; to
determine probabilities and probability mass functions, and calculate means and variances for
discrete random variables; and to determine probabilities from probability density functions
and cumulative distribution functions, and calculate means and variances for continuous
random variables.”
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Contents
Contents
1 Session 1 – Probability and Its Postulates
1.1 Probability and Its Postulates . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Conditional Probability and Independence . . . . . . . . . . . . . . . . . .
1.3 Total Probability and Bayes’ Theorem . . . . . . . . . . . . . . . . . . . . .
2 Session 2 – Random Variables and Discrete Distributions
2.1 What a Random Variable Is . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Probability Mass Functions and Cumulative Distribution Functions . . . .
2.3 Mean and Variance of a Discrete Random Variable . . . . . . . . . . . . . .
3 Session 3 – Continuous Random Variables
3.1 Continuous Random Variables and Densities . . . . . . . . . . . . . . . . .
3.2 Mean and Variance of a Continuous Random Variable . . . . . . . . . . . .
3.3 The Continuous Uniform Distribution . . . . . . . . . . . . . . . . . . . . .
Diagnostic Check
Collaborative Concept Map
Homework
Formula Card
2 / 27
3
3
4
5
9
9
11
12
16
16
17
18
21
22
23
27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
1
Session 1 – Probability and Its Postulates
1.1
Probability and Its Postulates
Probability and its postulates
1
Certain
Probability — the chance that an uncertain event
will occur (always between 0 and 1).
.5
0 ≤ P (A) ≤ 1
for any event A
Impossible
0
Sample Space, Event, and the Axioms
A random experiment is one that can result in different outcomes even though it is
repeated in the same manner. The sample space S is the set of all possible outcomes. An
event is a
of the sample space.
Axioms of probability. Probability is a number assigned to each event such that
(1) P (S) =
, where S is the sample space;
(2) 0 ≤ P (E) ≤ 1 for any event E;
(3) for two events with E1 ∩ E2 = ∅, P (E1 ∪ E2 ) = P (E1 ) + P (E2 ).
Consequences. P (∅) = 0; P (A′ ) = 1 −
;
and if A ⊆ B then P (A) ≤ P (B).
Addition Rule
For any two events A and B,
P (A ∪ B) = P (A) + P (B) − P (A ∩ B).
The intersection is subtracted because the outcomes in A ∩ B have been counted
.
If A and B are mutually exclusive (they cannot both occur), then P (A ∩ B) = 0 and the
rule reduces to P (A ∪ B) = P (A) + P (B).
S
A
B
A∩B
3 / 27
MATH 236 – Engineering Statistics
1.2
Week 4: Probability and Random Variables
Conditional Probability and Independence
Conditional Probability
The conditional probability of B given A is
P (B | A) =
P (A ∩ B)
,
P (A)
P (A) > 0.
Read it as a renormalisation: once A is known to have occurred, A becomes the new
sample space, so the probability of A ∩ B is re-expressed as a fraction of P (A) rather than
of 1.
Rearranging gives the multiplication rule:
P (A ∩ B) = P (B | A) P (A) = P (A | B) P (B).
Independence
Two events are independent if any one of these equivalent statements holds:
(1) P (A | B) = P (A),
(2) P (B | A) = P (B),
(3) P (A ∩ B) = P (A) P (B).
Statement (3) is the one to test with, because it needs no division and is symmetric.
Independent is not the same as mutually exclusive. Mutually exclusive means A∩B = ∅,
which makes the events maximally dependent: if A occurs, B certainly did not.
Example 1 – Contaminated Wafers
Of 100 wafers, 20 have high particle contamination (A), 15 have high metal impurity (B),
and 5 have both.
(a) P (A) =
,
P (B) =
,
P (A ∩ B) =
.
(b) At least one defect type:
P (A ∪ B) = 0.20 + 0.15 −
=
(c) Given high contamination, the chance of also having high metal impurity:
P (B | A) =
P (A ∩ B)
0.05
=
=
P (A)
(d) Independent? P (A)P (B) = 0.20 × 0.15 =
differ, A and B are
.
, but P (A ∩ B) = 0.05. Since these
Engineering reading: P (B | A) = 0.25 against P (B) = 0.15 — a wafer with contamination
is more likely to also have impurity, which points at a shared upstream cause worth
investigating.
4 / 27
MATH 236 – Engineering Statistics
1.3
Week 4: Probability and Random Variables
Total Probability and Bayes’ Theorem
Total Probability Rule and Bayes’ Theorem
If E1 , E2 , . . . , Ek are mutually exclusive and exhaustive, then for any event B,
P (B) = P (B | E1 )P (E1 ) + P (B | E2 )P (E2 ) + · · · + P (B | Ek )P (Ek ).
Bayes’ theorem then inverts the conditioning:
P (Ei | B) =
P (B | Ei ) P (Ei )
.
P (B)
In the two-event case this is
P (A | B) =
P (B | A)P (A)
.
P (B | A)P (A) + P (B | A′ )P (A′ )
Example 2 – An Automated Inspection Test
An automated vision system inspects parts. It flags 98% of genuinely defective parts, and it
also falsely flags 3% of good parts. In this process 2% of parts are defective.
Let D be the event “part is defective” and + the event “test flags the part”. Then
P (+ | D′ ) =
P (+ | D) = 0.98,
P (D) = 0.02,
.
Step 1 — total probability of a flag:
P (+) = 0.98(0.02) + 0.03(
) = 0.0196 + 0.0294 =
Step 2 — invert with Bayes:
P (D | +) =
0.0196
=
The result to remember. A test that catches 98% of defects is right only
of the
times it fires. The reason is that good parts vastly outnumber defective ones, so even a
small false-alarm rate produces more false flags (0.0294) than true ones (0.0196).
5 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Engineering Application – Where These Rules Actually Get Used
1. System reliability. Components in series all have to work, so if they fail independently
the system reliability multiplies:
Rseries = R1 R2 · · · Rk .
Three components at R = 0.99 give 0.993 = 0.970 — the system is markedly worse than
any of its parts. Components in parallel (redundancy) fail only if all fail:
Rparallel = 1 − (1 − R1 )(1 − R2 ) · · ·
Two components at R = 0.90 give 1 − 0.102 = 0.99. This is why redundancy is designed
into aircraft systems, dialysis machines and data centres — and why the independence
assumption must be checked, since a shared power supply makes the failures dependent
and the calculation wrong.
2. Diagnostic and screening tests. Example 2 is exactly the structure of a clinical
screening test: P (+ | D) is the sensitivity, P (− | D′ ) the specificity, and P (D) the
prevalence. The quantity a clinician actually needs is P (D | +), the positive predictive
value, and it depends strongly on prevalence. Screening a low-prevalence population with
an excellent test still produces mostly false positives — which is why confirmatory testing
exists.
3. Acceptance sampling. “What is the probability this lot passes inspection if it is 5%
defective?” is a multiplication-rule calculation, and it is the basis of every sampling plan in
a supplier agreement.
4. Fault trees. A fault-tree analysis is the addition and multiplication rules applied to a
diagram of failure modes; each AND gate is a product and each OR gate is an addition
rule.
Common Misconception
× Independent versus mutually exclusive. Exclusive events with positive probability
are always dependent.
× Using P (A ∪ B) = P (A) + P (B) when the events can occur together — the overlap
gets counted twice.
× Confusing P (A | B) with P (B | A). These are different numbers, and Example 2
shows how different: 0.98 versus 0.40.
× Multiplying reliabilities without checking the independence assumption.
× Forgetting the prevalence term in Bayes and reporting the sensitivity as though it
answered the question.
6 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
You Try It! – Session 1
P1. In a batch of 200 castings, 30 have a surface flaw, 18 have a dimensional error, and 7
have both. Find P (A ∪ B), P (B | A), and decide whether the two defect types are
independent.
P2. A system has four components in series, each with reliability 0.98 and failing independently. Find the system reliability. How many components could you have before
reliability falls below 0.90?
P3. A screening assay has sensitivity 0.95 and false-positive rate 0.02. The condition
affects 1% of the population. Find P (condition | +).
P4. Give an example of two events that are mutually exclusive, and one of two events
that are independent. Explain why no pair of events with positive probability can be
both.
7 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Extra Practice – Session 1
E1. P (A) = 0.4, P (B) = 0.5, P (A ∪ B) = 0.7. Find P (A ∩ B), P (A | B) and P (B | A),
and test for independence.
E2. A pump station has two pumps in parallel, each with reliability 0.85, and they are
followed by a single valve with reliability 0.97. All fail independently. Find the
reliability of the whole station.
E3. Three suppliers provide 50%, 30% and 20% of a component. Their defective rates are
1%, 3% and 4%. Find the overall defective rate, and the probability that a defective
unit came from supplier 3.
E4. Explain why P (D | +) in Example 2 would rise if the process defect rate rose from
2% to 20%. Recompute it to confirm.
E5. A safety system has two independent sensors, each detecting a hazard with probability
0.90. The alarm sounds if at least one fires. Find the detection probability, and state
what assumption would be violated if both sensors shared a power supply.
8 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
2
Session 2 – Random Variables and Discrete Distributions
2.1
What a Random Variable Is
Definition of a random variable — coin flips
A random variable assigns a numerical value to each outcome in a sample space. Random
variables are ways to map outcomes of random processes to real numbers.
Quantify the outcomes when you flip a coin twice; let Y be the total number of heads.
S
TT
HT
TH
HH
Real number
0
1
1
2
Notation. The random variable is written with a capital letter,
value it takes is written with a lower-case letter,
.
; a particular numerical
Definition of a random variable — balls in a box
A random variable is a function that assigns each subset of the sample space to a real
value.
Four white and six black balls are in a box; two balls are selected.
{W W, W B, BW, BB}. Let X be the number of black balls.
S
WW
WB
BW
BB
P (W W ) = P (X = 0)
P (BW or W B) = P (X = 1)
P (BB) = P (X = 2)
Then S =
Real number
0
1
1
2
Note. Two different outcomes, W B and BW , map to the same value x = 1. A random
variable is therefore not required to be one-to-one — and that is precisely why P (X = 1)
is built by
the probabilities of all outcomes that map to 1.
Definition of a random variable — several on one sample space
A random variable assigns a numerical value to each outcome in a sample space.
Several random variables can be defined on the same sample space. For a newborn
baby:
• X: the weight of a newborn baby (kg)
• Y : the length of a newborn baby (cm)
The outcome — one particular birth — is the same in both cases. What differs is the
applied to it, and each rule is a different random variable.
9 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Definition of a random variable — a function from the sample space to R
Mathematically, a random variable is a function from the sample space to the real
numbers.
Counting rules (X)
Measuring rules (Y )
X: the number of defective products
Y : the weight of a newborn baby
X: the number of COVID-19 cases in
Turkey
Y : the proportion of defective products
in a production line
X: the number of deaths in Turkey
Y : the duration of quarantine because
of the pandemic
Random variables are classified into two groups:
•
•
Look at the two columns above and say which group each belongs to before reading on.
Everything in the left column is a
; everything in the right is a
.
Discrete random variables
Definition. A random variable is discrete if its possible values form a discrete set. This
means that if the possible values are arranged in order, there is a
between each
value and the next one.
The set of possible values may be infinite; for example, the set of all integers is a discrete
set.
Note the continuity with Week 1: this is the same discrete/continuous distinction used there
to classify data. Here it classifies the model that generated the data.
10 / 27
MATH 236 – Engineering Statistics
2.2
Week 4: Probability and Random Variables
Probability Mass Functions and Cumulative Distribution Functions
Probability Mass Function and cdf (Discrete Case)
For a discrete random variable X with possible values x1 , x2 , . . . , xn , the probability mass
function is
f (xi ) = P (X = xi ),
and it must satisfy
(1) f (xi ) ≥ 0,
(2)
n
∑︂
f (xi ) =
.
i=1
The cumulative distribution function is
F (x) = P (X ≤ x) =
∑︂
f (xi ),
xi ≤x
a
function that is non-decreasing, with F (−∞) = 0 and F (+∞) = 1.
Example 3 – The Box of Balls, Made Quantitative
Four white and six black
(︁ )︁balls; two are drawn without replacement; X is the number of
black balls. There are 10
2 = 45 equally likely pairs.
(︁4)︁
6
=
=
f (0) =
45
45
2
Check:
(︁6)︁
24
4×6
=
=
f (1) =
45
45
,
2
8
5
+
+
=
15 15 15
,
— always do this.
The cumulative distribution function.
⎧
⎪
0,
⎪
⎪
⎪
⎨
F (x) =
⎪
⎪
⎪
⎪
⎩
x<0
, 0≤x<1
, 1≤x<2
,
x≥2
1
F (x)
10/15
2/15
0
1
x
11 / 27
2
f (2) =
2
45
=
15
=
45
MATH 236 – Engineering Statistics
2.3
Week 4: Probability and Random Variables
Mean and Variance of a Discrete Random Variable
Expected Value and Variance
µ = E(X) =
∑︂
x f (x),
σ 2 = V (X) =
∑︂
(x − µ)2 f (x) = E(X 2 ) − µ2 .
x
x
E(X) is the long-run average value of X over many repetitions — the balance point of
the distribution, exactly as x was the balance point of a data set in Week 2.
These are population quantities. They are computed from a model, not from data. In
Week 8 you will estimate them from a sample; the symbols µ and σ 2 are the same ones
Week 1 introduced as parameters.
Example 4 – Mean and Variance for the Box of Balls
µ = E(X) = 0 ·
2
8
5
+1·
+2·
=
=
15
15
15
15
(︁ )︁
2
8
5
E X 2 = 02 ·
+ 12 ·
+ 22 ·
=
= 1.8667
15
15
15
15
(︁ )︁
σ 2 = E X 2 − µ2 = 1.8667 − (1.20)2 = 1.8667 −
√
σ = 0.4267 =
=
Sanity check: µ = 1.2 is sensible — six of the ten balls are black, so two draws should yield
about 2 × 0.6 = 1.2 black balls on average.
12 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Engineering Application – Expected Value Is a Budget
Expected value is not an abstraction; it is the number that goes into a cost model.
1. Expected cost of defects. If X is the number of defective units in a daily production
run with E(X) = 14, and each defect costs 85 in rework and scrap, the expected daily cost
is 85 × 14 = 1190. That figure is what justifies — or fails to justify — a 200,000 process
improvement.
2. Expected number of inspections. In an acceptance-sampling plan, the expected
number of units inspected per lot determines the inspection labour budget.
3. Warranty reserves. If X is the number of warranty claims per thousand units sold,
E(X) times the cost per claim is the reserve that must be carried on the balance sheet.
Getting E(X) wrong is a financial-reporting problem, not just an engineering one.
4. And why the variance matters too. Two processes with the same E(X) = 14 defects
but σ = 2 and σ = 9 are very different to manage: the second one will occasionally deliver
a day with 35 defects, which may exceed the rework capacity entirely. As in Week 2, a
mean without a spread is half a summary — and here the spread determines how much
buffer capacity must be built.
Common Misconception
× Confusing X (the function) with x (a value it takes). P (X = x) needs both.
× Forgetting to check that the pmf sums to 1. If it does not, something is missing or
double-counted.
× Adding probabilities for outcomes that overlap. In the ball example W B and BW
are distinct
∑︁ outcomes, so they add.
∑︁
× Using
xf (x) but then computing the variance as (x − µ)2 without the f (x)
weights.
× Treating µ and σ 2 here as sample quantities. They are parameters of a model.
13 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
You Try It! – Session 2
P5. The number of flaws X on a panel has f (0) = 0.45, f (1) = 0.30, f (2) = 0.15,
f (3) = 0.10. Verify it is a valid pmf, then find F (2), P (X ≥ 2), E(X) and V (X).
P6. A random variable has f (x) = c x for x = 1, 2, 3, 4. Find c, then E(X).
P7. Two components are tested; each is defective with probability 0.1, independently.
Let X be the number of defectives. Build the pmf and find E(X).
P8. Explain in one sentence why E(X) need not be a value that X can actually take,
using P5 as your example.
14 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Extra Practice – Session 2
E6. A shipment of 12 items contains 3 defectives. Two are chosen at random without
replacement; X is the number of defectives drawn. Build the pmf, verify it sums to 1,
and find E(X) and V (X).
E7. For the pmf of E6, write out F (x) completely and sketch it.
E8. A daily production run has E(X) = 14 defects with σ = 3; rework costs 85 per defect.
State the expected daily rework cost, and explain what the σ adds to the planning
decision.
E9. A random variable takes the values −2, 0, 2 with equal probability. Find E(X) and
V (X), and comment on what this shows about a mean of zero.
E10. Show algebraically that
this mirrors.
∑︁
(x−µ)2 f (x) = E(X 2 )−µ2 , and say which Week-2 formula
15 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
3
Session 3 – Continuous Random Variables
3.1
Continuous Random Variables and Densities
Continuous Random Variable
A continuous random variable is a variable that can assume any value in an interval: the
thickness of an item, the time required to complete a task, the temperature of a solution, a
height. These can potentially take on any value, depending only on the ability to measure
accurately.
Probability density function — properties
The probability density function f (x) of a random variable X has the following properties.
1. f (x) > 0 for all values of x.
2. The area under the probability density function f (x) over all values of the random
variable X is equal to
.
3. The probability that X lies between two values is the
function graph between the two values.
under the density
4. The cumulative distribution function F (x0 ) is the area under f (x) from the minimum
value of x up to x0 :
∫︂
x0
F (x0 ) =
f (x) dx,
−∞
Cumulative distribution function
The cumulative distribution function F (x) for a continuous random variable X expresses
the probability that X does not exceed the value x:
F (x) = P (X ≤ x).
Let a and b be two possible values of X with a < b. The probability that X lies between a
and b is
P (a ≤ X ≤ b) = F (b) − F (
).
Probability as an area
f (x)
P (a ≤ x ≤ b)
= P (a < x < b)
(Note that the probability
of any individual value is
zero)
a
b
x
The shaded area under the curve is the probability that X is between a and b. Because
a single point has zero width, P (X = x) =
for every x, and therefore the endpoints
make no difference: P (a < X < b) = P (a ≤ X ≤ b).
16 / 27
MATH 236 – Engineering Statistics
3.2
Week 4: Probability and Random Variables
Mean and Variance of a Continuous Random Variable
Mean and Variance, Continuous Case
∫︂ ∞
µ = E(X) =
∫︂ ∞
2
x f (x) dx,
σ = V (X) =
(︁ )︁
(x − µ)2 f (x) dx = E X 2 − µ2 .
−∞
−∞
∑︁
These are the discrete formulas with
replaced by
and the pmf replaced by the
2
2
density. The identity V (X) = E(X ) − µ holds in both cases and is almost always the
easier route.
Example 5 – A Task-Time Density
The time X (hours) to complete a maintenance task has density
f (x) =
x
,
8
0 ≤ x ≤ 4,
and f (x) = 0 elsewhere.
(a) Check it is a valid density.
∫︂ 4
0
[︃ 2 ]︃4
16
x
x
=
dx =
=
8
16 0 16
✓
(b) The cdf. For 0 ≤ x ≤ 4,
∫︂ x
F (x) =
0
t
dt =
8
with F (x) = 0 for x < 0 and F (x) = 1 for x > 4.
(c) Probability the task takes between 1 and 3 hours.
P (1 ≤ X ≤ 3) = F (3) − F (1) =
(d) Mean.
1
9
−
=
=
16 16
16
[︃ 3 ]︃4
x
x
64
=
µ=
x · dx =
=
8
24 0 24
0
∫︂ 4
(e) Variance.
(︁
E X
2
)︁
hours
[︃ 4 ]︃4
x
x
=
=
x · dx =
8
32 0
0
∫︂ 4
2
σ 2 = 8 − (2.667)2 = 8 − 7.111 =
,
σ=
hours
Reading it: the density increases with x, so long tasks are more likely than short ones and
the mean sits well above the midpoint of the interval.
17 / 27
MATH 236 – Engineering Statistics
3.3
Week 4: Probability and Random Variables
The Continuous Uniform Distribution
Continuous Uniform Distribution
X is uniform on [a, b] if
f (x) =
Then
F (x) =
1
,
b−a
x−a
(a ≤ x ≤ b),
b−a
a ≤ x ≤ b.
µ=
a+b
,
2
σ2 =
(b − a)2
.
It models a quantity equally likely to fall anywhere in an interval — rounding error, the
phase of an arriving signal, the position of a random cut.
Example 6 – Current in a Wire
The current X in a thin copper wire is uniform on [4.9, 5.1] mA.
1
=
per mA — a density greater than 1, and perfectly valid.
5.1 − 4.9
5.0 − 4.9
(b) P (X < 5.0) =
=
0.2
5.05 − 4.95
(c) P (4.95 ≤ X ≤ 5.05) =
=
0.2
4.9 + 5.1
(0.2)2
=
=
(d) µ =
mA, σ 2 =
, σ=
mA.
2
12
(a) f (x) =
18 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
You Try It! – Session 3
P9. For f (x) = 3x2 on 0 ≤ x ≤ 1: verify it is a valid density, find F (x), and compute
P (0.5 ≤ X ≤ 1).
P10. For the density of P9, find µ and σ 2 .
P11. A shaft diameter is uniform on [24.95, 25.05] mm. The specification is 24.96–25.04
mm. Find the fraction of shafts that conform.
P12. Explain why P (X = 5.00) = 0 for a continuous random variable, yet a machine does
produce parts recorded as 5.00 mm.
19 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Extra Practice – Session 3
E11. Find c so that f (x) = c(1 − x) is a valid density on 0 ≤ x ≤ 1. Then find F (x), µ and
σ2.
E12. The lifetime X (thousands of hours) of a sensor has F (x) = 1 − e−x/2 for x ≥ 0.
Find f (x), then P (X > 3) and the median lifetime.
E13. A rounding error is uniform on [−0.5, 0.5] units. Find µ, σ 2 and P (|X| > 0.4).
E14. A filling process has fill volume with density concentrated on [9.8, 10.2] mL, uniform.
The specification is 9.85–10.15 mL. Find the out-of-specification fraction, and state
what change to the density would halve it.
E15. Explain, referring to Week 3’s Figure 1.7, the precise sense in which a relativefrequency histogram “becomes” a probability density function, and what quantity is
preserved in the limit.
20 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Diagnostic Check
Diagnostic Check – One Item from Each Session
No calculator, no notes. Mark TRUE or FALSE. Every item here was settled somewhere in
the three sessions above — if any of them is not automatic, go back and find where it was
defined before attempting the homework.
1. P (A) can equal 1.4.
4. For a continuous X, P (X = 3) = 0. T
/F
T/F
2. Mutually exclusive events are independent.
T/F
3. P (A ∪ B) = P (A) + P (B) always. T /
F
21 / 27
5. f (x) can exceed 1.
T/F
6. F (x) is never decreasing.
T/F
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Collaborative Concept Map – Complete in Groups
From Outcomes to Areas
Fill every blank, then answer the two group tasks.
Sample space S
outcomes of the experiment
Random variable X
S→R
a
gaps
intervals
Continuous
pdf
f (x), with
∫︁
f (x) dx =
Discrete
pmf
∑︁ f (x), with
f (x) =
P (X = x) is a
number
P (X = x) =
probability is an
;
Group task 1: both branches compute a mean by the same idea. Write the two
formulas side by side and state, in one sentence, what changes and what does not.
Group task 2: in the continuous branch P (X = x) = 0 for every x, yet X certainly takes
some value. Resolve this in two sentences.
22 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Homework – Week 4
Homework Instructions
Due: Beginning of Week 5 class.
Show all work. Define the events or the random variable in words before computing.
For every distribution, verify that the probabilities sum (or integrate) to 1 before using it.
State the units of every mean and standard deviation.
Part A – Probability Rules
1. State the three axioms of probability and derive P (A′ ) = 1 − P (A) from them.
2. P (A) = 0.35, P (B) = 0.45, P (A ∩ B) = 0.15. Find P (A ∪ B), P (A | B), P (B | A) and
P (A′ ∩ B ′ ).
3. Explain the difference between mutually exclusive and independent events, and prove that
two events with positive probability cannot be both.
4. A system has three independent components in series with reliabilities 0.97, 0.95 and 0.99.
Find the system reliability. Then find it if a second, identical copy of the weakest component
is added in parallel with it.
5. A blood test for a marker has sensitivity 0.99 and specificity 0.96. The marker is present in
0.5% of the population. Find the probability that a person who tests positive actually has
the marker, and comment.
23 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Part B – Random Variables and Discrete Distributions
6. Define a random variable precisely, and explain the roles of the symbols X and x.
7. Classify as discrete or continuous, with a reason: (a) number of contaminated wells in a
plate; (b) tensile strength of a bar; (c) number of arrivals at a service desk in an hour; (d)
time between two arrivals.
8. A pmf is given by f (x) = k(4 − x) for x = 0, 1, 2, 3. Find k, tabulate the pmf, write F (x),
and compute E(X) and V (X).
9. Three parts are inspected; each is defective with probability 0.2, independently. Let X be
the number defective. Build the pmf, and find E(X), V (X) and P (X ≥ 1).
10. A lot of 20 items contains 4 defectives. Three are sampled without replacement. Find
P (X = 0) and P (X ≥ 1), where X is the number of defectives sampled.
24 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Part C – Continuous Random Variables
11. State the four properties of a probability density function, and explain why f (x) may exceed
1 while F (x) may not.
3
12. For f (x) = x2 on 0 ≤ x ≤ 2: verify the density, find F (x), and compute P (1 ≤ X ≤ 2), µ
8
and σ 2 .
13. A variable is uniform on [10, 18]. Find f (x), F (x), µ, σ 2 , and P (12 ≤ X ≤ 15).
14. The time to failure of a component has F (t) = 1 − e−t/500 for t ≥ 0 (hours). Find the
density, the mean time to failure, the reliability at t = 500 h, and the median.
15. Explain, with a sketch, why P (a < X < b) = P (a ≤ X ≤ b) for a continuous random
variable but not for a discrete one.
25 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Part D – Applications
16. (Inspection economics) An automated test has sensitivity 0.97 and a false-positive rate
0.05. The process runs at 3% defective. Each flagged part is sent for manual re-inspection
at a cost of 12; 10 000 parts are produced per week. Compute the expected number of flags
per week, the expected weekly re-inspection cost, and the proportion of that cost spent on
parts that turn out to be good. Then state one change that would reduce the wasted cost
most effectively, and justify it.
17. (Fill process) Bottle fill volume is uniform on [248, 252] mL; the label claim requires at
least 249 mL and the filler cannot exceed 251.5 mL without overflow. Find the probability
of an underfilled bottle and of an overflow, the expected number of each per 20 000 bottles,
and explain which of “recentre the process” or “reduce the spread” you would do first.
Bonus Problems
B1. (Deriving the uniform variance) For X uniform on [a, b], show from the definitions that
µ = (a + b)/2 and σ 2 = (b − a)2 /12.
B2. (Looking ahead) Let X be uniform on [0, 1], so µ = 0.5 and σ 2 = 1/12. Without any
formula from later weeks, argue what should happen to the distribution of the average of n
independent such variables as n grows — in both its centre and its spread — and name the
week in which this becomes a theorem.
26 / 27
MATH 236 – Engineering Statistics
Week 4: Probability and Random Variables
Week 4 – Formula Card
Formula Card – Week Summary
Probability and Random Variables
Axioms:
P (S) = 1, 0 ≤ P (E) ≤ 1
E1 ∩ E2 = ∅ ⇒
P (E1 ∪ E2 ) = P (E1 ) + P (E2 )
P (A′ ) = 1 − P (A)
Addition rule:
P (A ∪ B) = P (A) + P (B) − P (A ∩ B)
Random variable: a function S → R
X the function, x a value
Discrete:
∑︁
f (x) = P (X = x) ≥ 0,
f (x) = 1
F (x) = P (X ≤ x) — a step function
∑︁
µ = E(X)
=
xf (x)
∑︁
2
2
σ = (x − µ) f (x) = E(X 2 ) − µ2
Conditional:
P (A ∩ B)
P (B | A) =
P (A)
P (A ∩ B) = P (B | A)P (A)
Continuous:
∫︂
f (x) > 0,
f (x) dx = 1
∫︂ x0
F (x0 ) =
f (x) dx, f = F ′
Independence: P (A ∩ B) = P (A)P (B)
independent ̸= mutually exclusive
P (a ≤ X ≤ b) = F (b) − F (a)
xm
Total probability:
∑︁
P (B) = i P (B | Ei )P (Ei )
P (X = x) = 0, so < and ≤ agree
∫︂
µ = xf (x) dx
∫︂
σ 2 = (x − µ)2 f (x) dx = E(X 2 ) − µ2
Bayes:
Continuous uniform on [a, b]:
P (B | A)P (A)
1
x−a
P (A | B) =
P (B | A)P (A) + P (B | A′ )P (A′ ) f (x) = b − a , F (x) = b − a
Reliability:∏︁
series R = Ri ∏︁
parallel R = 1 − (1 − Ri )
µ=
a+b
,
2
σ2 =
(b − a)2
12
Common errors to avoid:
× Treating mutually exclusive events as independent
× Using P (A ∪ B) = P (A) + P (B) when the events can overlap
× Swapping P (A | B) and P (B | A), or omitting the prevalence in Bayes
× Reading a density
— it may exceed 1
∫︁
∑︁f (x) as a probability
× Failing to check
f (x) = 1 or f (x) dx = 1 before using a distribution
× Computing V (X) without subtracting µ2 , or forgetting the f (x) weights
Next week (Week 5): The Normal Distribution (Ch. 4.5). One specific density — the
bell curve — that fits most engineering measurements, together with the standardisation
Z = (X − µ)/σ that turns every “area under the curve” question into a single table lookup.
27 / 27
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )