{"abstract":"The exact kummer binomial valuation result violates the stated contract at first addend selection.","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 n-k still violates the first addend selection invariant.","family":"s3-numerics-kummer-binomial-valuation-first-addend-selection","id":"FA-15541","implementations":{"attempt":{"sha256":"dac84cf453e46ae423db4db11f2bb3abd7785d45f6c125a14f227c23bbe71998","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=n-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 = [[([1, 0, 2], 0), ([59, 59, 7], 0), ([1, 1, 2], 0), ([2, 0, 2], 0), ([2, 1, 2], 1), ([2, 2, 2], 0), ([3, 0, 2], 0), ([3, 1, 2], 0)], [([2, 0, 2], 0), ([3, 1, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([5, 3, 2], 1), ([5, 4, 2], 0), ([5, 5, 2], 0), ([6, 0, 2], 0)], [([2, 1, 2], 1), ([4, 3, 2], 2), ([1, 0, 2], 0), ([59, 59, 7], 0), ([7, 7, 2], 0), ([8, 0, 2], 0), ([8, 1, 2], 3), ([8, 2, 2], 2)], [([3, 0, 2], 0), ([5, 2, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([9, 7, 2], 2), ([9, 8, 2], 0), ([9, 9, 2], 0), ([10, 0, 2], 0)], [([3, 1, 2], 0), ([6, 1, 2], 1), ([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":"7475ca164c7601d765c7868705b5a84c7b5cd8f6aa7c8dff852cffc5aae86bc2","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=n;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 = [[([1, 0, 2], 0), ([59, 59, 7], 0), ([1, 1, 2], 0), ([2, 0, 2], 0), ([2, 1, 2], 1), ([2, 2, 2], 0), ([3, 0, 2], 0), ([3, 1, 2], 0)], [([2, 0, 2], 0), ([3, 1, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([5, 3, 2], 1), ([5, 4, 2], 0), ([5, 5, 2], 0), ([6, 0, 2], 0)], [([2, 1, 2], 1), ([4, 3, 2], 2), ([1, 0, 2], 0), ([59, 59, 7], 0), ([7, 7, 2], 0), ([8, 0, 2], 0), ([8, 1, 2], 3), ([8, 2, 2], 2)], [([3, 0, 2], 0), ([5, 2, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([9, 7, 2], 2), ([9, 8, 2], 0), ([9, 9, 2], 0), ([10, 0, 2], 0)], [([3, 1, 2], 0), ([6, 1, 2], 1), ([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":"5e364b4b5949484edbdf7656f043fc16e79b32145b184e6540624fa1ffb521bf","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 = [[([1, 0, 2], 0), ([59, 59, 7], 0), ([1, 1, 2], 0), ([2, 0, 2], 0), ([2, 1, 2], 1), ([2, 2, 2], 0), ([3, 0, 2], 0), ([3, 1, 2], 0)], [([2, 0, 2], 0), ([3, 1, 2], 0), ([1, 0, 2], 0), ([59, 59, 7], 0), ([5, 3, 2], 1), ([5, 4, 2], 0), ([5, 5, 2], 0), ([6, 0, 2], 0)], [([2, 1, 2], 1), ([4, 3, 2], 2), ([1, 0, 2], 0), ([59, 59, 7], 0), ([7, 7, 2], 0), ([8, 0, 2], 0), ([8, 1, 2], 3), ([8, 2, 2], 2)], [([3, 0, 2], 0), ([5, 2, 2], 1), ([1, 0, 2], 0), ([59, 59, 7], 0), ([9, 7, 2], 2), ([9, 8, 2], 0), ([9, 9, 2], 0), ([10, 0, 2], 0)], [([3, 1, 2], 0), ([6, 1, 2], 1), ([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-first-addend-selection","generated_at":"2026-09-29T14:39:27.903997+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 k at the first addend selection step.","root_cause":"The first addend selection step uses n instead of k.","sha256":"9d9d0e405ec798ec617f1e83f77440d4b843ed7ae1b31c055694465fcd63b45c","title":"Kummer binomial valuation: first addend selection · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.129,"exit_code":1,"observations":[{"actual":1,"check":"explicit oracle 0","expected":0,"passed":false},{"actual":0,"check":"explicit oracle 1","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 2","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 3","expected":0,"passed":false},{"actual":1,"check":"explicit oracle 4","expected":1,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":2,"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\": 1, \"expected\": 0, \"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\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": 1, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.252,"exit_code":1,"observations":[{"actual":1,"check":"explicit oracle 0","expected":0,"passed":false},{"actual":0,"check":"explicit oracle 1","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 2","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 3","expected":0,"passed":false},{"actual":0,"check":"explicit oracle 4","expected":1,"passed":false},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":2,"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\": 1, \"expected\": 0, \"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\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": 0, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": 1, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.126,"exit_code":0,"observations":[{"actual":0,"check":"explicit oracle 0","expected":0,"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":1,"check":"explicit oracle 4","expected":1,"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\": 0, \"expected\": 0, \"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\": 1, \"expected\": 1, \"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"}