◇ OpenCyber Academy
Bachelor's · Chapter 12 · English

Chapter 12 — Probability and statistics

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

Chapter 12 — Probability and statistics

Lesson map

Lesson 12 published. Map, example, EX034.

flowchart TD
  N0["Learning outcomes"]
  N1["12.1 Proportions with intervals"]
  N2["12.2 Comparing teams"]
  N3["Lab — Wilson intervals for policy acknowledgement"]
  N4["12.3 Small samples"]
  N5["Synthesis"]
  N0 --> N1 --> N2 --> N3 --> N4 --> N5
  N5 --> EX["Worked example"]
  EX --> Q["Exercise EX034"]

Logical drawing

flowchart LR
  N0["Learning outcomes"]
  N1["12.1 Proportions with intervals"]
  N2["12.2 Comparing teams"]
  N3["Lab — Wilson intervals for policy acknowledgement"]
  N4["12.3 Small samples"]
  N5["Synthesis"]
  N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> Q["EX034"]
[Learning outcomes]
    |
    v
[12.1 Proportions with intervals]
    |
    v
[12.2 Comparing teams]
    |
    v
[Lab — Wilson intervals for policy acknowledgement]
    |
    v
[12.3 Small samples]
    |
    v
[Synthesis]
    |
    v
[Worked example] --> [Exercise EX034]

Learning outcomes

You will (1) estimate a proportion with an interval; (2) compare teams fairly despite different sizes; (3) avoid over-reading small samples.

12.1 Proportions with intervals

Elmfield asks each team to acknowledge its updated information handling policy. Sofia learns that a proportion from a sample or small team should come with an interval showing uncertainty. She uses the Wilson interval, which behaves well for small counts and proportions near zero or one. The interval tells managers the range of values consistent with the data, which is more honest than a single percentage and helps prevent decisions based on chance differences. For a team of fifteen, the interval will be much wider than for a team of sixty, as the next section shows.

12.2 Comparing teams

The lab computes acknowledgement rates. Housing has fifty-two of sixty, eighty-seven percent, with an interval from seventy-six to ninety-three percent. Repairs has eighteen of thirty, sixty percent, with an interval from forty-two to seventy-five percent. Finance has fourteen of fifteen, ninety-three percent, but its interval runs from seventy to ninety-nine percent because the team is small. Repairs is clearly lower than housing, since their intervals barely touch. Finance and housing cannot be distinguished. Reporting the intervals stops finance's ninety-three percent being presented as better than housing when the data cannot show it.

Lab — Wilson intervals for policy acknowledgement

"""Wilson 95% interval for a proportion (policy acknowledgement), stdlib only."""
from math import sqrt
def wilson(k, n, z=1.96):
    p = k/n; d = 1 + z*z/n; c = (p + z*z/(2*n))/d; h = z*sqrt(p*(1-p)/n + z*z/(4*n*n))/d
    return c-h, c+h
for team, k, n in [("housing", 52, 60), ("repairs", 18, 30), ("finance", 14, 15)]:
    lo, hi = wilson(k, n); print(f"{team}: {k}/{n} = {k/n:.0%}, 95% interval {lo:.0%} to {hi:.0%}")

Run with python3 lab_wilson.py. Verified output:

housing: 52/60 = 87%, 95% interval 76% to 93%
repairs: 18/30 = 60%, 95% interval 42% to 75%
finance: 14/15 = 93%, 95% interval 70% to 99%

12.3 Small samples

Sofia notes that finance's high percentage looks impressive but rests on fifteen people; one more or one fewer acknowledgement would move it several points. She recommends that Elmfield focus support on repairs, where the gap is clear, and asks why repairs staff find acknowledgement harder. She discovers that they rarely use laptops and the policy was sent by email. Statistics revealed the gap; talking to staff revealed the cause and a simple fix: acknowledgement on tablets during team meetings. Acknowledgement on tablets during meetings fits how repairs staff already work.

Worked example

Sofia computes Wilson intervals, finds repairs clearly lower than housing and traces the cause to email delivery.

Synthetic case. Acknowledgement counts are synthetic.

Errors and limits

Acknowledgement does not mean understanding. Intervals assume independence.

Exercises

Synthesis

Intervals show which differences are real and point to where conversations reveal causes.

Continue studying — chapter 12 of 40

← Chapter 11 (draft) · Course chapter index · Chapter 13 (draft) →