STAT-235 · Lesson 2 of 5 · 36 min

Probability

Engineers make decisions under uncertainty all the time. Will the pump fail before its next service? How likely is a flood that overtops the levee during the bridge's life? If an inspection flags a weld, how likely is it really defective? Probability is the language for answering such questions precisely, and it underpins reliability engineering, risk assessment, quality control, and the safety factors and load factors written into design codes.

This chapter covers the rules of probability: sample spaces and events, the addition and multiplication rules, conditional probability and independence, system reliability, Bayes' theorem, counting methods, and the engineering idea of the return period.

Sample spaces, events and the basic rules

An experiment is any process with an uncertain outcome: testing a component, measuring a flow, inspecting a weld. The sample space S is the set of all possible outcomes; an event is a set of outcomes, such as "the component fails before 1000 hours". The probability \(P(A)\) of an event is a number between 0 and 1. It can be interpreted as the long-run relative frequency of the event in repeated trials, or, for one-off situations, as a degree of belief informed by data and judgment.

Every probability calculation rests on a few rules:

  • \(0 \le P(A) \le 1\), and \(P(S) = 1\).
  • Complement: \(P(\text{not } A) = 1 - P(A)\). This is often the easiest route: "at least one" is 1 minus "none".
  • Addition rule: \(P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B)\). Subtracting the overlap avoids counting it twice. If A and B are mutually exclusive (cannot both happen), the overlap is zero.
A Venn diagram inside a rectangle S. Circle A (porosity, 0.08) and circle B (undercut, 0.05) overlap in a region labelled both, 0.02. The union, either defect, is 0.11.
The addition rule: adding the two circles counts the overlap twice, so subtract it once.

Worked problem

Weld defects

In a fabrication shop, 8% of welds have porosity, 5% have undercut, and 2% have both. What fraction of welds have at least one of these defects, and what fraction have neither?

Show solution
  1. \(P(\text{P or U}) = 0.08 + 0.05 - 0.02 = 0.11\).
  2. \(P(\text{neither}) = 1 - 0.11 = 0.89\).

Answer: 11% have at least one defect; 89% have neither

Conditional probability and independence

The probability of A given that B has occurred is

\[P(A \mid B) = \frac{P(A \text{ and } B)}{P(B)}\]

Conditioning narrows the sample space to the outcomes where B happened. Rearranged, it gives the multiplication rule: \(P(A \text{ and } B) = P(B)\,P(A \mid B)\).

Events are independent if knowing one occurred does not change the probability of the other: \(P(A \mid B) = P(A)\), or equivalently \(P(A \text{ and } B) = P(A)P(B)\). Independence is an assumption to justify, not to take for granted: two pumps fed from the same power supply, or two bridge piers founded on the same weak soil layer, are not independent. Failures that share a cause (common-cause failures) are a central concern in safety engineering.

Worked problem

Parts from two suppliers

A plant received 1000 brackets: 600 from supplier A, of which 12 were defective, and 400 from supplier B, of which 20 were defective. A bracket is chosen at random. Find P(defective), P(defective | B), and decide whether defects are independent of supplier.

Show solution
  1. P(defective) = 32/1000 = 0.032.
  2. P(defective | B) = 20/400 = 0.050; P(defective | A) = 12/600 = 0.020.
  3. Since P(defective | B) ≠ P(defective), the events are not independent.

Answer: Overall 3.2% defective, but 5.0% from B against 2.0% from A. Defects depend on supplier: B's quality problem is worth raising with them

Reliability of systems

Reliability is the probability that a component or system performs its function for a stated time under stated conditions. ENGG-100 introduced series and parallel systems; with the probability rules, they follow directly, assuming independent failures:

  • Series (all must work): \(R = R_1R_2\cdots R_n\). Every extra component lowers reliability.
  • Parallel (redundant; at least one must work): \(R = 1 - (1 - R_1)(1 - R_2)\cdots(1 - R_n)\). Redundancy raises reliability.
A block diagram: two pumps P1 and P2 in parallel, each with reliability 0.90, followed in series by a valve V with reliability 0.995. The parallel pair has reliability 0.99 and the whole system 0.985.
A pumping system: two redundant pumps in parallel, in series with a single valve.

Worked problem

Pumps and a valve

A lift station has two identical pumps in parallel, each with reliability 0.90 over a year, feeding a single discharge valve with reliability 0.995. Find the system reliability. What would it be with only one pump? And what is the reliability of a series chain of four components, each 0.98?

Show solution
  1. Parallel pumps: \(1 - (0.10)(0.10) = 0.99\).
  2. In series with the valve: \(0.99 \times 0.995 = 0.985\).
  3. With one pump: \(0.90 \times 0.995 = 0.896\).
  4. Four in series: \(0.98^4 = 0.922\).

