research/lab/py/two-base-instrument
0 directories and 2 files in research/lab/py/two-base-instrument.
two-base-instrument
- The falsification test that must pass before any two-base instrument is built: does the count of a two-base intersection, read on a
log Ngrid, carry both lattice frequencies at once. - The cell is
dim 1, base3digits{0, 1}against base5digits{0, 1, 2}, a multiplicatively independent pair of positive budgetlog_3 2 + log_5 3 - 1. C(N)is the number of1 <= n < Nwhose base-3 digits all lie in{0, 1}and whose base-5 digits all lie in{0, 1, 2}. The enumeration walks the base-3 digits from the top down and prunes a branch as soon as a base-5 digit that the branch has already settled leaves{0, 1, 2}: afterjbase-3 digits the value lies in an interval of width3^(level-j), and every base-5 digit position on which the two ends of that interval agree is settled for the whole branch.- The mechanics of the reading are inherited from
lab/py/complex-dimensions, functionperiodogram_peak:g(u) = ln C(e^u)detrended inu, a Blackman window, the mean removed, the power on a direct grid over[0.5, 14], each local maximum refined by golden section. - The decision rule is this study's own and is weaker than the one
dimensions.mdstates. That page takes the global argmax of the band and asks it to land within1%of the prediction; a two-base count has to be read at frequencies that are not its loudest, so here a prediction counts present when the nearest local maximum lies within1%of it and carries at least10xthe median power of the band. - A power ratio is a property of its window. Every reading prints the window span, the number of maxima above
10xthe median and the fraction of the band their1%neighbourhoods cover, which is the chance a prediction is met by position alone, and ratios are comparable only across windows of the same span and the same crowding. - Every reading is printed twice, detrended by a straight line and by a cubic, because the local exponent of the two-base count is still falling at the height reached and a linear detrend leaves curvature at the low-frequency end.
- Each strongest maximum is tested against the whole lattice
m 2 pi / ln 3 + n 2 pi / ln 5with|m|, |n| <= 8, so a maximum matching no prediction is a maximum matching no small combination of the two. - Three one-base controls and one block model calibrate the rule: the base-3 factor alone, the base-5 factor alone, the multiplicatively dependent pair base
3digits{0, 1}against base9digits{0, 1, 3}, which the collapse theorem turns into the single base-9 design{0, 1, 3}of exponent exactlylog_9 3 = 1/2, and the block modelC3(N) C5(N) / N, which multiplies the two band structures with no joint arithmetic. - The detector reads a count that grows, and this one does not grow everywhere. A member of the base-3 design with
k+1digits lies in[3^k, (3^(k+1)-1)/2]and a member of the base-5 design withi+1digits in[5^i, (5^(i+1)-1)/2], so the designs occupy0.369070and0.569323of their own decades andCis exactly constant on every stretch where the two bands miss. - Exact integer arithmetic in the enumeration and in the band test; floating point only in the detector. Pure Python, no dependency outside the standard library.
VERBS
control Menumerates the cell to3^levelforlevel 0..Mtwice, once by the pruned walk and once by testing every integer below3^levelagainst both digit rules, prints whether the two lists agree, and prints the first members of the cell. Runtime0.03s atM = 9.cell levelprints the height3^level, the budget rounded up, the node count, the hit count, the enumeration time, and then the reading on the intersection over the full window and over its upper half, followed by the base-3 and base-5 controls. Runtime27s atlevel 44and82s atlevel 47, of which the walk prints78s, one core.collapse Mruns the dependent pair to3^Mthrough the same pipeline. Runtime6s atM = 28, where the hit count4782968is within a factor1.2of the hit count of the independent cell atlevel 44.ladder A Breads the full window at every height from3^Ato3^Bunder both detrends and prints one row per height and detrend: the hit count, the hits new in that decade, the window span, the crowding of the band, and the error, power ratio and verdict at both frequencies. Runtime4min19s atA = 38,B = 47.blocks levelprints the decades of3below3^levelon which the two design bands do not meet, so that the cell has no member there andCis exactly constant across the decade, and then runs the same reading on the block modelC3(N) C5(N) / N. Runtime0.8s atlevel 47.
RUN
uv run python research/lab/py/two-base-instrument/detector.py control 9
uv run python research/lab/py/two-base-instrument/detector.py cell 44
uv run python research/lab/py/two-base-instrument/detector.py cell 47
uv run python research/lab/py/two-base-instrument/detector.py collapse 28
uv run python research/lab/py/two-base-instrument/detector.py ladder 38 47
uv run python research/lab/py/two-base-instrument/detector.py blocks 44
uv run python research/lab/py/two-base-instrument/detector.py blocks 47
WITNESSES
- Each row is a number this study prints and stands behind; the page section they belong to is
cobham.md. - The enumerator agrees with direct digit filtering at every level to
3^9, where both routes return the same42values, and the first members of the cell are1, 10, 12, 27, 30, 31, 36, 37, 252, 255, 256, 280. - The height
3^44 = 984770902183611232881, the hit count5667470, and at3^47the hit count19042219. - The budget
0.313536rounded up, against a fitted exponent0.323301over the whole window and0.295978over its upper half at3^44,0.318728and0.292184at3^47. - The base-3 control at
3^44, window span38.05,11maxima above10xthe median covering0.113of the band:2 pi / ln 3 = 5.719202met at5.719220, error0.000%, power1.7e7times the median under the linear detrend and1.9e7under the cubic;2 pi / ln 5at error1.115%and power35.9under the linear detrend, and at error0.966%and power39.2under the cubic, which passes the rule at a frequency absent by construction. - The same control at
3^47, window span41.34,10loud maxima covering0.104:2 pi / ln 5at error3.151%and power2.54under the linear detrend and2.791%and2.6under the cubic, so the pass at3^44does not recur. - The base-5 control at
3^44, window span38.49,4loud maxima covering0.048:2 pi / ln 5 = 3.903963met at3.903959, error0.000%, power4.0e6;2 pi / ln 3at error1.060%and power2.21under the linear detrend and at0.963%and1.95under the cubic, inside the tolerance and held out by the power gate alone. - The same control at
3^47, window span41.79,17loud maxima covering0.150:2 pi / ln 3at error1.012%and power1.02under the linear detrend and1.000%and0.941under the cubic. - The dependent control at
3^28 = 9^14, window span17.47,4loud maxima covering0.042: hit count exactly3^14 - 1 = 4782968, fitted exponent0.497809against the exact1/2,2 pi / ln 9 = 2.859601met at2.859889, error0.010%, power886times the median, and2 pi / ln 3met at error0.003%, power2.5e3. - The block model at
3^44, window span28.26,4loud maxima covering0.043: both frequencies met at errors0.002%and0.003%, and the nearest maximum to the difference frequency1.815239at1.895843, error4.440%, power0.588times the median, so block structure puts nothing loud where the cell's strongest maximum sits. - The block model at
3^47, window span31.55,4loud maxima covering0.043:2 pi / ln 3met at error0.001%and power1.33e6times the median,2 pi / ln 5met at0.004%and9.79e5, so the two band structures alone carry both frequencies at five to six orders of magnitude above the floor. - The independent cell at
3^44, window span27.41,4loud maxima covering0.020:2 pi / ln 3not met, nearest maximum5.638828, error1.405%, power24;2 pi / ln 5met at3.921970, error0.461%, power16.5. - The independent cell at
3^47, window span30.70,4loud maxima covering0.020:2 pi / ln 3not met, nearest maximum5.634120, error1.488%, power22.5;2 pi / ln 5met at3.927166, error0.594%, power15.7. - The independent cell on the upper half of its window at
3^44, counts149469to5667470, span13.71: neither frequency met, but2 pi / ln 3sits at error0.825%under the linear detrend and0.791%under the cubic, inside the tolerance and held out by the power gate alone at5.55and6.1times the median. - The ladder from
3^38to3^47: both frequencies are met on the full window under both detrends atlevel 38, 39, 40, 41, and2 pi / ln 3is not met fromlevel 42up, its error rising from1.034%to1.574%while its power ratio stays between22and25. - The decades
[3^j, 3^(j+1))below3^47whose two design bands do not meet, so that the cell has no member in them, arej = 1, 4, 17, 20, 23, 26, 36, 39, 42, 45, which is10of the47; the ladder confirms each of the three inside its range with a height whose new hits are0, atlevel 40, 43, 46. - The strongest maximum of the independent cell is
1.702087at3^44and1.697925at3^47, at57and68times the median, and the nearestm 2 pi / ln 3 + n 2 pi / ln 5with|m|, |n| <= 8is(1, -1) = 1.815239at errors6.233%and6.463%.
- detector.py13.0 kB
- README.md9.5 kB