Skip to content

Main content

Set Universe Size Residual

Compare an explicit unique-item count with declared universe size without asserting actual set membership.

Loading tool…

Description

Compare an observed unique count with a declared universe size.

A set universe describes which distinct elements are admissible, while an observed unique count describes supplied data. A difference between those counts can flag an inconsistent size claim, but counts alone do not identify membership or duplicates. The definitions of universe and uniqueness must match before interpreting unused capacity.

Compare an observed unique count with a declared universe size.

When to use this tool

Use Set Universe Size Residual when you already have declaredUniverseSize, observedUniqueSize and need to compare an observed unique count with a declared universe size.

How to use the tool and how it works

  1. Enter declaredUniverseSize, observedUniqueSize. 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 unusedCapacity, exceedsDeclaredUniverse. Inspect exceedsDeclaredUniverse before interpreting the associated values.

Require nonnegative safe whole counts; return universe-observed and flag observed>universe.1

Input fieldMeaning and unitsAccepted input
declaredUniverseSizeDeclared Universe SizeRequired. Safe integer; minimum 0.
observedUniqueSizeObserved Unique SizeRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
unusedCapacityDeclared universe-observed unique count; negative when the count exceeds the declared universe.Required. Safe integer.
exceedsDeclaredUniverseExceeds Declared UniverseRequired. Boolean.
json
{
  "input": {
    "declaredUniverseSize": 10,
    "observedUniqueSize": 7
  },
  "output": {
    "unusedCapacity": 3,
    "exceedsDeclaredUniverse": false
  }
}

Limitations and assumptions

  • Counts are supplied; no set is deduplicated or checked for membership, and a negative unused capacity is retained.
  • 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

Inspect actual elements and apply the intended equality rule before counting distinct membership. Compare those elements against the declared universe when validity matters, rather than inferring membership from two supplied counts.

References

  1. Calculation and input contract: set/set-universe-size-residual — tool.io

Similar or alternative tools