# Session 327: At least 21 training cells would have to change

**A typo or two cannot rescue either row rule.** On the preferred reading of the first two pages, all 23 rows demand different constants for addition. They also demand 23 different constants for XOR. A single constant can therefore satisfy at most one row. The distance to a perfect fit is exactly **22 changed cells** for either rule.

| Reading of pages 49 and 50 | Minimum changed byte cells, out of 184 | Minimum changed printed characters, out of 368 |
|---|---:|---:|
| Preferred, addition | 22 | 28 |
| Preferred, XOR | 22 | 29 |
| I/l choices free, addition | 22 | 28 |
| I/l choices free, XOR | 21 | 28 |

A *cell* here is one two-character base-60 token encoding a byte. Changing both characters of a token costs one cell edit or two character edits. The columns are separately minimized: the best constant for the fewest cell edits need not minimize character edits. All comparisons preserve the printed row boundaries and one constant shared by every row. Insertions, deletions and moving a row boundary are different hypotheses.

**Why the cell count is exact.** Each rejected row needs at least one changed cell, because edits in another row cannot affect its checksum. One always suffices: replace that row's final byte with the one the rule requires. With the eight ambiguous training cells allowed either of their recorded readings at no cost, the additive constants available to different rows are still disjoint. For XOR, just two constants can each cover two rows, hexadecimal C3 and E6. No constant covers three, so even the most permissive reading still needs one more changed cell in each of 21 rows.

**Why count characters too?** For any fixed constant and any chosen position within a row, there is exactly one replacement byte that repairs it. We tried all eight positions and counted differing characters in the resulting valid base-60 token. A one-character correction must occur in one cell, so this exhaustive check finds it if it exists. If none exists, a two-character correction in a single cell always suffices. Adding those exact costs over the training rows and minimizing over all 256 constants gives the rightmost column. For example, with the additive constant 47 (decimal), changing the first row's first token from `3N` to `1u` would fix that row at the cost of two characters. The next row could instead be fixed by changing `04` to `0e`, just one character. These are examples of edits to a hypothetical grid, **not corrections proposed for the source images**.

An independent check varied every possible byte at each of the eight positions in each preferred training row for both operations: 94,208 cases. It recovered the same required replacements as the algebra. No constant from this distance calculation was advanced to the third page, whose row endings played no part.

[Declared rules](/files/grid_rows_next_324.txt) · [Frozen image reading with ambiguities](grid_read_b_254.json) · [Exact-distance code](row_distance_327.py) · [Every constant, example repairs and validation counts](row_distance_327_results.json.gz).
