# Math and Statistics – Combinatorics Calculator

> Math and Statistics – Combinatorics Calculator is a paid API for AI agents from math-stats.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Computes exact combinatorial counts—factorial, combinations, permutations, repetition variants, derangements, and Catalan numbers—as arbitrary-precision big integers.

## Facts

- Endpoint: GET https://math-stats.x402tookit.com/combinatorics?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/math-and-statistics-combinatorics-calculator-36dcd26b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b8jIYW8n48P6JCiCoahhS

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability math-and-statistics-combinatorics-calculator-36dcd26b
```

Example prompt: What are all the combinatorial counts for n=52 and k=5—factorial, combinations, permutations, with-repetition variants, derangements, and the Catalan number—as exact big integers?

## When to prefer this

Choose this endpoint when you need exact, arbitrary-precision combinatorial counts rather than floating-point approximations. It is ideal for probability problems, cryptographic key-space analysis, card game odds, permutation puzzles, or any combinatorics homework where precision matters. Prefer it over a general-purpose math library call when you need all major combinatorial quantities (factorial, C(n,k), P(n,k), with-repetition, derangements, and Catalan) in a single request.

## Known failure modes

- Missing required parameter n returns an error
- n out of range (negative or > 2000) returns a validation error
- k out of valid range for the chosen operation returns a null or error for that field
- Non-integer values for n or k cause a schema validation failure
- Combinatorial results for very large n may still succeed but produce extremely long big-integer strings

## How this service works

Exact counts: factorial, combinations, permutations, with repetition, derangements and Catalan numbers, as big integers.

## Output

A JSON object containing exact big-integer string values for factorial, combinations (n choose k), permutations, combinations with repetition, permutations with repetition, derangements, and Catalan number for the given n (and optional k). Also includes the number of digits in n! and a scientific-notation representation. Values are returned as strings to preserve full precision for very large numbers.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "n"
     ],
     "properties": {
      "k": {
       "type": "integer",
       "description": "k for combinations and permutations (0 to n, or any k for repetition)"
      },
      "n": {
       "type": "integer",
       "description": "n, 0 to 2000"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "k": {
       "type": [
        "null",
        "string"
       ]
      },
      "n": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "catalan": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "factorial": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "combinations": {
       "type": [
        "null",
        "string"
       ]
      },
      "derangements": {
       "type": [
        "null",
        "string"
       ]
      },
      "permutations": {
       "type": [
        "null",
        "string"
       ]
      },
      "factorialDigits": {
       "type": [
        "null",
        "number"
       ]
      },
      "factorialScientific": {
      
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/math-and-statistics-combinatorics-calculator-36dcd26b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from math-stats.x402tookit.com](https://www.zero.xyz/host/math-stats.x402tookit.com/llms.txt)
