Skip to content

Main content

Subset Fixed Intersection Budget Tool

Calculate subset fixed intersection budget from explicit caller-supplied inputs.

Loading tool…

Description

Check intersection-size feasibility from set cardinalities.

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 intersection-size feasibility from set cardinalities.

When to use this tool

Use Subset Fixed Intersection Budget when checking the stated word, set, multiset or composition convention.

How to use the tool and how it works

  1. Enter universe, subsetA, subsetB, requiredIntersection. 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 minimumIntersection, maximumIntersection, feasible, unionSize. Inspect feasible before interpreting the associated values.

Check intersection-size feasibility from set cardinalities. Require whole universe >= subsetA,subsetB >= 0 and requiredIntersection >= 0; bounds are max(0,a+b-universe) and min(a,b), feasible includes both endpoints.1

Input fieldMeaning and unitsAccepted input
universeUniverseRequired. Safe integer; minimum 0.
subsetASubset ARequired. Safe integer; minimum 0.
subsetBSubset BRequired. Safe integer; minimum 0.
requiredIntersectionRequired IntersectionRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
minimumIntersectionMinimum IntersectionRequired. Safe integer.
maximumIntersectionMaximum IntersectionRequired. Safe integer.
feasibleWhether the stated local constraints hold; this need not establish a valid complete object or procedure.Required. Boolean.
unionSizeAlgebraic a+b-requiredIntersection, even when feasible=false; inspect feasibility before using it as a real cardinality.Required. Safe integer.
json
{
  "input": {
    "universe": 10,
    "subsetA": 6,
    "subsetB": 7,
    "requiredIntersection": 3
  },
  "output": {
    "minimumIntersection": 3,
    "maximumIntersection": 6,
    "feasible": true,
    "unionSize": 10
  }
}

Limitations and assumptions

  • unionSize = a+b-requiredIntersection is returned even for an infeasible request and is then only an algebraic placeholder.
  • 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 complete objects and an appropriate exact counting, ranking or enumeration method when the local contribution is insufficient.

References

  1. Calculation and input contract: combinatorics/subset-fixed-intersection-budget — tool.io

Similar or alternative tools