Answer: System 0.985 with redundancy against 0.896 without: the second pump cuts the failure probability from 10.4% to 1.5%. Four 98% components in series give only 92%. The valve is now the weak link; a bypass would help next

The law of total probability and Bayes' theorem

If the possible situations \(B_1, B_2, \ldots\) cover all cases without overlap, the probability of an event A is the weighted sum over them:

\[P(A) = \sum_i P(A \mid B_i)\,P(B_i)\]

Bayes' theorem reverses a conditional probability, updating a prior belief with evidence:

\[P(B \mid A) = \frac{P(A \mid B)\,P(B)}{P(A)}\]

It matters enormously for inspection and testing, where the question is usually backwards: we know how good a test is at detecting a defect, but we want to know how likely a flagged item really is to be defective.

A probability tree. First branch: defective 0.02, sound 0.98. From defective: flagged 0.95 giving 0.019, not flagged 0.05 giving 0.001. From sound: flagged 0.04 giving 0.0392, not flagged 0.96 giving 0.9408. The flagged outcomes total 0.0582, of which 0.019 are truly defective.
A probability tree for weld inspection. Only about a third of flagged welds are actually defective.

Worked problem

How meaningful is a flagged weld?

Ultrasonic testing detects 95% of defective welds, but also flags 4% of sound welds (false positives). If 2% of welds are actually defective, what is the probability that a flagged weld is really defective?

Show solution
  1. P(flag) = P(flag | defective)P(defective) + P(flag | sound)P(sound) = 0.95(0.02) + 0.04(0.98) = 0.019 + 0.0392 = 0.0582.
  2. \[P(\text{defective} \mid \text{flag}) = \frac{0.95 \times 0.02}{0.0582} = 0.326\]

Answer: Only about 33%. Because defects are rare, most flags are false alarms. That is not a reason to skip testing; it is why flagged welds get a second, more precise examination before costly repairs

This "base rate" effect surprises almost everyone, including professionals. Whenever a test is applied to a population where the condition is rare, the fraction of positives that are real can be low even for a good test. The same reasoning applies to leak detection systems, structural health monitoring alarms and medical screening.

Counting

When all outcomes are equally likely, \(P(A) = \) (number of outcomes in A) / (total number of outcomes), so probability becomes counting. The number of ways to choose k items from n, when order does not matter, is the combination

\[\binom{n}{k} = \frac{n!}{k!\,(n - k)!}\]

When order matters (arrangements), the number of permutations is \(n!/(n - k)!\).

Worked problem

Acceptance sampling

A lot of 12 relief valves contains 2 that are defective. An inspector tests 3 chosen at random. What is the probability that all 3 tested are good (so the defects are missed)?

Show solution
  1. Ways to choose any 3 of 12: \(\binom{12}{3} = 220\).
  2. Ways to choose 3 of the 10 good ones: \(\binom{10}{3} = 120\).
  3. P(all good) = 120/220 = 0.545.

Answer: About 55%: more often than not, testing 3 of 12 misses both defective valves. Small samples catch only frequent defects; safety-critical items such as relief valves are usually tested 100%

Return periods and design life

Floods, wind storms, snow loads and earthquakes are described by their annual probability of exceedance p, or its inverse, the return period \(T = 1/p\). A "100-year flood" has a 1% chance of being exceeded in any given year. It is not a flood that happens once a century on schedule: it can happen two years running, or not at all for 300 years.

Over a design life of n years, assuming independent years, the probability of at least one exceedance is

\[P(\text{at least one in } n \text{ years}) = 1 - \left(1 - \frac{1}{T}\right)^n\]
Graph of the probability of at least one exceedance against design life from 0 to 100 years for return periods of 50, 100, 500 and 2475 years. The 100-year curve reaches 26% at 30 years and 63% at 100 years.
Risk of at least one exceedance over a design life. A 100-year event has a 26% chance of occurring during a 30-year mortgage.

Worked problem

The 100-year flood and a house mortgage

A house sits at the edge of the 100-year floodplain. What is the probability it floods at least once during a 30-year mortgage? During 100 years?

Show solution
  1. 30 years: \(1 - 0.99^{30} = 0.260\).
  2. 100 years: \(1 - 0.99^{100} = 0.634\).

Answer: About 26% over 30 years and 63% over 100 years. Even over a period equal to the return period, the event is more likely than not, but not certain

Worked problem

Choosing a design return period

A structure should have no more than a 10% chance of experiencing a load exceeding its design level during a 50-year life. What return period should the design load have?

