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
- Enter parts, upperBounds. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| parts | Parts | Required. Array of safe integer; maximum items 256. |
| upperBounds | Upper Bounds | Required. Array of safe integer; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| slacks | Slacks | Required. Array of safe integer; maximum items 256. |
| exceedsAny | Exceeds Any | Required. Boolean. |
{
"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
Similar or alternative tools
- Combinatorics: Composition Positive Part Shift
Shift positive parts into a weak composition.
- Composition Zero Part Capacity
Return zero-part count and remaining allowed capacity.