{"abstract":"The exact lucas binomial residue result violates the stated contract at digit binomial multiplication.","category":"Numerics","checks":8,"contract":"Input [n,k,p], n,k>=0 p prime; return binomial(n,k) modulo p, zero when k>n. Bounds: n,k<2^30.","contract_signature":"x","evaluation_group":"s3-numerics-lucas-binomial-residue","failed_approach":"The partial repair math.comb(a,b)%p still violates the digit binomial multiplication invariant.","family":"s3-numerics-lucas-binomial-residue-digit-binomial-multiplication","id":"FA-15531","implementations":{"attempt":{"sha256":"21dbb9d61c9be8723de958adea9fd8843c823e60709a814a7a774220a62cc415","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    n,k,p=x;r=1\n    for _ in range(30):\n     if n==0 and k==0:break\n     a,b=n%p,k%p\n     if b>a:return 0\n     r=math.comb(a,b)%p\n     n,k=n//p,k//p\n    return r\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([1, 0, 2], 1), ([5, 1, 3], 2), ([0, 0, 2], 1), ([34, 37, 7], 0), ([0, 1, 2], 0), ([0, 2, 2], 0), ([0, 3, 2], 0), ([0, 4, 2], 0)], [([1, 1, 2], 1), ([8, 4, 3], 1), ([0, 0, 2], 1), ([34, 37, 7], 0), ([0, 17, 2], 0), ([0, 18, 2], 0), ([0, 19, 2], 0), ([0, 20, 2], 0)], [([4, 0, 2], 1), ([11, 10, 3], 2), ([0, 0, 2], 1), ([34, 37, 7], 0), ([0, 34, 2], 0), ([0, 35, 2], 0), ([0, 36, 2], 0), ([0, 37, 2], 0)], [([4, 4, 2], 1), ([14, 10, 3], 2), ([0, 0, 2], 1), ([34, 37, 7], 0), ([1, 13, 2], 0), ([1, 14, 2], 0), ([1, 15, 2], 0), ([1, 16, 2], 0)], [([5, 0, 2], 1), ([15, 12, 3], 2), ([0, 0, 2], 1), ([34, 37, 7], 0), ([1, 30, 2], 0), ([1, 31, 2], 0), ([1, 32, 2], 0), ([1, 33, 2], 0)]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"5d965d9110594ca67091ead45cba7f2b5ff1c4ea9b8f86c36c911ecb2038a91a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    n,k,p=x;r=1\n    for _ in range(30):\n     if n==0 and k==0:break\n     a,b=n%p,k%p\n     if b>a:return 0\n     r=(r+math.comb(a,b))%p\n     n,k=n//p,k//p\n    return r\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([1, 0, 2], 1), ([5, 1, 3], 2), ([0, 0, 2], 1), ([34, 37, 7], 0), ([0, 1, 2], 0), ([0, 2, 2], 0), ([0, 3, 2], 0), ([0, 4, 2], 0)], [([1, 1, 2], 1), ([8, 4, 3], 1), ([0, 0, 2], 1), ([34, 37, 7], 0), ([0, 17, 2], 0), ([0, 18, 2], 0), ([0, 19, 2], 0), ([0, 20, 2], 0)], [([4, 0, 2], 1), ([11, 10, 3], 2), ([0, 0, 2], 1), ([34, 37, 7], 0), ([0, 34, 2], 0), ([0, 35, 2], 0), ([0, 36, 2], 0), ([0, 37, 2], 0)], [([4, 4, 2], 1), ([14, 10, 3], 2), ([0, 0, 2], 1), ([34, 37, 7], 0), ([1, 13, 2], 0), ([1, 14, 2], 0), ([1, 15, 2], 0), ([1, 16, 2], 0)], [([5, 0, 2], 1), ([15, 12, 3], 2), ([0, 0, 2], 1), ([34, 37, 7], 0), ([1, 30, 2], 0), ([1, 31, 2], 0), ([1, 32, 2], 0), ([1, 33, 2], 0)]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-numerics-lucas-binomial-residue-digit-binomial-multiplication","generated_at":"2026-09-29T14:39:27.687493+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.","root_cause":"The digit binomial multiplication step uses (r+math.comb(a,b))%p instead of r*math.comb(a,b)%p.","sha256":"d13e90c0b12409e2bb7b8dba9f280bb80a90143588d53982156011beb859d605","title":"Lucas binomial residue: digit binomial multiplication · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.371,"exit_code":1,"observations":[{"actual":1,"check":"explicit oracle 0","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 1","expected":2,"passed":false},{"actual":1,"check":"explicit oracle 2","expected":1,"passed":true},{"actual":0,"check":"explicit oracle 3","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 4","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 6","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 7","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": 1, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.522,"exit_code":1,"observations":[{"actual":0,"check":"explicit oracle 0","expected":1,"passed":false},{"actual":1,"check":"explicit oracle 1","expected":2,"passed":false},{"actual":1,"check":"explicit oracle 2","expected":1,"passed":true},{"actual":0,"check":"explicit oracle 3","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 4","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 6","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 7","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 0, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": 1, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}