# Session 334: Eight cells per row is close to a balanced layout

**With the number of lines on each page kept fixed, no single one-cell shift at a line break improves the printed layout under the main spacing model.** On page 49, eight across is the unique best arrangement according to this rule. On pages 50 and 51 a better arrangement exists, but it requires moving several breaks together. The difference across all three pages is just **2.47%** of the printed layout's score.

[Session 333](/sessions/333.html) asks how few lines could contain the cells. A typesetter might instead want a fixed block of lines that look about equally full. We tested one explicit version of that idea: on each line, subtract the measured ink span from 1,196 pixels, square that unused width, then add the values for the page. Lower is better; an unusually short line costs more than a slightly short one. This is an assumed objective, not a documented practice of the puzzle authors.

Keep the original cell order on each page; keep exactly 10, 13 and 9 lines respectively. Count all lines, including the last. Preserve visible widths and gaps between originally adjacent cells on the same row. At a join that was originally a line break, we need an unknown gap: the primary case uses the median from the other two pages, 35 or 36 pixels. An exact search compares every legal placement of breaks under these rules.

| LP2 page | Printed score (px²) | Best attainable score (px²) | Internal breaks changed in best layout |
|---|---:|---:|---:|
| 49 | 283,353 | 283,353 | 0 of 9 |
| 50 | 364,047 | 345,370 | 10 of 12 |
| 51 | 284,556 | 280,197 | 5 of 8 |

Each optimum in the table is unique. Page 50's best line counts make the difference visible: two eights to begin, then a seven, then nine eight-cell lines and a final nine. Some of those eight-cell lines now contain different cells than the printed ones. The score measures blank width, not how many bytes were encoded together.

**The inferred best breaks depend on spacing we cannot observe.** With the smallest borrowed gaps the printed eights are optimal on all three pages, at each tested width (1,192, 1,196 and 1,200 px). With the largest borrowed gaps at the primary width, rebreaking the pages improves the total score by **17.79%**: adding a large gap at a previously unprinted join itself fills some of the blank space we are scoring. Allowing the last line to be ragged also matters. With no penalty for unused space on the last line, the median-gap optima end with **one, one and two cells**, respectively. The original pages all end with eight. The result file includes all 54 page, width, gap and last-line combinations.

The search keeps the least score achievable for each prefix of cells and each line count; a later line's cost depends only on where it starts and ends. An independent brute-force enumeration of 200 small controls confirmed the minimum, tie count, and minimum number of changed boundaries. All real printed layouts were feasible before any alternatives were scored.

A well-balanced line of print and an eight-cell data record could look the same. The near fit under a simple visual objective gives a reason to keep both interpretations open; it cannot show which one Cicada intended.

[Follow-up scope](balance_334_plan.txt) · [Geometry-only replay](balance_334.py) · [Costs, ties, alternative line widths and break positions for each setting](balance_334_results.json.gz).
