{
  "capability_id": "math.combinatorics",
  "tool_id": "combinatorics",
  "engine": "combinatorics",
  "calculation_version": "1.0.0",
  "generated_at": "2026-09-16T14:39:28.357Z",
  "engine_build": "2026-09-16",
  "test_count": 11,
  "passed": 11,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 2,
      "passed": 2
    },
    "boundary": {
      "total": 3,
      "passed": 3
    },
    "property": {
      "total": 6,
      "passed": 6
    }
  },
  "engine_tested": true,
  "expert_reviewed": false,
  "internally_reviewed": false,
  "review_kind": null,
  "source_checked": true,
  "reviewed_by": null,
  "reviewer_role": null,
  "last_reviewed": null,
  "expert_review": {
    "status": "optional_not_performed",
    "reviewer": null,
    "scope": [
      "formula",
      "input semantics",
      "assumptions",
      "limitations",
      "sources",
      "tests"
    ],
    "note": "Domain expert review is optional under CVP (CVP-EXP-01). Absence does not block CVP Verified. See Review policy for supplemental domain assurance."
  },
  "internal_review": {
    "status": "not_applicable",
    "reviewer": null
  },
  "page": "https://www.calculatorx.com/calc/math/permutation-combination",
  "api": "https://www.calculatorx.com/api/v1/calc/combinatorics",
  "schema_input": "https://www.calculatorx.com/schemas/math.combinatorics.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/math.combinatorics.output.json",
  "assumptions": [
    "Integers 0 ≤ k ≤ n ≤ 1000",
    "Not factorial n!",
    "Not multinomial and not with-replacement"
  ],
  "limitations": [
    "Not the factorial product page — use /calc/math/factorial for n!",
    "Not multinomial coefficients and not with-replacement selections",
    "Domain 0 ≤ k ≤ n ≤ 1000",
    "k > n → INVALID_INPUT",
    "unknown mode → INVALID_MODE"
  ],
  "boundary_conditions": [
    "missing n or k → MISSING_REQUIRED_INPUT",
    "k > n → INVALID_INPUT",
    "n > 1000 → VALUE_ABOVE_MAX",
    "unknown mode → INVALID_MODE"
  ],
  "sources": [
    "ISO 80000-2:2019 Quantities and units — Mathematics (combinatorial numbers)",
    "NIST / standard discrete-math identity P(n,k) = C(n,k)·k!"
  ],
  "methods": [],
  "fingerprint": "sha256:7e6eeaa69cdb1b2c70587975c2bc20dae683842b8ac1fcb2070fd44859cda07e",
  "tests": [
    {
      "id": "golden-ncr",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "combination",
        "n": 10,
        "k": 3
      },
      "expect": {
        "value": 120,
        "mode": "combination"
      },
      "expectWarning": null,
      "actual": {
        "n": 10,
        "k": 3,
        "mode": "combination",
        "symbol": "C(10,3)",
        "formula": "C(n,k) = n! / (k!(n−k)!)",
        "value": 120,
        "exact": "120",
        "digits": 3,
        "max_n": 1000
      },
      "tol": null
    },
    {
      "id": "golden-npr",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "permutation",
        "n": 10,
        "k": 3
      },
      "expect": {
        "value": 720,
        "mode": "permutation"
      },
      "expectWarning": null,
      "actual": {
        "n": 10,
        "k": 3,
        "mode": "permutation",
        "symbol": "P(10,3)",
        "formula": "P(n,k) = n! / (n−k)!",
        "value": 720,
        "exact": "720",
        "digits": 3,
        "max_n": 1000
      },
      "tol": null
    },
    {
      "id": "boundary-k-gt-n",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "n": 5,
        "k": 6
      },
      "expectError": "INVALID_INPUT",
      "code": "INVALID_INPUT",
      "error": "k must be ≤ n."
    },
    {
      "id": "boundary-combo-missing",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "n": 5
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "Enter a non-negative integer k."
    },
    {
      "id": "boundary-combo-mode",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "factorial",
        "n": 5,
        "k": 2
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be permutation or combination."
    },
    {
      "id": "property-c-10-3",
      "ok": true,
      "kind": "property",
      "detail": "C(10,3)=120",
      "expect": 120,
      "actual": 120
    },
    {
      "id": "property-p-10-3",
      "ok": true,
      "kind": "property",
      "detail": "P(10,3)=720",
      "expect": 720,
      "actual": 720
    },
    {
      "id": "property-p-c-k",
      "ok": true,
      "kind": "property",
      "detail": "P(n,k)=C(n,k)·k!",
      "expect": 720,
      "actual": 720
    },
    {
      "id": "property-c-sym",
      "ok": true,
      "kind": "property",
      "detail": "C(n,k)=C(n,n−k)",
      "expect": 120,
      "actual": 120
    },
    {
      "id": "property-c-zero",
      "ok": true,
      "kind": "property",
      "detail": "C(n,0)=1",
      "expect": 1,
      "actual": 1
    },
    {
      "id": "property-p-nn",
      "ok": true,
      "kind": "property",
      "detail": "P(n,n)=n!",
      "expect": 120,
      "actual": 120
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 11,
      "total": 11,
      "golden": 2,
      "boundary": 3,
      "property": 6
    },
    "contract_checks": {
      "passed": 4,
      "total": 4
    }
  },
  "evidence_core_generated_at": "2026-09-16T14:30:31.968Z",
  "rendered_at": "2026-09-16T14:39:28.357Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.0.0",
    "artifacts": {
      "engine": "1.0.0",
      "page": "1.0.0",
      "capability": "1.0.0",
      "evidence": "1.0.0",
      "input_schema": "1.0.0",
      "output_schema": "1.0.0",
      "mcp_contract": "1.0.0"
    },
    "digests": {
      "input_schema_sha256": "71247776818687a0fdf6f5a6ed18e38562fab8d1efc11b8e7cec5f97da15a36f",
      "output_schema_sha256": "8e8ef711c388ceb0caa8b907c885e03f9580cd2e0f3530f4e1d0578e114eb27b",
      "evidence_sha256": "06d5dfbde9ac940d52af37eb680cb1d3540b45ef31c53e4048d1db28eb7c77b5",
      "evidence_core_sha256": "06d5dfbde9ac940d52af37eb680cb1d3540b45ef31c53e4048d1db28eb7c77b5",
      "capability_sha256": "fb282a3737d62a6c0660b076248eb3b208ed7dff670bf3159133f85c20b9f9b1",
      "engine_sha256": "e334f2538fa740d4d06695357567d1c4dc3aba80b21a914697847445f7e5bad8",
      "mcp_contract_sha256": "d43d6b749952694caf9257df4c7c5eb805cccdce3e3021e92420f04757702e4c"
    },
    "contract_checks": {
      "total": 4,
      "passed": 4,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.0.0"
        },
        {
          "id": "schema-valid-input-executes",
          "status": "pass"
        },
        {
          "id": "engine-success-output-validates-schema",
          "status": "pass"
        },
        {
          "id": "schema-rejects-incomplete-input",
          "status": "pass"
        }
      ]
    },
    "report": "https://www.calculatorx.com/.well-known/calculatorx-release-integrity.json"
  }
}
