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

## Chapter 7 — The reduction interval is two sorted slots

### Learning outcomes

After this chapter, you should be able to:

1. Separate the source probability 0.30 from the printed baseline 0.350.
2. Point at slots 50 and 1949 in a sorted list of 2000 differences.
3. Refuse a note that swaps 0.30 in for 0.350.

### 7.1 The interval is two positions after the differences are sorted.

`random.Random(42)` builds 300 baseline draws with `r.random() < 0.30`. The defended list keeps a baseline success only when a further draw is below 0.6, which is the comment's "about 40 percent blocked" as a design, not as a printed rate. The print then shows `sum(base)/300` and `sum(defn)/300`. Those realised rates are `0.350` and `0.190`. Their difference on the original lists is 0.160, and that point difference is not what the bracket prints.

The loop draws 2000 resamples. Each resample picks 300 indexes with replacement, subtracts the defended rate from the baseline rate on those indexes, and appends the difference. After `diffs.sort()`, the code reads `diffs[50]` and `diffs[1949]`. Those two slots print as `0.120` and `0.203`. Index 50 is the low end. Index 1949 is the high end. No other slot is printed.

| Quantity | Where it lives |
|---|---|
| 0.30 | Bernoulli cutoff for the baseline draws |
| 0.350 | Realised baseline, printed |
| 0.190 | Realised defended rate, printed |
| 0.120 and 0.203 | Slots 50 and 1949 of 2000 |

### 7.2 Worked example

| Offered sentence | Decision |
|---|---|
| "Baseline printed 0.350, not the cutoff 0.30." | Keep |
| "Defended printed 0.190." | Keep |
| "The reduction bracket is 0.120 to 0.203." | Keep |
| "The bracket is the single subtraction 0.160." | Refuse; 0.160 is not a printed end |

> **Synthetic case.** The 300 prompts are draws. They are not Tallis inboxes.

### Errors and limits

Treating the source cutoff as the printed baseline invents a column the format string never emitted.

### Apply

- **EX053 — Two slots.** Where do 0.120 and 0.203 come from, and why is 0.350 not 0.30? *Rubric:* 3 = realised baseline 0.350 and defended 0.190; the bracket is sorted indexes 50 and 1949 of 2000; 0.30 is the draw cutoff;; 2 = the printed rates and the two indexes;; 1 = the rates only;; 0 = replaces 0.350 with 0.30.

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

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

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

## Worked answers

<a id="answer-ex053"></a>
**EX053.** Random(42) draws the baseline with cutoff 0.30, but the realised rate prints as 0.350. The defended rate prints as 0.190. Two thousand resampled differences are sorted, and the bracket reads index 50 and index 1949, which print 0.120 and 0.203. The cutoff 0.30 is not the baseline column.
