IE 3301 Worked Examples
Teaching · IE 3301 Engineering Probability · Worked examples
Each section has one idea, a short explanation and something to try. The worked example is folded underneath, and it shows its work the same way every time:
- Write out the equation.
- List the variables: the terms in that equation.
- Fill in the equation with the numbers.
- Simplify, and box the answer.
- Distributions: mean, variance and area
- The central limit theorem
- Covariance and correlation
- Hypothesis tests, errors and power
- Linear regression
- A designed experiment
1. Distributions: mean, variance and area
- Calculate the mean, variance and standard deviation of a distribution
- Find a probability as a sum (discrete) or an area (continuous)
- Recognize the common distributions and what they model
A discrete variable counts and has a pmf (bars that sum to 1); a continuous one measures and has a pdf (a curve with area 1), where probability is area. The mean is the balance point, or , and the variance is .
Try it. Pick a distribution and move its parameters. Shade a probability, or draw random samples and watch their average settle on the mean.
Worked example: defective parts in a box (discrete)
= 0, 1, 2 or 3 defective parts, with probabilities 0.50, 0.30, 0.15 and 0.05.
- Equations: , .
- Variables: ; (they sum to 1).
- Fill in: ; .
- Answer:
Worked examples: probability as area (continuous)
A. on 0 to 1. Equation ; fill in ; answer 0.125. Its mean is .
B. Pump life is exponential with mean 200 h. Equation ; fill in ; answer
The common distributions at a glance
| Distribution | Models | pmf or pdf | Mean | Variance |
|---|---|---|---|---|
| Binomial() | successes in trials | |||
| Geometric() | trials until the first success | |||
| Poisson() | events in an interval | |||
| Uniform() | equally likely in a range | |||
| Exponential() | time between random events | |||
| Normal() | sums and averages |
2. The central limit theorem
- State the central limit theorem
- Find the standard error of a sample mean, σ/√n
- Explain when to use t instead of z
Average enough independent observations and the average is approximately normal, whatever the population looks like, with mean and standard error . That is why the normal is everywhere, and why works. When is estimated from the sample, use t instead: it has heavier tails, and approaches the normal as grows (try it in the explorer above).
Try it. Pick a population that is nothing like a bell curve, then raise the sample size. The averages turn normal anyway.
Worked example: bolts longer than 50.8 mm
Lengths are normal, mean 50 mm, SD 0.4 mm.
- Equation: .
- Variables: .
- Fill in: ; look up .
- Answer: about 2.3% of bolts
3. Covariance and correlation
- Find marginal distributions from a joint table
- Calculate covariance and correlation
- Check whether two variables are independent
A joint table gives the probability of each pair of values. Add up a row or column for one variable on its own (the marginal). is positive when the two tend to be high together; correlation scales it to between −1 and 1. Independent means every cell equals its row total times its column total.
Try it. Move probability around the table and watch the covariance and correlation respond. Can you make them independent?
| Y = 0 | Y = 1 | Y = 2 | total | |
|---|---|---|---|---|
| X = 0 no overtime | ||||
| X = 1 overtime | ||||
| total | 1 |
Worked example: overtime and defects
The explorer starts on this table: for an overtime shift, = defects found.
- Equations: , .
- Variables: ; ; .
- Fill in: ; .
- Answer: . Not independent: .
Correlation is not causation: overtime might cause defects, or a rush order might cause both. A designed experiment (section 6) is how to tell.
4. Hypothesis tests, errors and power
- State the hypotheses and find the critical value
- Decide with the test statistic or the confidence interval
- Explain Type I and Type II errors, the p-value and power
The critical values are the bounds of the confidence interval; the rejection region is everything outside. Reject if the test statistic falls outside them, or, the same thing, if the confidence interval misses . For a two-sided test, put in each tail.
| H₀ is true | H₀ is false | |
|---|---|---|
| Reject H₀ | Type I error (probability α) | correct: power, 1 − β |
| Fail to reject H₀ | correct | Type II error (probability β) |
Try it. Move the true mean away from 50 and watch the power grow. Then see what a bigger sample or a looser α does.
Worked example: is the bolt machine off target?
Ten bolts (mm): 50.3, 49.8, 50.6, 50.9, 50.2, 50.7, 49.9, 50.5, 50.8, 50.4. Target 50 mm, α = 0.05.
- Hypotheses: , .
- Equation: (σ unknown, so t).
- Variables: ; critical value .
- Fill in: .
- Answer: : reject H₀ (p ≈ 0.006). Same by the interval: misses 50.
5. Linear regression
- Fit a least-squares line
- Interpret the slope and R²
- Check the residuals
Least squares picks the line that makes the squared vertical distances to the points (the residuals) as small as possible: , . is the share of the variation the line explains.
Try it. Click the chart to add points. Then try to beat least squares with your own slope.
Worked example: reactor temperature and yield
- Equations: , , .
- Variables: .
- Fill in: ; .
- Answer: . The slope test gives : temperature matters.
6. A designed experiment
- Lay out a 2×2 factorial design
- Calculate main effects and the interaction
- Read the same results as a regression
Regression on data you happened to collect shows association; a designed experiment sets the factors, so it can show cause. Run every combination of two factors at two levels (coded −1 and +1). An effect is the average at + minus the average at −, and the interaction is the same for the product column.
Try it. Set the yield at each of the four runs. Make the lines parallel to kill the interaction, or cross them.
Worked example: temperature and time
- Equation: effect = (average where the column is +) − (average where it is −).
- Variables: yields 60, 72, 64, 84 at (A, B) = (−, −), (+, −), (−, +), (+, +).
- Fill in: A: ; B: ; AB: .
- Answer: A = 16, B = 8, AB = 4; as a regression, .