Game Theory
Coupon collector API
Computes the expected number of random draws (with replacement) to collect all (or k of n) distinct coupon types, plus variance and standard deviation. Answers 'How many cereal boxes to get all 6 toys?', 'Expected draws to complete a collectible set?'.
Price$0.04per request
MethodPOST
Route/v1/gametheory/coupon-collector
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
probabilitycoupon-collectorexpectationharmoniccollectiblesgachadiscretedraws
API URL
Integration docshttps://x402.hexl.dev/v1/gametheory/coupon-collectorExample request
{
"n": 6
}Example response
{
"n": 6,
"collect": 6,
"expectedDraws": 14.7,
"expectedDrawsRounded": 15,
"variance": 38.99,
"stdDev": 6.244197,
"interpretation": "Expected number of random draws (with replacement) to collect 6 distinct of 6 item types is ≈ 14.7 (≈ 15 draws)."
}Input schema
{
"type": "object",
"required": [
"n"
],
"properties": {
"n": {
"type": "integer",
"minimum": 1,
"maximum": 1000000,
"examples": [
6
]
},
"collect": {
"type": "integer",
"minimum": 1,
"examples": [
6
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}