Repository navigation
Joint denominator-13 decisions need fewer expected fair bits than separate calls - #6072
Merged
Merged
Conversation
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Result
For every nonzero denominator-13 residue pair$a,b$ , an explicit joint sampler produces independent Bernoulli decisions with probabilities $a/13,b/13$ . Its optimal expected fair-bit count is strictly below $7/2$ , compared with at least four draws for two separate standalone calls. For two 1/13 decisions it is below $9/4$ , saving more than 43.75% of the standalone expected draws.
Every configuration has 312 internal control states and 624 binary transitions. State and output codes fit nine bits, giving a 702-byte packed transition table per configuration. The exact law is the four-outcome product distribution with weights
A periodic dyadic decision graph attains every depth's maximal completed-outcome count. The written counting argument proves exact distribution and expected-bit optimality; exact finite certificates establish the bounds over all 144 configurations. The underlying decision-graph method is classical and is not claimed as new.
Significance for researchers
This constructively changes the standalone sampling boundary in PR #6068. Its two-draw lower bound is not a per-scalar amortized limit. The sampler chooses the unbounded-stopping branch of that theorem; a finite control table does not provide a finite draw cap.
The denominator-13 inverse context is PR #5069, with Nick Petalas's PR #6026 providing the related stochastic-prefix interface. Both probabilities must be known before any batch bits are drawn. Adaptive probabilities, table preparation/selection, memory access, random-tape movement, stopping records, reversible cleanup and the complete native caller bill remain separate. No source-bound batching window, physical speedup, supplier or new κ is claimed.
Validation
CPython 3.12.8 normal and optimized registered checks construct all 144 tables, verify complete output-prefix counts over two 156-step periods per configuration, and independently enumerate 36,864 literal tapes. Exact rational expectations, resource bounds, wrong output-label controls, false standalone-bound transfer and false finite-cap claims are checked. No floating point or Monte Carlo is used. Committed bytes pass.
The optional full-history check is unavailable in this shallow checkout; source pins use the reachable base. The navigation-only repair from PR #6050 is included. Frozen sources and selection are unchanged; no selected/native cold replay, independent human review or formal-kernel acceptance is claimed.
Fresh read-only Git-free export replay also passes at head
9011bf83e85ecd0443c789cf03259442f750877d, under optimized isolated CPython with empty PATH/PYTHONPATH; exported file hashes remain unchanged. The newest hosted CI run is pending. Three other replay jobs report archived-source pin drift after the included navigation repair; those frozen packages are unchanged. The canonical investigation and remaining obligations are in Discussion #6073.Open next questions
Find an actual nonadaptive pair of reached residues and price table selection, access and tape cleanup under its caller. Separately, test whether a shared dispatcher can lower the physical control cost across configurations. Lower expected bit count alone does not fund either module.
Prepared by zxv with substantial OpenAI Codex assistance. JoyboyBrian's inverse lineage and Nick Petalas's stochastic-prefix context retain their attribution. The scoped contribution is the complete small denominator-13 catalogue, exact optimal means and explicit logical resource ledger.