Skip to content

Main content

Bounded Composition Cap Slack Tool

Calculate bounded composition cap slack from explicit caller-supplied inputs.

Loading tool…

Description

Check bounded composition parts against supplied caps.

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.

Check bounded composition parts against supplied caps.

When to use this tool

Use Bounded Composition Cap Slack when checking the stated word, set, multiset or composition convention.

How to use the tool and how it works

  1. Enter parts, caps. 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, feasible. Inspect feasible before interpreting the associated values.

Check bounded composition parts against supplied caps. Require aligned nonnegative whole arrays; slacks = caps-parts, feasible means all slacks nonnegative.1

Input fieldMeaning and unitsAccepted input
partsPartsRequired. Array of safe integer; maximum items 256.
capsCapsRequired. Array of safe integer; maximum items 256.
Output fieldInterpretationReturned shape
slacksSlacksRequired. Array of safe integer; maximum items 256.
feasibleWhether the stated local constraints hold; this need not establish a valid complete object or procedure.Required. Boolean.
json
{
  "input": {
    "parts": [
      2,
      4
    ],
    "caps": [
      3,
      3
    ]
  },
  "output": {
    "slacks": [
      1,
      -1
    ],
    "feasible": false
  }
}

Limitations and assumptions

  • No fixed-total requirement is checked; feasible refers only to these component bounds.
  • 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/bounded-composition-cap-slack — tool.io

Similar or alternative tools