{"abstract":"The exact kummer binomial valuation result violates the stated contract at digit overflow carry.","category":"Numerics","checks":8,"contract":"Input [n,k,p], 0<=k<=n p prime; return exponent of p in binomial(n,k) via carries adding k and n-k. Bounds: n<2^39.","evaluation_group":"s3-numerics-kummer-binomial-valuation","failed_approach":"The partial repair t%p still violates the digit overflow carry invariant.","family":"s3-numerics-kummer-binomial-valuation-digit-overflow-carry","id":"FA-15556","implementations":{"attempt":{"sha256":"9f38fe9e9ba05a80a6dd82ed4a3286d5fcb416af1a1eab935b1b40c32475ed6c","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;a=k;b=n-k;carry=0;count=0\n    for _ in range(40):\n     if a==0 and b==0 and carry==0:break\n     t=a%p+b%p+carry\n     carry=t%p\n     count+=carry\n     a,b=a//p,b//p\n    return count\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 1, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([1, 1, 2], 0), ([2, 0, 2], 0), ([2, 2, 2], 0), ([3, 0, 2], 0), ([3, 1, 2], 0)], [([4, 1, 2], 2), ([2, 1, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([5, 3, 2], 1), ([5, 4, 2], 0), ([5, 5, 2], 0), ([6, 0, 2], 0)], [([4, 2, 2], 1), ([3, 1, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([7, 7, 2], 0), ([8, 0, 2], 0), ([8, 1, 2], 3), ([8, 2, 2], 2)], [([4, 3, 2], 2), ([4, 0, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([9, 7, 2], 2), ([9, 8, 2], 0), ([9, 9, 2], 0), ([10, 0, 2], 0)], [([5, 2, 2], 1), ([4, 3, 2], 2), ([1, 0, 2], 0), ([59, 59, 7], 0), ([11, 3, 2], 0), ([11, 4, 2], 1), ([11, 5, 2], 1), ([11, 6, 2], 1)]]\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":"4e4c4aee8b745a17feb88f5f32fdd115d36b1b16488c071441cf4988a568d9b0","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;a=k;b=n-k;carry=0;count=0\n    for _ in range(40):\n     if a==0 and b==0 and carry==0:break\n     t=a%p+b%p+carry\n     carry=int(t>p)\n     count+=carry\n     a,b=a//p,b//p\n    return count\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 1, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([1, 1, 2], 0), ([2, 0, 2], 0), ([2, 2, 2], 0), ([3, 0, 2], 0), ([3, 1, 2], 0)], [([4, 1, 2], 2), ([2, 1, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([5, 3, 2], 1), ([5, 4, 2], 0), ([5, 5, 2], 0), ([6, 0, 2], 0)], [([4, 2, 2], 1), ([3, 1, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([7, 7, 2], 0), ([8, 0, 2], 0), ([8, 1, 2], 3), ([8, 2, 2], 2)], [([4, 3, 2], 2), ([4, 0, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([9, 7, 2], 2), ([9, 8, 2], 0), ([9, 9, 2], 0), ([10, 0, 2], 0)], [([5, 2, 2], 1), ([4, 3, 2], 2), ([1, 0, 2], 0), ([59, 59, 7], 0), ([11, 3, 2], 0), ([11, 4, 2], 1), ([11, 5, 2], 1), ([11, 6, 2], 1)]]\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"},"fixed":{"sha256":"373e3d597d2ce0cce3f6937bc017b97078dc980b00958b8052c9fb9cb4ee98dc","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;a=k;b=n-k;carry=0;count=0\n    for _ in range(40):\n     if a==0 and b==0 and carry==0:break\n     t=a%p+b%p+carry\n     carry=int(t>=p)\n     count+=carry\n     a,b=a//p,b//p\n    return count\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 1, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([1, 1, 2], 0), ([2, 0, 2], 0), ([2, 2, 2], 0), ([3, 0, 2], 0), ([3, 1, 2], 0)], [([4, 1, 2], 2), ([2, 1, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([5, 3, 2], 1), ([5, 4, 2], 0), ([5, 5, 2], 0), ([6, 0, 2], 0)], [([4, 2, 2], 1), ([3, 1, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([7, 7, 2], 0), ([8, 0, 2], 0), ([8, 1, 2], 3), ([8, 2, 2], 2)], [([4, 3, 2], 2), ([4, 0, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([9, 7, 2], 2), ([9, 8, 2], 0), ([9, 9, 2], 0), ([10, 0, 2], 0)], [([5, 2, 2], 1), ([4, 3, 2], 2), ([1, 0, 2], 0), ([59, 59, 7], 0), ([11, 3, 2], 0), ([11, 4, 2], 1), ([11, 5, 2], 1), ([11, 6, 2], 1)]]\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-kummer-binomial-valuation-digit-overflow-carry","generated_at":"2026-09-29T14:39:28.049384+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.","repair":"Use int(t>=p) at the digit overflow carry step.","root_cause":"The digit overflow carry step uses int(t>p) instead of int(t>=p).","sha256":"36c71b3150bba10a1affbe0962e34805969592379e85813ee3fe51779417b98f","title":"Kummer binomial valuation: digit overflow carry · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.65,"exit_code":1,"observations":[{"actual":0,"check":"explicit oracle 0","expected":1,"passed":false},{"actual":40,"check":"explicit oracle 1","expected":0,"passed":false},{"actual":197,"check":"explicit oracle 2","expected":0,"passed":false},{"actual":40,"check":"explicit oracle 3","expected":0,"passed":false},{"actual":39,"check":"explicit oracle 4","expected":0,"passed":false},{"actual":39,"check":"explicit oracle 5","expected":0,"passed":false},{"actual":1,"check":"explicit oracle 6","expected":0,"passed":false},{"actual":1,"check":"explicit oracle 7","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 0, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": 40, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 197, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": 40, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": 39, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": 39, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": 1, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.446,"exit_code":1,"observations":[{"actual":0,"check":"explicit oracle 0","expected":1,"passed":false},{"actual":0,"check":"explicit oracle 1","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 2","expected":0,"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\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 0, \"expected\": 0, \"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"},"fixed":{"elapsed_ms":45.934,"exit_code":0,"observations":[{"actual":1,"check":"explicit oracle 0","expected":1,"passed":true},{"actual":0,"check":"explicit oracle 1","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 2","expected":0,"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":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 0, \"expected\": 0, \"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\": true}\n"}},"verified":true,"visibility":"public"}