Hands-on experiments
Skip suffix reversals. From rank 719 to 5,719, the 5,000 transitions need 5,877 swaps. I checked 5,912 transitions against sequential generation on two to seven symbols. AT.EX18.01 · Simulate
Amortize a histogram. At weight 16 one block takes five bytes, while eight take 31 bytes against 32 raw. The first strict saving occurs at seven blocks. I check all 256 eight-bit words and 1,056 stream configurations. AT.EX18.02 · Simulate
From sorting to an address
If I sort a block, what information do I need to recover the original order? For n distinct symbols I number its arrangements from 0 to n!−1. Successive divisions of the rank by 2, 3, …, n give digits d₂,…,dₙ. Starting with the largest wheel, I rotate the remaining suffix of length k to the left by dₖ places. Its first symbol is now fixed.
With six symbols, 23 = 3 × 3! + 2 × 2! + 1 × 1!. The last three rotations give 123456 → 126345 → 126534 → 126543.
To recover the rank I read the symbols from left to right. Each next symbol determines a unique rotation in the remaining circle. This proves the bijection. Lists take O(n²) position operations. A Fenwick tree reduces that count to O(n log n), excluding large-integer costs. Fenwick, 1994
What I brought to the construction
I devised the paper wheels to address a data block and later applied the same idea to arithmetic filters. The visiting order has antecedents in Ord-Smith and Zaks. Consecutive ranks differ by one suffix reversal. Jumping directly to a rank uses several rotations. I use the lab to show both operations with the same symbols. Zaks, 1984 · Sawada and Williams
A fixed-length code for n! distinct orders needs at least ⌈log₂(n!)⌉ bits. Repeated symbols reduce the count to n! divided by the product of their multiplicity factorials. Compression also depends on what the decoder already knows. Cover, 1973
Choose a permutation in the lab
Recovering the original block when symbols repeat
I keep the multiplicities and weight branches by their completion counts. When the decoder does not know the histogram I must also transmit it. I compared four complete formats and checked 4,372 small-word decodes. A periodic block and a shuffled block with exactly the same counts isolate the effect of symbol order. Experiment and prior work
Addressing a trajectory through its transitions
I can retain the number of transitions from each symbol to each other symbol together with the endpoints. I weight each continuation by the number of Euler trails it leaves. This recovers enumerative coding of Markov types, treated by Whittle and Cover. I supply a control that recovers every rank among the 256 eight-symbol binary words in 58 types. Codec and limits · Trajectories · Whittle · Cover
Ranking a word inside its Markov type
I can recover a trajectory from its rank given its transition counts. Incremental ranking and exhaustive word lists agree on 4,235 words. I distinguish rank bits from bits needed to describe the model. Contexts and materials
What does transmitting the Markov type cost?
I compare two reversible encodings which transmit their model or learn it online on the stated sources and orders. The KT arithmetic baseline has shorter files in all 18 supplied comparisons. I separately check 512 round trips per codec on eight-bit binary words, including metadata. Conditional rank remains available for sampling. Code and prior work · Register entry
A binary type rank and its header
I fix twelve binary symbols starting with zero. A transition-count recurrence and enumeration of all 2,048 words give 67 types. With a nine-bit count-composition header and a fixed-width rank per type only 16 words beat the direct eleven bits. The header convention determines the result.
If both parties already share the dictionary of 67 feasible types, seven bits suffice for the type. I then find 68 of 2,048 words strictly shorter, up from 16 under the first format. Constructing or communicating that dictionary still costs resources.
My next test is to encode only feasible types and measure decoder cost. AT.COD1 · Whittle, Some Distribution and Moment Formulae for the Markov Chain
Counting the dictionary and intermediate integers
I serialise 67 binary types into 134 count bytes, two bytes per type. On a weighted tridiagonal minor of size 32, a recurrence verifies the 107-bit determinant. Fraction-free elimination uses a 208-bit numerator. On a held-out 1,024-byte excerpt my order-zero binary KT model costs an ideal 8,062.029 bits and zlib writes 518 bytes. I distinguish ideal likelihood, bytes written and the as-yet unmeasured decoder cost.
I plan to write and decode a terminated KT stream, then count data, model and header bytes on the same blocks. AT.COD2 · Bareiss, Sylvester’s identity and multistep integer-preserving Gaussian elimination
Actual size of a terminated KT stream
I count an eight-byte header and decode every block with an order-zero binary KT model. On 1,024 text bytes my stream takes 1,016 bytes against 518 with zlib. On the periodic block it takes 355 against 20. Decoder code is shared by convention.
Compare addressing methods on matched types before generalising codec rates. AT.COD3 · Jiang et al., uShuffle
Identical ranks using only active arcs
I retain initial state, terminal state, transition counts and lexicographic order. My three types contain 18,9,12 words with witness ranks 6,5,7. I verify every word by exhaustive enumeration. The last type uses four active arcs in place of 1,024 cells. I time initialisation, rank, inverse and 32 draws separately. The KT codec wins two of four complete-byte controls.
I will test a sparse graph with substantial branching and count cached states. AT.COD4 · Jiang et al., uShuffle
Addressing a branching trajectory
I fix endpoints and arc multiplicities on three directed graphs. I recover all 15, 48 and 300 trajectories by independent enumeration. The cache visits 37, 65 and 146 states. I supply the headers required to decode every rank.
Measure header and rank bits on a held-out trajectory. AT.COD5 · Jiang et al., uShuffle
Reproduce the experiment
In I, run python src/cli.py permutation 6 23. Reverse the operation with python src/cli.py rang 1 2 6 5 4 3.
Download research files ↓