Skip to content

Main content

Composition Part Upper Slack Tool

Calculate composition part upper slack from explicit caller-supplied inputs.

Loading tool…

Description

Return per-part upper-bound slack.

Combinatorial counts depend on whether objects are labeled, order matters, repetitions are permitted and a prefix is already fixed. Local counts, exact integer factors and feasibility bounds answer specific questions and need not enumerate complete objects.

Return per-part upper-bound slack.

When to use this tool

Use Composition Part Upper Slack when checking the stated word, set, multiset or composition convention.

How to use the tool and how it works

  1. Enter parts, upperBounds. Keep parallel arrays aligned. 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 slacks, exceedsAny. Inspect exceedsAny before interpreting the associated values.

Return per-part upper-bound slack. Require aligned nonnegative whole parts/upperBounds; slacks = bounds-parts, exceedsAny flags any negative slack.1

Input fieldMeaning and unitsAccepted input
partsPartsRequired. Array of safe integer; maximum items 256.
upperBoundsUpper BoundsRequired. Array of safe integer; maximum items 256.
Output fieldInterpretationReturned shape
slacksSlacksRequired. Array of safe integer; maximum items 256.
exceedsAnyExceeds AnyRequired. Boolean.
json
{
  "input": {
    "parts": [
      2,
      5
    ],
    "upperBounds": [
      3,
      4
    ]
  },
  "output": {
    "slacks": [
      1,
      -1
    ],
    "exceedsAny": true
  }
}

Limitations and assumptions

  • Exceeded bounds are reported rather than rejected; no total-sum constraint or feasible completion is established.
  • 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.

Alternative or Complementary methods

Use complete objects and an appropriate exact counting, ranking or enumeration method when the local contribution is insufficient.

References

  1. Calculation and input contract: combinatorics/composition-part-upper-slack — tool.io

Similar or alternative tools