omni_permutations_combinations
Calculate factorials, permutations (nPr), and combinations (nCr) with exact integer precision to avoid arithmetic errors and formula mistakes in statistical work.
Instructions
Permutations & Combinations (nPr & nCr) Calculator. Calculate factorials, permutations (ordered nPr), and combinations (unordered binomial coefficients nCr) with exact integer precision. Discipline: STATISTICS. Governing mathematical model / formula: nPr = n! / (n - r)! | nCr = n! / [r! · (n - r)!].
USAGE GUIDELINES:
WHEN TO USE: Invoke for deterministic calculation of combinations_ncr (Combinations nCr (Order Does Not Matter)), permutations_npr (Permutations nPr (Order Matters)), factorial_n (Factorial n!), multiplicity_factor (Permutation Expansion (r!)) using total_n (Total Elements (n)), sample_r (Subset Chosen (r)). Guarantees exact machine floating-point precision, eliminating LLM arithmetic mistakes and formula hallucinations.
WHEN NOT TO USE: Do not use for qualitative evaluations or unquantified reasoning. All input parameters must be valid numerical values.
SIBLING ROUTING: Use this dedicated specialist tool for 'Permutations & Combinations (nPr & nCr) Calculator' rather than generic dispatchers like omni_universal_query. For cross-discipline dynamic dispatch, see omni_universal_query.
BEHAVIOR & SAFETY:
Pure deterministic computation with machine floating-point precision.
Read-only, idempotent, and stateless. Zero side effects or persistent state mutations.
Input validation: All arguments are validated against physical and domain bounds. Out-of-bounds inputs return a safe diagnostic error status without throwing runtime exceptions.
RETURNS:
Structured JSON object containing:
status (string): "success" on valid execution or "error" if validation fails
calculator (string): "permutations-combinations"
category (string): "statistics"
name (string): "Permutations & Combinations (nPr & nCr) Calculator"
formula (string): Governing mathematical formula string
inputs (object): Echoed input parameter dictionary with applied defaults
metrics (object): Dictionary of computed outputs:
metrics.combinations_ncr (Combinations nCr (Order Does Not Matter)): Formatted display string (e.g. '120')
metrics.permutations_npr (Permutations nPr (Order Matters)): Formatted display string (e.g. '720')
metrics.factorial_n (Factorial n!): Formatted display string (e.g. '3,628,800')
metrics.multiplicity_factor (Permutation Expansion (r!)): Formatted display string (e.g. '6 (r! arrangements)')
execution_time_ms (number): Latency in milliseconds.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "omni_permutations_combinations"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total_n | No | Total Elements (n). Total pool size (n ≥ r). Default: 10. Min: 1. Max: 65. | |
| sample_r | No | Subset Chosen (r). Number of elements chosen. Default: 3. Min: 0. Max: 65. |