Show solution
  1. \(1 - (1 - 1/T)^{50} = 0.10\), so \((1 - 1/T)^{50} = 0.90\).
  2. \(1 - 1/T = 0.90^{1/50} = 0.997895\), giving \(T = 475\) years.

Answer: A 475-year return period. This is exactly the kind of reasoning behind code hazard levels: for example, Canada's National Building Code bases seismic design on ground motions with a 2% probability of exceedance in 50 years, a return period of about 2475 years

Common mistakes

  • MistakeAdding probabilities of events that overlap.

    InsteadUse P(A or B) = P(A) + P(B) − P(A and B); only mutually exclusive events add directly.

  • MistakeMultiplying probabilities of events that are not independent.

    InsteadCheck independence; for dependent events use P(A and B) = P(B)P(A | B). Watch for common causes.

  • MistakeConfusing P(A | B) with P(B | A).

    InsteadThey can be very different; use Bayes' theorem to reverse a conditional.

  • MistakeIgnoring the base rate when interpreting a test result.

    InsteadWhen the condition is rare, even accurate tests produce many false positives.

  • MistakeBelieving a 100-year event happens once every 100 years.

    InsteadIt has a 1% chance every year; over 100 years the chance of at least one is 63%.

  • MistakeAssuming redundancy always helps, whatever the layout.

    InsteadFind the series single points of failure; redundancy in parallel branches does not protect them.

Summary and key terms

  • Probabilities lie between 0 and 1; P(not A) = 1 − P(A); P(A or B) = P(A) + P(B) − P(A and B).
  • Conditional probability P(A | B) = P(A and B)/P(B); independence means P(A and B) = P(A)P(B), an assumption to justify.
  • Series systems multiply reliabilities; parallel systems multiply unreliabilities: R = 1 − Π(1 − Rᵢ).
  • Total probability sums over cases; Bayes' theorem reverses conditionals and exposes the base-rate effect in testing.
  • Combinations C(n, k) = n!/(k!(n − k)!) count equally likely outcomes, as in acceptance sampling.
  • An event with return period T has annual probability 1/T; over n years the chance of at least one is 1 − (1 − 1/T)ⁿ.
Sample space
The set of all possible outcomes of an experiment.
Event
A set of outcomes.
Complement
The event that A does not occur.
Mutually exclusive
Events that cannot occur together.
Conditional probability
The probability of A given that B has occurred.
Independence
Events where one occurring does not change the probability of the other.
Reliability
The probability of performing as required for a stated time and conditions.
Redundancy
Extra components in parallel so that the system survives a failure.
Bayes' theorem
P(B | A) = P(A | B)P(B)/P(A), used to update probabilities with evidence.
False positive
A test that flags a condition that is not present.
Combination
A selection of items where order does not matter.
Return period
The reciprocal of the annual probability of exceedance.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. P(A) = 0.3, P(B) = 0.5 and A and B are independent. Find P(A and B) and P(A or B).

    Show answer

    0.15; 0.3 + 0.5 − 0.15 = 0.65.

  2. A transformer has a 2% chance of failing in a year. What is the probability that at least one of 10 independent transformers fails in a year?

    Show answer

    1 − 0.98¹⁰ = 0.183.

  3. Three identical components, each with reliability 0.8, are placed in parallel. Find the system reliability.

    Show answer

    1 − 0.2³ = 0.992.

  4. A system has component A (0.95) in series with a parallel pair B and C (0.9 each). Find its reliability.

    Show answer

    0.95 × (1 − 0.01) = 0.9405.

  5. Of a firm's projects, 70% are on time. Of on-time projects, 90% are on budget; of late projects, 40% are on budget. What fraction are on budget?

    Show answer

    0.7 × 0.9 + 0.3 × 0.4 = 0.63 + 0.12 = 0.75.

  6. In the previous problem, a project is on budget. What is the probability it was on time?

    Show answer

    0.63/0.75 = 0.84.

  7. A leak detector catches 99% of leaks and gives false alarms on 1% of leak-free days. Leaks occur on 0.5% of days. If it alarms, what is the probability of a real leak?

    Show answer

    0.99 × 0.005 / (0.00495 + 0.01 × 0.995) = 0.00495/0.0149 = 0.332.

  8. How many ways can a crew of 4 be chosen from 9 workers?

    Show answer

    C(9, 4) = 126.

  9. A dam spillway is designed for the 1000-year flood. What is the probability it is exceeded at least once in 100 years?

    Show answer

    1 − 0.999¹⁰⁰ = 0.095, about 9.5%.

  10. What return period gives a 2% chance of exceedance in 50 years?

    Show answer

    (1 − 1/T)⁵⁰ = 0.98 → T ≈ 2475 years.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz