{
    "slug": "binomial-theorem-and-pascal-triangle",
    "name": "Binomial Theorem and Pascal Triangle",
    "url": "https://directory.milunir.com/math-calculators/number-tools/binomial-theorem-and-pascal-triangle/",
    "description": "Expand (ax + b)^n term by term, find any single term, list Pascal's triangle up to row 30, or get a multinomial coefficient such as 4!/(2!1!1!) = 12.",
    "inputs": {
        "type": "object",
        "properties": {
            "mode": {
                "type": "string",
                "enum": [
                    "term",
                    "expand",
                    "pascal",
                    "multi"
                ],
                "description": "Mode",
                "default": "term"
            },
            "a": {
                "type": "integer",
                "minimum": -12,
                "maximum": 12,
                "description": "Coefficient of x (a). The number in front of x inside the brackets of (ax + b).",
                "default": 2
            },
            "b": {
                "type": "integer",
                "minimum": -12,
                "maximum": 12,
                "description": "Constant term (b). Use a negative number for (ax - b).",
                "default": 3
            },
            "n": {
                "type": "integer",
                "minimum": 0,
                "maximum": 12,
                "description": "Power (n)",
                "default": 5
            },
            "term": {
                "type": "integer",
                "minimum": 1,
                "maximum": 13,
                "description": "Term number. Counted from the left, starting at 1; term r uses k = r - 1.",
                "default": 3
            },
            "rows": {
                "type": "integer",
                "minimum": 0,
                "maximum": 30,
                "description": "Row number. The top single 1 is row 0.",
                "default": 6
            },
            "k1": {
                "type": "integer",
                "minimum": 0,
                "maximum": 30,
                "description": "Power of x",
                "default": 2
            },
            "k2": {
                "type": "integer",
                "minimum": 0,
                "maximum": 30,
                "description": "Power of y",
                "default": 1
            },
            "k3": {
                "type": "integer",
                "minimum": 0,
                "maximum": 30,
                "description": "Power of z",
                "default": 1
            },
            "k4": {
                "type": "integer",
                "minimum": 0,
                "maximum": 30,
                "description": "Power of w. Leave at 0 for a trinomial (x + y + z).",
                "default": 0
            }
        },
        "additionalProperties": false
    },
    "outputs": [
        {
            "key": "primary",
            "label": "Result"
        },
        {
            "key": "coef",
            "label": "Value"
        },
        {
            "key": "detail",
            "label": "Note"
        }
    ],
    "modes": [
        {
            "id": "term",
            "label": "Single term",
            "inputs": [
                "a",
                "b",
                "n",
                "term"
            ]
        },
        {
            "id": "expand",
            "label": "Full expansion",
            "inputs": [
                "a",
                "b",
                "n"
            ]
        },
        {
            "id": "pascal",
            "label": "Pascal's triangle",
            "inputs": [
                "rows"
            ]
        },
        {
            "id": "multi",
            "label": "Multinomial",
            "inputs": [
                "k1",
                "k2",
                "k3",
                "k4"
            ]
        }
    ],
    "feed": null,
    "endpoint": "https://api.tools-directory.workers.dev/v1/tools/binomial-theorem-and-pascal-triangle",
    "mcp_tool": "binomial_theorem_and_pascal_triangle",
    "example": {
        "inputs": {
            "mode": "term",
            "a": 2,
            "b": 3,
            "n": 5,
            "term": 3
        },
        "output": "Result: 720x^3\nValue: 720\nNote: C(5, 2) = 10"
    }
}