Skip to content

Main content

Combinatorics: Derangement Inclusion Term Tool

Return one exact signed n!/k! contribution to the derangement inclusion-exclusion sum, not the entire subfactorial.

Loading tool…

Description

Return one exact derangement inclusion-exclusion term.

Exact combinatorial recurrences distinguish individual summands, adjacent ratios and complete totals. A local arithmetic identity can be correct without proving that its supplied inputs are the intended counts or that a whole enumeration has been completed.

Return one exact derangement inclusion-exclusion term.

When to use this tool

Use Combinatorics: Derangement Inclusion Term when checking the stated recurrence, coefficient-ratio or inclusion-exclusion term.

How to use the tool and how it works

  1. Enter size, excludedCount. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Return one exact derangement inclusion-exclusion term. Require size 0..128 and excludedCount in [0,size]; signedInclusionTerm = (-1)^excludedCount*size!/excludedCount! as decimal text.1

Input fieldMeaning and unitsAccepted input
sizeSizeRequired. Safe integer.
excludedCountExcluded CountRequired. Safe integer.
Output fieldInterpretationReturned shape
resultReturned calculated value or nested object under the stated output convention.Required. Object.
result.signedInclusionTermSigned Inclusion TermCalculated result member: string.
json
{
  "input": {
    "size": 5,
    "excludedCount": 2
  },
  "output": {
    "result": {
      "signedInclusionTerm": "60"
    }
  }
}

Limitations and assumptions

  • The term is not the full derangement count; all terms must use the same total-size convention.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use the complete recurrence with justified initial conditions and exact integer arithmetic when a full counting result is required.

References

  1. Calculation and input contract: combinatorics/derangement-inclusion-term — tool.io

Similar or alternative tools