← All tool references

Math · not_available

Probability Calculator

Calculate the probability of one event, its complement, and simple independent AND or OR combinations.

Open public tool

Overview

Category
Math
API mode
not_available
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/probability-calculator

View this descriptor as JSON

Execute availability

This tool is documented as a browser capability. Its execute route does not produce a server-side result; when execution is enabled, it responds with browser_interaction_required and points callers to the public tool page.

POST /api/v1/tools/probability-calculator/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

favorable_a · number · required
Enter the favorable outcomes for event a used in the calculation.
possible_a · number · required
Enter the possible outcomes for event a used in the calculation.
mode · string · required
Choose the calculation that matches the calculation. Accepted values: single, and, or.
favorable_b · number · optional
Enter the favorable outcomes for event b used in the calculation.
possible_b · number · optional
Enter the possible outcomes for event b used in the calculation.
{
    "type": "object",
    "properties": {
        "favorable_a": {
            "type": "number",
            "description": "Enter the favorable outcomes for event a used in the calculation.",
            "minimum": 0
        },
        "possible_a": {
            "type": "number",
            "description": "Enter the possible outcomes for event a used in the calculation.",
            "minimum": 1
        },
        "mode": {
            "type": "string",
            "description": "Choose the calculation that matches the calculation.",
            "enum": [
                "single",
                "and",
                "or"
            ]
        },
        "favorable_b": {
            "type": "number",
            "description": "Enter the favorable outcomes for event b used in the calculation.",
            "minimum": 0
        },
        "possible_b": {
            "type": "number",
            "description": "Enter the possible outcomes for event b used in the calculation.",
            "minimum": 1
        }
    },
    "required": [
        "favorable_a",
        "possible_a",
        "mode"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

probability · number
Probability produced by the calculation.
decimal_probability · number
Decimal probability produced by the calculation.
complement · number
Complement probability produced by the calculation.
odds_for · string
Odds in favor produced by the calculation.
{
    "type": "object",
    "properties": {
        "probability": {
            "type": "number",
            "description": "Probability produced by the calculation."
        },
        "decimal_probability": {
            "type": "number",
            "description": "Decimal probability produced by the calculation."
        },
        "complement": {
            "type": "number",
            "description": "Complement probability produced by the calculation."
        },
        "odds_for": {
            "type": "string",
            "description": "Odds in favor produced by the calculation."
        }
    },
    "additionalProperties": false
}

Probability Calculator example

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/probability-calculator/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "favorable_a": 3,
    "possible_a": 10,
    "mode": "single",
    "favorable_b": 2,
    "possible_b": 6
}'
{
    "ok": true,
    "data": {
        "slug": "probability-calculator",
        "result": {
            "values": {
                "probability": 30,
                "decimal_probability": 0.299999999999999988897769753748434595763683319091796875,
                "complement": 70,
                "odds_for": "0.4286:1"
            },
            "display": {
                "display": "30"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.