# Z32 literal crib placement experiment ## Inputs and model I used the case-sensitive ASCII transcription in AZdecrypt’s `Ciphers/Zodiac ciphers/Zodiac 32.txt`, lines 1–2. Read each row left to right, then concatenate the rows in printed order. The row break consumes no slot. [AZdecrypt transcription](https://raw.githubusercontent.com/doranchak/azdecrypt/master/AZdecrypt/Ciphers/Zodiac%20ciphers/Zodiac%2032.txt) ```text C9J|#Ok[AMf8?ORTG X6FDVj%HCELzPW9 ``` Grouping equal glyphs gives three one-based repeat groups among 29 distinct glyphs in 32 slots. The other 26 glyphs occur once. | Glyph | Slots | |---|---| | `C` | 1, 26 | | `9` | 2, 32 | | `O` | 6, 14 | Normalize English by keeping ASCII letters and converting them to uppercase A–Z. The two inputs specified by the task are already normalized, `RADIANS` (7 letters) and `INCHES` (6). Each occupies consecutive slots and may cross the printed row break. For each trial, require one fixed A–Z value per glyph throughout the 32 slots. Different glyphs may share a value. Each trial can therefore admit its own key. Repeated-glyph equality is the only test applied to the placed words. ## Reproduction The following pseudocode uses one-based indexing and inclusive ranges. For either word order, the 19 slots outside the words can be distributed into the gaps before, between, and after them. This gives `C(21, 2) = 210` trials per order, including placements where the words touch. ```text G = joined transcription for (A, B) in [(RADIANS, INCHES), (INCHES, RADIANS)]: for i in 1..(33 - len(A)): for j in (i + len(A))..(33 - len(B)): # A range with lower bound above upper bound is empty. tried[A, B] += 1 P = indexed letters of A at i and B at j values = group letters in P by G[slot], as sets if any set in values has more than one letter: continue valid[A, B] += 1 F = empty map for slot in 1..32: if G[slot] has a set in values: F[slot] = the sole letter in that set E = entries in F whose slots are absent from P histogram[A, B, size(E)] += 1 for slot in E: outside_count[A, B, slot] += 1 save F for the across-placement intersection ``` For a valid placement, a slot is forced if every key consistent with that placement gives it the same letter. This is precisely when its glyph appears in a crib slot. An untouched glyph can take any of the 26 letters independently of the other glyphs. Across placements, a slot-letter pair survives only if it occurs in every saved `F`. A slot left free in even one placement admits all 26 values there and cannot contribute a universal letter. ## Counts | Order in printed slots | Tried | Valid / tried | 0 extra | 1 extra | 2 extra | 3 extra | |---|---:|---:|---:|---:|---:|---:| | RADIANS then INCHES | 210 | 178 / 210 | 7 / 178 | 73 / 178 | 85 / 178 | 13 / 178 | | INCHES then RADIANS | 210 | 172 / 210 | 10 / 172 | 65 / 172 | 75 / 172 | 22 / 172 | | Both orders | 420 | 350 / 420 | 17 / 350 | 138 / 350 | 160 / 350 | 35 / 350 | The last four columns count valid placements by the number of forced letters outside the two cribs. In total, 333 of 350 valid placements force at least one extra letter. Counting slot occurrences separately for each placement gives 563 extra forced letters out of 6,650 outside-crib slot occurrences (350 × 19). Only members of repeat groups can contribute. | Slot | Extra forces with RADIANS first | Extra forces with INCHES first | Combined | |---|---:|---:|---:| | 1 | 94 / 178 | 111 / 172 | 205 / 350 | | 2 | 18 / 178 | 18 / 172 | 36 / 350 | | 6 | 71 / 178 | 60 / 172 | 131 / 350 | | 14 | 71 / 178 | 66 / 172 | 137 / 350 | | 26 | 8 / 178 | 7 / 172 | 15 / 350 | | 32 | 20 / 178 | 19 / 172 | 39 / 350 | The intersection of forced slot-letter pairs across all 350 valid placements is empty, even with the crib letters included. Thus 0 of 32 slots has a letter that survives across all fits. ## Illustration To choose one example, take the first valid trial in the displayed loop order, with starts increasing within each order. This puts `RADIANS` at 1–7 and `INCHES` at 8–13. The repeat groups force `R` at 26 from 1, `A` at 32 from 2, and `N` at 14 from 6. The example uses only that selection rule and the equality propagation. Dots mark free slots. ```text Slot 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 Letter R A D I A N S I N C H E S N . . Slot 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Letter . . . . . . . . . R . . . . . A ``` The literal pair is compatible with 350 placements under this model. The fit establishes compatibility only. It leaves both word orders possible, determines no absolute plaintext letter across the fits, and does not establish that either word occurs in the original plaintext.