# Strict homophone cycling in Z340: an empirical check over 32-cell windows **Bottom line:** Z340's own solved text does not follow strict homophone cycling. Of all 309 32-cell windows, 5 pass (1.6%). Of the 306 informative windows, 2 pass (0.65%). Null keys that keep the same repeat pattern pass at about the same rate: 1.96% overall and 1.00% in their informative subset. Cycling therefore gives no evidence for the true key over a random one. Requiring it in a Z32 search would discard most of the hypothesis space and, if the author behaved as in Z340, probably the true key too. ## 1. Source, edition, orientation, alignment - **Source:** `doranchak/zodiac-cipher-explorer`, file `zodiac.js` at commit `270316a6267124aa8b2c48bc17eea46f7a4b92bf`. Fetched from raw.githubusercontent.com; the file is 85,799 bytes with sha256 `0896ec99…69ff6fe3e`. The `ciphers` array has 9 strings with lengths 408, 408, 340, 340, 340, 340, 340, 13, 32. - **Strings used:** - Glyphs: entry 3 (0-based), commented `//z340 untransposed`. - Plaintext: entry 5, commented `//z340 solution untransposed`. This is the version that keeps the slips. - Not used for the main run: entry 6, `//z340 solution untransposed, fixed spelling`. - Both strings used are 340 cells long and are matched cell by cell. - **Orientation:** "untransposed" is the edition's own order. The 1-17-diagonal transposition is already undone, so the sequence reads in message order. Index 0 is the first cell (`H` = I), and index 339 is the last (`+` = H of DEATH). - **Alignment check on a known segment:** - Cells 0–16, `H+M8|CV@KEB+*5k.L`, give `IHOPEYOUAREHAVING`. `+` maps to H at cells 1 and 11. - Across all 340 cells, each of the 63 glyph types maps to **exactly one** plaintext letter, with no conflicts. That would be very unlikely if the two strings were misaligned. - **Slips kept as published:** the plaintext is used exactly as the string gives it. Where the fixed-spelling string differs: | Cell | Slip | Fixed | |---|---|---| | 24 | FANINTRYING | FUN… | | 75 | BRINGOUP | BRINGS… | | 122 | BECAASE | BECAUSE | | 144 | PARADLCE | PARADICE | | 156 | SOOHER | SOONER | | 166 | EOW | I NOW | | 191 | WORV | WORK | | 287 | IVNOW | IKNOW | The slips are what the glyph key actually produces, so every window stays key-consistent. - **Uncertain positions:** - Cells **300–305** (`71 letter: mark INCONSISTENT; continue key = {glyph: its letter} obs_pass = PASS(win,key); obs_inf = INFORMATIVE(win,key) types = distinct glyphs of win in first-occurrence order classes = types grouped by multiplicity in win, classes in ascending multiplicity, types inside a class in first-occurrence order repeat 200 times: # fresh draw each time nkey = {} for class in classes: # permute existing letters within class letters = [key[t] for t in class]; rng.shuffle(letters) nkey.update(zip(class, letters)) record PASS(win,nkey), INFORMATIVE(win,nkey) GROUPS(win,key): for each letter, the glyphs enciphering it, in occurrence order CYCLIC(seq): no repeat -> True else per = #distinct glyphs before first repeat; True iff seq[j] == seq[j-per] for all j >= per PASS = all groups CYCLIC INFORMATIVE = some group contains a repeated glyph AND >= 2 distinct glyphs ``` Notes on the method: - Permuting within multiplicity classes keeps each window's repeat pattern and its letter counts. - Null "informative" is judged separately for each null key. - Null pass fractions pool all draws: 200 × number of consistent windows. ## 3. Results (main run, published untransposed solution with slips) | | Count | Pass | Pass fraction | |---|---|---|---| | Windows (all starts 0–308) | 309 | — | — | | Key-consistent windows | 309 | 5 | **1.62%** (5/309) | | Observed, informative subset | 306 | 2 | **0.65%** (2/306) | | Null keys (200 × 309) | 61,800 | 1,209 | **1.96%** (1,209/61,800) | | Null, informative subset | 61,200 | 609 | **1.00%** (609/61,200) | - **Windows that pass:** starts 85, 86 and 87 pass only because they are not informative (no group has both a repeat and a second glyph). Starts 91 and 92 are the only informative windows that pass. All other starts (0–84, 88–90, 93–308) break cycling. - **Observed vs null:** the observed pass rate is slightly *below* the null rate (ratio 0.82 overall, 0.65 informative). So there is no sign that the author cycled homophones strictly in reading order. The informative null rate shows that chance alone passes about 1% of keys. - **First indexed violation:** window start 0 (cells 0–31), letter **O**. - Its group is cell 2 `M`, cell 6 `V`, cell 18 `R`, cell 21 `V`. - The cycle is (M,V,R). At cell 21 (the group's 4th element) the next glyph should restart at `M`, but `V` appears. ## 4. Overlap and sensitivity - **Overlap:** neighbouring windows share 31 of 32 cells, so the 309 windows are far from independent. Only about 10.6 windows' worth of cells are separate (340/32). - The 10 non-overlapping windows (starts 0, 32, …, 288) pass **0/10**. - All 5 passing windows fall in one short stretch (cells 85–123). They count as roughly one local event, not five pieces of evidence. - The counts above describe windows. They are not a p-value. - **Sensitivity check:** excluding the 37 windows that contain the uncertain `LIFEIS` cells (300–305) leaves 272 windows. - Observed: 5/272 pass (1.8%), and 2/269 informative windows pass (0.74%). - The null was not re-run for this subset. ## 5. What a hard cycling requirement would mean for Z32 - **Z32 structure:** Z32 (`C9J|#Ok[AMf8?ORTGX6FDVj%HCELzPW9`, from the same file) has 29 glyph types in 32 cells. Only `C`, `9` and `O` occur twice, at cells 0/25, 1/31 and 5/13 (0-based). - **When a key can fail:** a candidate key can break cycling only if a letter's group includes one of these doubled glyphs and also another glyph, in an order that breaks the cycle. - **Selectivity (my extra Monte Carlo, not part of the brief's protocol):** - I assigned letters to the 29 Z32 types independently, at the Z340 plaintext's letter frequencies: 200,000 keys, seed 32. - 99.0% of keys are informative (198,090). - 20.5% pass (41,080), and 19.6% are both informative and passing (39,170). - So a hard cycling requirement would cut the Z32 key space to about a fifth: a factor of about 4.9, or about 2.3 bits. - **Loss:** - In Z340, true windows pass cycling no more often than matched null keys (0.65% vs 1.00% informative). - If the author chose homophones for Z32 as he did for Z340, the true key's chance of passing should be about the same as a random key's. That is roughly 20% under this prior, which means about an **80% chance of throwing away the true Z32 solution**. - The likelihood ratio is about 1 (or below). The cut in search space buys no evidence. - **Recommendation:** do not use strict cycling as a hard constraint for Z32. It could at most be a weak soft feature, and Z340 gives no grounds for weighting it. - **Caveats:** - Z340 is a different, later cipher. - Its 32-cell windows contain far more repeats than Z32, so the pass rates do not transfer directly. - The conclusion only covers selection in reading order (see §1). - Not found: any statement in the source about the author's homophone selection order. ## 6. Reproducibility - **Software:** Python 3 standard library only. - **Random generator:** `random.Random(340032)` is created once and used for every window in increasing start order, via `random.shuffle`. - **Type ordering:** multiplicity classes ascending, and first-occurrence order inside each class. - **Data:** strings taken directly from the pinned `zodiac.js` revision.