{"openapi":"3.1.0","info":{"title":"Probability Calculators","version":"1.0.0","description":"Dice, card and lottery odds, multinomials, expected value, exact distribution tables, gambler's ruin, Bayes and streaks. One call, one computed answer, no accounts or API keys. Machine-payable over x402.","x-guidance":"Probability Calculators: Dice, card and lottery odds, multinomials, expected value, exact distribution tables, gambler's ruin, Bayes and streaks. Use /multinomial for arrangements of repeated items and multinomial probabilities, /dice-odds for sums and targets of any dice pool including drop-lowest, /card-odds for poker hand odds, flush-draw outs and blackjack naturals, /lottery-odds for jackpot and tier odds, /birthday-problem for shared birthdays, /expected-value for any payoff table, /distribution-table for geometric, negative binomial, hypergeometric and full binomial or Poisson tables, /gamblers-ruin for ruin probability and duration, /bayes for conditional probability and test accuracy, and /streak-odds for the chance of a run in repeated trials. Each paid GET returns a computed verdict with the reasons, the source and what was NOT checked. A verdict of UNVERIFIED means a lookup failed: treat it as unknown. No account or key: pay per call in USDC over x402."},"servers":[{"url":"https://probability-calc.x402tookit.com"}],"paths":{"/bayes":{"get":{"operationId":"bayes","summary":"Bayes' theorem: posterior probability from a prior, sensitivity and false-positive rate, with natural frequencies and odds form.","description":"Bayes' theorem: posterior probability from a prior, sensitivity and false-positive rate, with natural frequencies and odds form.","tags":["bayes","conditional-probability","test-accuracy","posterior"],"parameters":[{"name":"prior","in":"query","required":true,"description":"Prior probability of the hypothesis (prevalence or base rate), 0 to 1","schema":{"type":"number"}},{"name":"sensitivity","in":"query","required":true,"description":"P(positive evidence | hypothesis true), 0 to 1 (true positive rate)","schema":{"type":"number"}},{"name":"falsePositiveRate","in":"query","required":false,"description":"P(positive evidence | hypothesis false), 0 to 1 (give this or specificity)","schema":{"type":"number"}},{"name":"specificity","in":"query","required":false,"description":"Or P(negative evidence | hypothesis false); false positive rate = 1 - specificity","schema":{"type":"number"}},{"name":"population","in":"query","required":false,"description":"Population for natural frequencies (default 10000)","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"prior":{"type":["null","number"]},"sensitivity":{"type":["null","number"]},"falsePositiveRate":{"type":["null","number"]},"specificity":{"type":["null","number"]},"probabilityOfPositive":{"type":["null","number"]},"posteriorGivenPositive":{"type":["null","number"]},"posteriorGivenNegative":{"type":["null","number"]},"falseAlarmShareOfPositives":{"type":["null","number"]},"likelihoodRatioPositive":{"type":["null","number"]},"priorOdds":{"type":["null","number"]},"posteriorOdds":{"type":["null","number"]},"naturalFrequencies":{"type":["null","object"],"properties":{"population":{"type":["null","number"]},"haveHypothesis":{"type":["null","number"]},"truePositives":{"type":["null","number"]},"falsePositives":{"type":["null","number"]},"falseNegatives":{"type":["null","number"]},"trueNegatives":{"type":["null","number"]}}},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"STRONG_UPDATE","summary":"Prior 1.000%, sensitivity 80.0%, false-positive rate 9.60%: a positive result means a 7.76% chance the hypothesis is true.","reasons":["P(H | positive) = P(+|H) P(H) / [P(+|H) P(H) + P(+|not H) P(not H)].","A low base rate means most positives are false positives, even with a good test (base-rate fallacy).","…1 more"],"prior":0.01,"sensitivity":0.8,"falsePositiveRate":0.096,"specificity":0.904,"probabilityOfPositive":0.10303999999999999,"posteriorGivenPositive":0.07763975155279504,"posteriorGivenNegative":0.002229753835176596,"falseAlarmShareOfPositives":0.922360248447205,"likelihoodRatioPositive":8.333333333333334,"priorOdds":0.010101010101010102,"posteriorOdds":0.08417508417508418,"naturalFrequencies":{"population":10000,"haveHypothesis":100,"truePositives":80,"falsePositives":950,"falseNegatives":20,"trueNegatives":8950},"degraded":false,"notChecked":["whether the rates apply to the person or case in question (they are population averages)","repeated or dependent tests (the formula assumes one independent piece of evidence)","…1 more"],"source":"computed locally (Bayes' theorem)","asOf":"2026-10-11T14:44:16.580Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/bayes"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/bayes"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/bayes"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/bayes"}}]}}},"/birthday-problem":{"get":{"operationId":"birthday_problem","summary":"Birthday problem: chance two people in a group share a birthday, chance someone shares yours, group size for 50 or 99 percent.","description":"Birthday problem: chance two people in a group share a birthday, chance someone shares yours, group size for 50 or 99 percent.","tags":["birthday-problem","probability","coincidence"],"parameters":[{"name":"people","in":"query","required":true,"description":"Group size, 1 to 100000","schema":{"type":"integer"}},{"name":"days","in":"query","required":false,"description":"Equally likely birthdays (default 365)","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"people":{"type":["null","number"]},"days":{"type":["null","number"]},"probabilityAnyShared":{"type":["null","number"]},"probabilityNoneShared":{"type":["null","number"]},"probabilitySomeoneSharesYours":{"type":["null","number"]},"expectedSharedPairs":{"type":["null","number"]},"peopleForFiftyPercent":{"type":["null","number"]},"peopleForNinetyNinePercent":{"type":["null","number"]},"peopleForFiftyPercentSharingYours":{"type":["null","number"]},"othersNeededForFiftyPercentSharingYours":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"MORE_LIKELY_THAN_NOT","summary":"23 people, 365 days: 50.73% that at least two share a birthday; 5.86% that someone shares YOUR birthday.","reasons":["P(no shared birthday) = (d/d)((d-1)/d)((d-2)/d)...: the number of PAIRS grows as n(n-1)/2, which is why coincidences are common.","Sharing a birthday with a specific person is far less likely than any two people sharing one."],"people":23,"days":365,"probabilityAnyShared":0.5072972343239854,"probabilityNoneShared":0.49270276567601456,"probabilitySomeoneSharesYours":0.058571325264343166,"expectedSharedPairs":0.6931506849315069,"peopleForFiftyPercent":23,"peopleForNinetyNinePercent":57,"peopleForFiftyPercentSharingYours":254,"othersNeededForFiftyPercentSharingYours":253,"degraded":false,"notChecked":["real birthdays are not uniform (seasonal peaks make coincidences slightly more likely)","leap day (365 equally likely days assumed)","…1 more"],"source":"computed locally (classical birthday problem)","asOf":"2026-10-11T14:44:16.842Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/birthday-problem"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/birthday-problem"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/birthday-problem"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/birthday-problem"}}]}}},"/card-odds":{"get":{"operationId":"card_odds","summary":"Card odds: 5-card and 7-card poker hand probabilities, chance of hitting your outs by the river, blackjack natural odds.","description":"Card odds: 5-card and 7-card poker hand probabilities, chance of hitting your outs by the river, blackjack natural odds.","tags":["cards","poker","odds","blackjack"],"parameters":[{"name":"mode","in":"query","required":true,"description":"poker5, poker7, outs or blackjack","schema":{"type":"string"}},{"name":"outs","in":"query","required":false,"description":"For mode outs: cards that complete your hand (flush draw 9, open-ended straight draw 8, gutshot 4)","schema":{"type":"integer"}},{"name":"stage","in":"query","required":false,"description":"For mode outs: flop (two cards to come, 47 unseen) or turn (one card to come, 46 unseen); default flop","schema":{"type":"string"}},{"name":"decks","in":"query","required":false,"description":"For mode blackjack: number of 52-card decks, 1 to 8 (default 1)","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"outs":{"type":["null","number"]},"stage":{"type":["null","string"]},"unseenCards":{"type":["null","number"]},"cardsToCome":{"type":["null","number"]},"probabilityByRiver":{"type":["null","number"]},"probabilityNextCard":{"type":["null","number"]},"oneIn":{"type":["null","number"]},"ruleOf2And4":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"9 outs from the flop: 34.97% to hit by the river (1 in 2.86); 19.15% on the next card alone.","reasons":["Exact: 1 - C(unseen - outs, cards to come) / C(unseen, cards to come), with 2 hole cards and the board seen.","The 'rule of 2 and 4' approximation (outs x 4 on the flop, x 2 on the turn) is close for small outs and overstates large ones."],"outs":9,"stage":"flop","unseenCards":47,"cardsToCome":2,"probabilityByRiver":0.3496762257169288,"probabilityNextCard":0.19148936170212766,"oneIn":2.8597883597883595,"ruleOf2And4":0.36,"degraded":false,"notChecked":["opponents' hands, betting and ranges: these are single-player card-counting odds only","whether your outs are 'clean' (cards that also help an opponent)","…2 more"],"source":"computed locally (exact counting)","asOf":"2026-10-11T14:44:17.103Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/card-odds"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/card-odds"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/card-odds"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/card-odds"}}]}}},"/dice-odds":{"get":{"operationId":"dice_odds","summary":"Exact odds for dice pools: sum distribution, chance of reaching a target, mean and variance; supports drop-lowest like 4d6.","description":"Exact odds for dice pools: sum distribution, chance of reaching a target, mean and variance; supports drop-lowest like 4d6.","tags":["dice","odds","distribution","rpg"],"parameters":[{"name":"dice","in":"query","required":true,"description":"Number of dice, 1 to 60 (1 to 8 with dropLowest)","schema":{"type":"integer"}},{"name":"faces","in":"query","required":true,"description":"Faces per die, 2 to 100 (2 to 20 with dropLowest)","schema":{"type":"integer"}},{"name":"target","in":"query","required":false,"description":"Target sum: returns the chance of exactly, at least and at most this sum","schema":{"type":"integer"}},{"name":"dropLowest","in":"query","required":false,"description":"Drop this many lowest dice before summing (4d6 drop lowest = dice 4, dropLowest 1)","schema":{"type":"integer"}},{"name":"faceValue","in":"query","required":false,"description":"Also give the chance that at least one die shows this face (default: no)","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"pool":{"type":["null","string"]},"minSum":{"type":["null","number"]},"maxSum":{"type":["null","number"]},"mean":{"type":["null","number"]},"variance":{"type":["null","number"]},"standardDeviation":{"type":["null","number"]},"mostLikelySum":{"type":["null","number"]},"mostLikelyProbability":{"type":["null","number"]},"totalOutcomes":{"type":["null","number"]},"distribution":{"type":["array","null"],"items":{"type":"object","properties":{"sum":{"type":["null","number"]},"probability":{"type":["null","number"]},"ways":{"type":["null","number"]},"cumulativeAtMost":{"type":["null","number"]}}}},"target":{"type":["null","object"],"properties":{"sum":{"type":["null","number"]},"exactly":{"type":["null","number"]},"atLeast":{"type":["null","number"]},"atMost":{"type":["null","number"]},"oneInNExactly":{"type":["null","number"]}}},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"3d6: mean 10.5, sd 2.95804, range 3-18, most likely 10 (12.50%). Sum 10: exactly 12.50%, at least 62.50%, at most 50.00%.","reasons":["Exact: every outcome of fair, independent dice is counted (convolution, or full enumeration when dropping dice)."],"pool":"3d6","minSum":3,"maxSum":18,"mean":10.5,"variance":8.75,"standardDeviation":2.95804,"mostLikelySum":10,"mostLikelyProbability":0.125,"totalOutcomes":216,"distribution":[{"sum":3,"probability":0.00463,"ways":1,"cumulativeAtMost":0.00463},{"sum":4,"probability":0.013889,"ways":3,"cumulativeAtMost":0.018519}],"target":{"sum":10,"exactly":0.125,"atLeast":0.625,"atMost":0.5,"oneInNExactly":8},"degraded":false,"notChecked":["loaded or unfair dice","exploding dice, rerolls and other house rules","…1 more"],"source":"computed locally (exact enumeration and convolution)","asOf":"2026-10-11T14:44:17.363Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/dice-odds"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/dice-odds"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/dice-odds"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/dice-odds"}}]}}},"/distribution-table":{"get":{"operationId":"distribution_table","summary":"Exact pmf, cumulative and tail tables for geometric, negative binomial, hypergeometric, binomial and Poisson.","description":"Exact pmf, cumulative and tail tables for geometric, negative binomial, hypergeometric, binomial and Poisson.","tags":["distribution","geometric","hypergeometric","negative-binomial","poisson"],"parameters":[{"name":"dist","in":"query","required":true,"description":"One of geometric, negative-binomial, hypergeometric, binomial, poisson","schema":{"type":"string"}},{"name":"p","in":"query","required":false,"description":"Success probability (geometric, negative-binomial, binomial)","schema":{"type":"number"}},{"name":"r","in":"query","required":false,"description":"Successes wanted (negative-binomial), 1 to 1000","schema":{"type":"integer"}},{"name":"n","in":"query","required":false,"description":"Trials (binomial) or draws (hypergeometric)","schema":{"type":"integer"}},{"name":"N","in":"query","required":false,"description":"Population size (hypergeometric), up to 1e6","schema":{"type":"integer"}},{"name":"K","in":"query","required":false,"description":"Successes in the population (hypergeometric)","schema":{"type":"integer"}},{"name":"lambda","in":"query","required":false,"description":"Mean rate (Poisson), 0 to 1000","schema":{"type":"number"}},{"name":"k","in":"query","required":false,"description":"Optional point of interest: adds pmf, P(X<=k) and P(X>=k) for this k","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"distribution":{"type":["null","string"]},"parameters":{"type":["null","object"],"properties":{"N":{"type":["null","number"]},"K":{"type":["null","number"]},"n":{"type":["null","number"]}}},"support":{"type":["null","string"]},"mean":{"type":["null","number"]},"variance":{"type":["null","number"]},"standardDeviation":{"type":["null","number"]},"mode":{"type":["null","number"]},"table":{"type":["array","null"],"items":{"type":"object","properties":{"k":{"type":["null","number"]},"probability":{"type":["null","number"]},"cumulative":{"type":["null","number"]},"upperTail":{"type":["null","number"]}}}},"tableComplete":{"type":["boolean","null"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"TABLE","summary":"hypergeometric: mean 1.25, variance 0.86397059, sd 0.92950018, mode 1.","reasons":["Probabilities are computed in log space from exact formulas; columns are pmf, cumulative P(X<=k) and upper tail P(X>=k).","All values assume the stated parameters are exact."],"distribution":"hypergeometric","parameters":{"N":52,"K":13,"n":5},"support":"k = 0 to 5 (successes in 5 draws without replacement)","mean":1.25,"variance":0.86397059,"standardDeviation":0.92950018,"mode":1,"table":[{"k":0,"probability":0.22153361,"cumulative":0.22153361,"upperTail":1},{"k":1,"probability":0.41141957,"cumulative":0.63295318,"upperTail":0.77846639}],"tableComplete":true,"degraded":false,"notChecked":["sampling with versus without replacement (geometric, binomial and negative binomial assume independent trials; hypergeometric is without replacement)","tables are cut to the first 60 rows or the point where the remaining tail is below 1e-9 (the full cumulative is exact)","…1 more"],"source":"computed locally (exact formulas in log space)","asOf":"2026-10-11T14:44:17.625Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/distribution-table"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/distribution-table"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/distribution-table"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/distribution-table"}}]}}},"/expected-value":{"get":{"operationId":"expected_value","summary":"Expected value, variance, standard deviation and chance of profit for a list of payoffs with probabilities or weights.","description":"Expected value, variance, standard deviation and chance of profit for a list of payoffs with probabilities or weights.","tags":["expected-value","variance","payoff","probability"],"parameters":[{"name":"outcomes","in":"query","required":true,"description":"payoff:probability pairs, comma separated: 35:0.0263158,-1:0.9736842 (roulette straight-up, net of stake)","schema":{"type":"string"}},{"name":"cost","in":"query","required":false,"description":"Optional price paid to play, subtracted from every payoff","schema":{"type":"number"}},{"name":"normalize","in":"query","required":false,"description":"true to treat the numbers after the colon as weights and scale them to sum to 1","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"expectedValue":{"type":["null","number"]},"variance":{"type":["null","number"]},"standardDeviation":{"type":["null","number"]},"probabilityPositive":{"type":["null","number"]},"probabilityLoss":{"type":["null","number"]},"bestOutcome":{"type":["null","object"],"properties":{"payoff":{"type":["null","number"]},"probability":{"type":["null","number"]}}},"worstOutcome":{"type":["null","object"],"properties":{"payoff":{"type":["null","number"]},"probability":{"type":["null","number"]}}},"outcomes":{"type":["array","null"],"items":{"type":"object","properties":{"payoff":{"type":["null","number"]},"probability":{"type":["null","number"]}}}},"breakEvenCost":{"type":["null","number"]},"costApplied":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"NEGATIVE_EXPECTATION","summary":"Expected value -0.052632 per play; standard deviation 5.7626; chance of a positive result 2.63%.","reasons":["EV = sum of payoff x probability; variance = sum of (payoff - EV)^2 x probability.","Over many plays you lose about 0.0526 per play on average; short runs can still win."],"expectedValue":-0.052631578947368474,"variance":33.20775623268698,"standardDeviation":5.762617133966734,"probabilityPositive":0.02631578947368421,"probabilityLoss":0.9736842105263158,"bestOutcome":{"payoff":35,"probability":0.02631578947368421},"worstOutcome":{"payoff":-1,"probability":0.9736842105263158},"outcomes":[{"payoff":35,"probability":0.02631578947368421},{"payoff":-1,"probability":0.9736842105263158}],"breakEvenCost":-0.052631578947368474,"costApplied":0,"degraded":false,"notChecked":["utility or risk preference: a positive expected value does not make a bet advisable (Kelly, ruin and variance matter)","the accuracy of the probabilities you supplied","…1 more"],"source":"computed locally","asOf":"2026-10-11T14:44:17.888Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/expected-value"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/expected-value"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/expected-value"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/expected-value"}}]}}},"/gamblers-ruin":{"get":{"operationId":"gamblers_ruin","summary":"Gambler's ruin: probability of going broke before hitting a target, and expected number of bets, for repeated unit bets.","description":"Gambler's ruin: probability of going broke before hitting a target, and expected number of bets, for repeated unit bets.","tags":["gamblers-ruin","random-walk","probability","bankroll"],"parameters":[{"name":"p","in":"query","required":true,"description":"Probability of winning each bet, 0 to 1 (roulette red/black on a double-zero wheel 18/38 = 0.473684)","schema":{"type":"number"}},{"name":"bankroll","in":"query","required":true,"description":"Starting units, 1 to 1000000","schema":{"type":"integer"}},{"name":"target","in":"query","required":false,"description":"Stop when you reach this many units (omit to play until ruin)","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"winProbability":{"type":["null","number"]},"lossProbability":{"type":["null","number"]},"bankroll":{"type":["null","number"]},"target":{"type":["null","number"]},"ruinProbability":{"type":["null","number"]},"successProbability":{"type":["null","number"]},"expectedBets":{"type":["null","number"]},"ratioQOverP":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"UNFAVOURABLE","summary":"Win chance 0.473684 per bet, bankroll 100, target 200: probability of ruin 99.9973%, reaching the target 0.0027%, expected 1,899.9 bets.","reasons":["With a target N, ruin = ((q/p)^i - (q/p)^N) / (1 - (q/p)^N), and 1 - i/N when the game is fair.","A game with a house edge makes a larger target MORE likely to end in ruin, not less."],"winProbability":0.473684,"lossProbability":0.526316,"bankroll":100,"target":200,"ruinProbability":0.9999734415493503,"successProbability":0.000026558450649694088,"expectedBets":1899.8838788165003,"ratioQOverP":1.111112049383133,"degraded":false,"notChecked":["bets of different sizes, betting systems, and table limits (the walk is one unit up or down per bet)","ties or pushes","…2 more"],"source":"computed locally (Feller, gambler's ruin)","asOf":"2026-10-11T14:44:18.160Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/gamblers-ruin"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/gamblers-ruin"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/gamblers-ruin"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/gamblers-ruin"}}]}}},"/lottery-odds":{"get":{"operationId":"lottery_odds","summary":"Lottery odds: jackpot odds and every match tier for pick-k-of-N games with an optional bonus pool (Powerball, EuroMillions).","description":"Lottery odds: jackpot odds and every match tier for pick-k-of-N games with an optional bonus pool (Powerball, EuroMillions).","tags":["lottery","odds","jackpot","hypergeometric"],"parameters":[{"name":"pick","in":"query","required":true,"description":"Main numbers you pick, 1 to 20","schema":{"type":"integer"}},{"name":"poolSize","in":"query","required":true,"description":"Size of the main number pool, up to 100","schema":{"type":"integer"}},{"name":"bonusPick","in":"query","required":false,"description":"Bonus numbers you pick from a separate pool (Powerball 1, EuroMillions 2); default 1 if bonusPool is given","schema":{"type":"integer"}},{"name":"bonusPool","in":"query","required":false,"description":"Size of the separate bonus pool (Powerball 26, EuroMillions 12)","schema":{"type":"integer"}},{"name":"jackpot","in":"query","required":false,"description":"Jackpot amount, to show the unshared expected value of the jackpot alone","schema":{"type":"number"}},{"name":"ticketPrice","in":"query","required":false,"description":"Ticket price, to compare with that jackpot value","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"game":{"type":["null","string"]},"totalCombinations":{"type":["null","string"]},"jackpotOneIn":{"type":["null","string"]},"jackpotProbability":{"type":["null","number"]},"tiers":{"type":["array","null"],"items":{"type":"object","properties":{"mainMatches":{"type":["null","number"]},"bonusMatches":{"type":["null","number"]},"ways":{"type":["null","string"]},"probability":{"type":["null","number"]},"oneIn":{"type":["null","number"]}}}},"tiersCount":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"5 of 69 + 1 of 26: jackpot odds 1 in 292,201,338.","reasons":["Tier odds use hypergeometric counting: C(k,m) x C(N-k, k-m) / C(N,k) for the main numbers, times the same for the bonus pool.","Every combination is equally likely; the odds do not change from draw to draw.","…1 more"],"game":"5 of 69 + 1 of 26","totalCombinations":"292201338","jackpotOneIn":"292201338","jackpotProbability":3.4222978130237033e-9,"tiers":[{"mainMatches":5,"bonusMatches":1,"ways":"1","probability":3.4222978130237033e-9,"oneIn":292201338},{"mainMatches":5,"bonusMatches":0,"ways":"25","probability":8.555744532559259e-8,"oneIn":11688054}],"tiersCount":12,"degraded":false,"notChecked":["the actual prize for each tier (prize amounts and rules vary by game and draw)","jackpot sharing between several winners, taxes and annuity versus cash value","…2 more"],"source":"computed locally (hypergeometric counting)","asOf":"2026-10-11T14:44:18.417Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/lottery-odds"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/lottery-odds"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/lottery-odds"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/lottery-odds"}}]}}},"/multinomial":{"get":{"operationId":"multinomial","summary":"Multinomial coefficient (arrangements of repeated items like MISSISSIPPI) and multinomial probability for given odds.","description":"Multinomial coefficient (arrangements of repeated items like MISSISSIPPI) and multinomial probability for given odds.","tags":["multinomial","arrangements","combinatorics","probability"],"parameters":[{"name":"counts","in":"query","required":false,"description":"Group sizes, comma separated: 1,4,4,2 (give counts or word)","schema":{"type":"string"}},{"name":"word","in":"query","required":false,"description":"Or a word/string: the repeated letters set the group sizes (MISSISSIPPI)","schema":{"type":"string"}},{"name":"probs","in":"query","required":false,"description":"Optional outcome probabilities, comma separated, one per count, summing to 1: gives the multinomial probability of exactly these counts","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"total":{"type":["null","number"]},"groupSizes":{"type":["array","null"],"items":{"type":"number"}},"letters":{"type":["array","null"],"items":{"type":"string"}},"multinomialCoefficient":{"type":["null","string"]},"scientific":{},"formula":{"type":["null","string"]},"digits":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COUNTED","summary":"11 items in groups 1, 4, 4, 2: 34650 distinct arrangements.","reasons":["Multinomial coefficient = n! / (k1! k2! ... km!): the number of distinct orderings of n items where equal items are interchangeable."],"total":11,"groupSizes":[1,4],"letters":["Mx1","Ix4","…2 more"],"multinomialCoefficient":"34650","scientific":null,"formula":"11! / (1! x 4! x 4! x 2!)","digits":5,"degraded":false,"notChecked":["dependence between draws (the probability form assumes independent trials with fixed odds, i.e. sampling with replacement)","arrangements with extra constraints such as no two equal letters adjacent"],"source":"computed locally (exact big-integer arithmetic)","asOf":"2026-10-11T14:44:18.681Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/multinomial"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/multinomial"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/multinomial"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/multinomial"}}]}}},"/streak-odds":{"get":{"operationId":"streak_odds","summary":"Chance of a run: r successes in a row (or r identical outcomes) somewhere in n independent trials, like coin flips.","description":"Chance of a run: r successes in a row (or r identical outcomes) somewhere in n independent trials, like coin flips.","tags":["streak","runs","coin-flip","probability"],"parameters":[{"name":"n","in":"query","required":true,"description":"Number of trials, 1 to 5000","schema":{"type":"integer"}},{"name":"r","in":"query","required":true,"description":"Streak length wanted, 1 to n","schema":{"type":"integer"}},{"name":"p","in":"query","required":false,"description":"Probability of success on each trial (default 0.5)","schema":{"type":"number"}},{"name":"kind","in":"query","required":false,"description":"heads (a run of successes, default) or either (a run of identical outcomes, both kinds)","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"trials":{"type":["null","number"]},"streakLength":{"type":["null","number"]},"p":{"type":["null","number"]},"kind":{"type":["null","string"]},"probability":{"type":["null","number"]},"oneIn":{"type":["null","number"]},"roughTypicalLongestRun":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"MORE_LIKELY_THAN_NOT","summary":"Chance of 5 or more successes in a row within 100 trials (p=0.5): 81.011% (1 in 1.23).","reasons":["Exact dynamic programming over the current run length, not a simulation.","Long streaks in random data are much more common than intuition suggests: the typical longest run grows like log(n).","…1 more"],"trials":100,"streakLength":5,"p":0.5,"kind":"heads","probability":0.8101095991963579,"oneIn":1.2344008773529118,"roughTypicalLongestRun":5.6,"degraded":false,"notChecked":["dependent trials (hot hands, momentum, cards drawn without replacement)","streaks counted across separate sessions","…1 more"],"source":"computed locally (dynamic programming on run lengths)","asOf":"2026-10-11T14:44:18.933Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/streak-odds"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/streak-odds"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/streak-odds"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://probability-calc.x402tookit.com/streak-odds"}}]}}}}}