From 9b63d66187c3965ed234e8248a89a8ab486ce69b Mon Sep 17 00:00:00 2001 From: irvingcui <67258813+2018cx@users.noreply.github.com> Date: Fri, 4 Dec 2026 19:09:31 -0800 Subject: [PATCH 1/3] Create four-speed ring problem directory --- problems/four-speed-adversarial-ring/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 problems/four-speed-adversarial-ring/README.md diff --git a/problems/four-speed-adversarial-ring/README.md b/problems/four-speed-adversarial-ring/README.md new file mode 100644 index 0000000..2da3956 --- /dev/null +++ b/problems/four-speed-adversarial-ring/README.md @@ -0,0 +1 @@ +# Four-speed adversarial ring localization From 5600e3cb6acb751e327d1e9b396700a0907ca8f3 Mon Sep 17 00:00:00 2001 From: irvingcui <67258813+2018cx@users.noreply.github.com> Date: Sat, 5 Dec 2026 11:09:56 +0800 Subject: [PATCH 2/3] Formalize exact four-speed ring localization with a certificate verifier --- .../four-speed-adversarial-ring/README.md | 79 ++++++++++++++- .../four-speed-adversarial-ring/baseline.py | 11 +++ problems/four-speed-adversarial-ring/task.py | 99 +++++++++++++++++++ 3 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 problems/four-speed-adversarial-ring/baseline.py create mode 100644 problems/four-speed-adversarial-ring/task.py diff --git a/problems/four-speed-adversarial-ring/README.md b/problems/four-speed-adversarial-ring/README.md index 2da3956..1d4637a 100644 --- a/problems/four-speed-adversarial-ring/README.md +++ b/problems/four-speed-adversarial-ring/README.md @@ -1 +1,78 @@ -# Four-speed adversarial ring localization +--- +proposer: "@2018cx" +harness: "dot" +model: "undisclosed" +field: coding theory and certified combinatorial optimization +--- + +# Four-speed adversarial ring localization: exact optimum + +A cycle has 101 cells, indexed by the integers modulo 101. Fix a coloring +(b_i\in\{0,1\}) of these cells. The reader's unknown state is a starting +cell (i) and a signed velocity (v\in\{-2,-1,1,2\}). For (t=0,\ldots,L-1) +its uncorrupted reading at time (t) is (b_{i+vt\pmod{101}}). + +An adversary erases any one block of exactly five consecutive time positions +inside this length-(L) reading, reveals the positions of the erasures, and +can flip up to four of the surviving bits. The decoder knows the coloring. +Find the smallest (L\geq5) for which a coloring permits unique recovery of +both (i) and (v) for every state and allowed adversary. + +A complete answer must give an integer (L), a literal 101-bit coloring, and +an independently checkable exclusion of all smaller lengths. Heuristic +failure does not constitute an exclusion. For any fixed erased block, this +is equivalent to requiring Hamming distance at least nine between every pair +of distinct states after puncturing the block: two radius-four Hamming balls +intersect exactly when their centers are at distance at most eight. Increasing +(L) preserves feasibility, since, on the first (L) readings of a longer +one, one may enlarge the intersection with the erased block to a block of +five and discard the additional known bits. Thus it suffices to exclude +(L-1). + +This extends [the two-speed positioning problem](https://github.com/Halley-Lab/hee/pull/15). +The reverse headings create competing reversed words, any five-position +block has to be tolerated, and the objective is certified minimal length, +not a witness at a prescribed length. At (L=34), erasing the last five +readings and retaining only velocities 1 and 2 would give a witness to +that original problem. Related literature: Chee, Dao, Kiah, Ling and Wei, +[Robust Positioning Patterns with Low Redundancy](https://arxiv.org/abs/1912.13301). + +## Machine-checkable answer + +Return `{"L": length, "bits": "101 binary digits", "proof": "certificate"}`. +The baseline has a feasible coloring at (L=49) and no lower certificate. +This is an upper bound, not a claim of optimality. The objective score is 1 +for a verified optimality certificate and 0 for feasible colorings without +one; the target is 1. This deterministic problem has three public and three +holdout calls of the same instance. + +The lower certificate is a line-based resolution proof over the 101 color +variables for length (L-1). Clauses are represented by two nonnegative +decimal bitmasks: (P) contains positive literals, (N) contains negated +literals. They have no common bits. A line introduces one clause. + +- `a u v e P N`: state IDs (u2^{21}), so the starting +bounds are (27\leq L^\star\leq49). diff --git a/problems/four-speed-adversarial-ring/baseline.py b/problems/four-speed-adversarial-ring/baseline.py new file mode 100644 index 0000000..d2ca72b --- /dev/null +++ b/problems/four-speed-adversarial-ring/baseline.py @@ -0,0 +1,11 @@ +SOLVER = "@2018cx" +HARNESS = "dot" +MODEL = "undisclosed" + + +def solve(inp): + return { + "L": 49, + "bits": "11110100010011110100101101000011111010010111001010001011101101100111010010001001000101111100111000100", + "proof": "", + } diff --git a/problems/four-speed-adversarial-ring/task.py b/problems/four-speed-adversarial-ring/task.py new file mode 100644 index 0000000..bb21033 --- /dev/null +++ b/problems/four-speed-adversarial-ring/task.py @@ -0,0 +1,99 @@ +from math import comb + +FORMALIZER = "@2018cx" +HARNESS = "dot" +MODEL = "undisclosed" +MODE = "maximize" +TARGET = 1.0 +CASES = 3 +TIME_LIMIT_S = 60.0 +N = 101 +SPEEDS = (-2, -1, 1, 2) + + +def generate(seed): + return 0 + + +def pos(u, t): + return (u % N + SPEEDS[u // N] * t) % N + + +def works(bits, length): + words = [sum((bits[pos(u, t)] == "1") << t for t in range(length)) + for u in range(4 * N)] + erasures = [31 << t for t in range(length - 4)] + for u, a in enumerate(words): + for v in range(u): + diff = a ^ words[v] + d = diff.bit_count() + if d < 9 or (d < 14 and any(d - (diff & e).bit_count() < 9 for e in erasures)): + return False + return True + + +def exclusion(proof, length): + if proof == "packing": + m = length - 5 + return 4 * N * sum(comb(m, k) for k in range(min(4, m) + 1)) > (1 << m) + clauses = [] + for line in proof.splitlines(): + parts = line.split() + if not parts: + return False + op = parts[0] + args = [int(s) for s in parts[1:]] + if op == "s" and not args: + p, n = 0, 1 + elif op == "a" and len(args) == 5: + u, v, e, p, n = args + if not (0 <= u < v < 4 * N and 0 <= e <= length - 5 + and 0 <= p < 1 << N and 0 <= n < 1 << N) or p & n: + return False + possible = 0 + for t in range(length): + if e <= t < e + 5: + continue + a, b = 1 << pos(u, t), 1 << pos(v, t) + if a != b: + known = p | n + if not (known & a and known & b) or bool(n & a) != bool(n & b): + possible += 1 + if possible >= 9: + return False + elif op == "r" and len(args) == 3: + i, j, k = args + if not (0 <= i < len(clauses) and 0 <= j < len(clauses) and 0 <= k < N): + return False + pi, ni = clauses[i] + pj, nj = clauses[j] + bit = 1 << k + if not (((pi & nj) | (pj & ni)) & bit): + return False + p, n = (pi | pj) & ~bit, (ni | nj) & ~bit + if p & n: + return False + else: + return False + clauses.append((p, n)) + return bool(clauses) and clauses[-1] == (0, 0) + + +def verify(inp, out, ref_out): + if not isinstance(out, dict) or set(out) != {"L", "bits", "proof"}: + return False + length, bits, proof = out["L"], out["bits"], out["proof"] + if not (isinstance(length, int) and not isinstance(length, bool) and 27 <= length <= 49 + and isinstance(bits, str) and len(bits) == N and set(bits) <= {"0", "1"} + and isinstance(proof, str)): + return False + if not works(bits, length): + return False + try: + return not proof or exclusion(proof, length - 1) + except ValueError: + return False + + +def score(inp, out): + return int(bool(out["proof"])) From a52d96cac18329e111121d790738602b09f01823 Mon Sep 17 00:00:00 2001 From: irvingcui <67258813+2018cx@users.noreply.github.com> Date: Sat, 5 Dec 2026 11:11:08 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Tighten=20verified=20bounds=20to=2029?= =?UTF-8?q?=E2=80=9344?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../four-speed-adversarial-ring/README.md | 46 ++++++++++++------- .../four-speed-adversarial-ring/baseline.py | 4 +- problems/four-speed-adversarial-ring/task.py | 9 ++-- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/problems/four-speed-adversarial-ring/README.md b/problems/four-speed-adversarial-ring/README.md index 1d4637a..01515b5 100644 --- a/problems/four-speed-adversarial-ring/README.md +++ b/problems/four-speed-adversarial-ring/README.md @@ -7,15 +7,15 @@ field: coding theory and certified combinatorial optimization # Four-speed adversarial ring localization: exact optimum -A cycle has 101 cells, indexed by the integers modulo 101. Fix a coloring -(b_i\in\{0,1\}) of these cells. The reader's unknown state is a starting -cell (i) and a signed velocity (v\in\{-2,-1,1,2\}). For (t=0,\ldots,L-1) -its uncorrupted reading at time (t) is (b_{i+vt\pmod{101}}). +A cycle has 101 cells, indexed modulo 101, each colored 0 or 1. +The reader's unknown state is a starting cell i and a signed velocity +v in {-2, -1, 1, 2}. At time t = 0, ..., L - 1 it reads the color +at cell (i + v*t) mod 101. An adversary erases any one block of exactly five consecutive time positions inside this length-(L) reading, reveals the positions of the erasures, and can flip up to four of the surviving bits. The decoder knows the coloring. -Find the smallest (L\geq5) for which a coloring permits unique recovery of +Find the smallest L ≥ 5 for which a coloring permits unique recovery of both (i) and (v) for every state and allowed adversary. A complete answer must give an integer (L), a literal 101-bit coloring, and @@ -32,7 +32,7 @@ five and discard the additional known bits. Thus it suffices to exclude This extends [the two-speed positioning problem](https://github.com/Halley-Lab/hee/pull/15). The reverse headings create competing reversed words, any five-position block has to be tolerated, and the objective is certified minimal length, -not a witness at a prescribed length. At (L=34), erasing the last five +not a witness at a prescribed length. At L=34, erasing the last five readings and retaining only velocities 1 and 2 would give a witness to that original problem. Related literature: Chee, Dao, Kiah, Ling and Wei, [Robust Positioning Patterns with Low Redundancy](https://arxiv.org/abs/1912.13301). @@ -40,7 +40,7 @@ that original problem. Related literature: Chee, Dao, Kiah, Ling and Wei, ## Machine-checkable answer Return `{"L": length, "bits": "101 binary digits", "proof": "certificate"}`. -The baseline has a feasible coloring at (L=49) and no lower certificate. +The baseline has a feasible coloring at L=44 and no lower certificate. This is an upper bound, not a claim of optimality. The objective score is 1 for a verified optimality certificate and 0 for feasible colorings without one; the target is 1. This deterministic problem has three public and three @@ -58,21 +58,35 @@ literals. They have no common bits. A line introduces one clause. cells the verifier counts their actual mismatch; every other retained comparison is optimistically counted as a possible mismatch. The clause is accepted only if even this upper bound is below nine. -- `s`: the unit clause (\neg x_0), permissible because global color +- `s`: the unit clause not x₀, permissible because global color complementation preserves all distances. - `r i j k`: resolve two earlier zero-based clause IDs on color variable - (k\in[0,100]). They must contain opposite literals of (k). The + k in [0, 100]. They must contain opposite literals of (k). The resolvent is the union with those two literals removed, and it must not be a tautology. The final derived clause must be empty. Each axiom is checked directly against a necessary distance constraint and each resolution step preserves logical implication; thus the empty clause excludes every coloring at -length (L-1). The checker also accepts the token `packing` when the -radius-four sphere-packing bound alone rules out (L-1). The coloring is -checked independently over all 81,406 unordered state pairs and every -erasable block. No SAT solver's unsupported verdict is accepted. +length L−1. The checker also accepts the token `lp24` for length 28, +using the elementary lower bound below. The coloring is checked independently +over all 81,406 unordered state pairs and every erasable block. No SAT solver's +unsupported verdict is accepted. -The fixed-block packing bound at (L=26) gives -(404\sum_{j=0}^{4}\binom{21}{j}=3{,}048{,}988>2^{21}), so the starting -bounds are (27\leq L^\star\leq49). +## Starting bounds: 29 ≤ L* ≤ 44 + +The baseline gives the upper bound, with minimum retained distance 9 +over all 3,256,240 state-pair/erasure combinations. + +For the lower bound, at L=28 fix any erased block. The 404 remaining words +would form a binary length-23 code with minimum distance 9. Append a parity +bit to each word, giving a length-24 code whose distinct distances are +even and at least 10. Let f(x)=(10−x)(x−14)(x−16). Then f(0)=2240 and +f(x)≤0 at all possible distinct distances. With z=24−2x, the first three +binary Krawtchouk polynomials are K₁=z, K₂=(z²−24)/2 and K₃=(z³−70z)/6. +The identity 4 f=32+27 K₁+8 K₂+3 K₃ holds. For any binary code the sum of +Kⱼ over ordered pairs of words is nonnegative: it equals the sum, over +j-element coordinate subsets, of the squared sums of their parity +characters. Thus for M codewords the sum of 4f is at least 32 M² and at +most 8960 M, so M≤280, contradicting 404. Monotonicity excludes every +shorter length. The exact optimum is unknown. diff --git a/problems/four-speed-adversarial-ring/baseline.py b/problems/four-speed-adversarial-ring/baseline.py index d2ca72b..ef0afa3 100644 --- a/problems/four-speed-adversarial-ring/baseline.py +++ b/problems/four-speed-adversarial-ring/baseline.py @@ -5,7 +5,7 @@ def solve(inp): return { - "L": 49, - "bits": "11110100010011110100101101000011111010010111001010001011101101100111010010001001000101111100111000100", + "L": 44, + "bits": "00110101010101110011000110011100100100111111011001110010110100110010101100000010110100101110100000000", "proof": "", } diff --git a/problems/four-speed-adversarial-ring/task.py b/problems/four-speed-adversarial-ring/task.py index bb21033..93f9274 100644 --- a/problems/four-speed-adversarial-ring/task.py +++ b/problems/four-speed-adversarial-ring/task.py @@ -1,5 +1,3 @@ -from math import comb - FORMALIZER = "@2018cx" HARNESS = "dot" MODEL = "undisclosed" @@ -33,9 +31,8 @@ def works(bits, length): def exclusion(proof, length): - if proof == "packing": - m = length - 5 - return 4 * N * sum(comb(m, k) for k in range(min(4, m) + 1)) > (1 << m) + if proof == "lp24": + return length == 28 # Parity extension and the Krawtchouk bound proved in README.md. clauses = [] for line in proof.splitlines(): parts = line.split() @@ -83,7 +80,7 @@ def verify(inp, out, ref_out): if not isinstance(out, dict) or set(out) != {"L", "bits", "proof"}: return False length, bits, proof = out["L"], out["bits"], out["proof"] - if not (isinstance(length, int) and not isinstance(length, bool) and 27 <= length <= 49 + if not (isinstance(length, int) and not isinstance(length, bool) and 29 <= length <= 44 and isinstance(bits, str) and len(bits) == N and set(bits) <= {"0", "1"} and isinstance(proof, str)): return False