<a id="ch-05"></a>

## Chapter 5 — The same rate has three widths

### Learning outcomes

After this chapter, you should be able to:

1. Read 0.150 as k divided by n, rounded to three decimals.
2. Name the three printed brackets and which n produced each one.
3. Refuse a note that keeps 0.150 and drops the bracket.

### 5.1 The function fixes z at 1.96 and puts n in the denominator.

`wilson(k, n)` sets `p = k/n` and `z = 1.96`. It then builds `d = 1 + z*z/n`. The centre is `(p + z*z/(2*n)) / d`. The half-width is `z` times a square root, and that whole term is divided by the same `d`. The print shows `k/n` with three decimals, then the lower and upper ends with three decimals. It does not print the centre by itself.

For the pairs `(3, 20)`, `(30, 200)` and `(300, 2000)`, `k/n` is exactly 0.15, so every rate column shows `0.150`. The brackets are `[0.052, 0.360]`, `[0.107, 0.206]` and `[0.135, 0.166]`. Subtracting the first lower end from its upper end leaves a wide gap; subtracting 0.135 from 0.166 leaves a tight one. Only the trial count moved.

| What the row holds fixed | What moves when n grows |
|---|---|
| z stays 1.96 | `d` gets closer to 1 |
| printed rate stays 0.150 | half-width shrinks |
| three-decimal rounding | the bracket tightens around 0.150 |

This is a Wilson interval on independent yes-or-no draws. It is not a Wald interval centred only on `p`. Raising z, or swapping in a different formula, would be a different script. This file does neither.

### 5.2 Worked example

| Note on Omar's desk | Verdict | Reason |
|---|---|---|
| "Lab S found 15 percent." | Incomplete | Three denominators share that rate |
| "3/20 and the bracket 0.052 to 0.360." | Keep | That is the first printed row |
| "300/2000 narrowed it to 0.135–0.166." | Keep | That is the third printed row |
| "Average the three brackets." | Refuse | No fourth row exists |

> **Synthetic case.** Tallis & Co did not run this count on client mail. The three rows are the lab's own trials.

### Errors and limits

Quoting 0.150 without its n pretends the three rows are one measurement. They are one rate printed three times.

### Apply

- **EX051 — Three widths.** The lab prints rate 0.150 on 3/20, 30/200 and 300/2000. Which bracket belongs to which denominator, and may a note keep only 0.150? *Rubric:* 3 = [0.052, 0.360], [0.107, 0.206], [0.135, 0.166] in that order; z stays 1.96; dropping the bracket hides the width;; 2 = the three brackets stay in order;; 1 = the rate only;; 0 = a new interval.

<!-- open-cyber-academy:chapter-navigation:start ch-05 -->
### Continue studying — lesson 05 (chapter 05 of 20)

[← Chapter 04](#ch-04) · [Course chapter index](../SUBJECTS.md) · [Chapter 06 →](#ch-06)

Continue to the next authored lesson.
<!-- open-cyber-academy:chapter-navigation:end -->

## Worked answers

<a id="answer-ex051"></a>
**EX051.** The three Wilson rows print rate 0.150 because 3/20, 30/200 and 300/2000 are the same proportion. The brackets are [0.052, 0.360], then [0.107, 0.206], then [0.135, 0.166]. z stays 1.96 and n sits in the denominator, so the bracket shrinks as n grows. A note that keeps only 0.150 has dropped the width.
