calculate_combinations
Calculate combinations (nCr) and permutations (nPr) for combinatorics and probability problems with given n and r values.
Instructions
Calculate nCr (combinations) and nPr (permutations) for given values.
Use this for combinatorics and probability calculations.
Parameters:
n — Total number of items (non-negative integer).
r — Number of items to choose/arrange (non-negative integer, ≤ n).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | Yes | ||
| r | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |