Catalog/gt-permutations-npr

Game Theory

Permutations nPr API

Computes the exact number of ordered arrangements P(n,r)=n!/(n-r)! using BigInt so large values stay exact. Answers 'How many ways to arrange 3 of 10 runners on a podium?', 'What is nPr?'.

Price$0.02per request
MethodPOST
Route/v1/gametheory/permutations
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
combinatoricsnprpermutationsarrangementsorderedcountingfactorialdiscrete
API URLhttps://x402.hexl.dev/v1/gametheory/permutations
Integration docs
Example request
{
  "n": 10,
  "r": 3
}
Example response
{
  "n": 10,
  "r": 3,
  "permutations": 720,
  "permutationsExact": "720",
  "isExactInteger": true,
  "notation": "P(10,3) = 10! / (7)!",
  "interpretation": "There are 720 ordered arrangements of 3 items selected from 10."
}
Input schema
{
  "type": "object",
  "required": [
    "n",
    "r"
  ],
  "properties": {
    "n": {
      "type": "integer",
      "minimum": 0,
      "examples": [
        10
      ]
    },
    "r": {
      "type": "integer",
      "minimum": 0,
      "examples": [
        3
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}