diff --git a/problems/four-speed-adversarial-ring/README.md b/problems/four-speed-adversarial-ring/README.md new file mode 100644 index 0000000..01515b5 --- /dev/null +++ b/problems/four-speed-adversarial-ring/README.md @@ -0,0 +1,92 @@ +--- +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 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 ≥ 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 +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=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 +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 (u= 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 29 <= length <= 44 + 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"]))