Skip to content

Main content

Subset Mask Cardinality Parity Tool

Compute subset mask cardinality parity from explicit bounded inputs.

Loading tool…

Description

Return cardinality and parity of an unsigned subset mask.

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 cardinality and parity of an unsigned subset mask.

When to use this tool

Use Subset Mask Cardinality Parity when checking the stated word, set, multiset or composition convention.

How to use the tool and how it works

  1. Enter mask. 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 count, odd. Inspect odd before interpreting the associated values.

Return cardinality and parity of an unsigned subset mask. Parse a decimal integer with 0 <= mask < 2^128; count set binary digits and return odd from count modulo two.1

Input fieldMeaning and unitsAccepted input
maskMaskRequired. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above.
Output fieldInterpretationReturned shape
countCountRequired. Safe integer.
oddOddRequired. Boolean.
json
{
  "input": {
    "mask": "13"
  },
  "output": {
    "count": 3,
    "odd": true
  }
}

Limitations and assumptions

  • The mask is exact decimal text; no universe labels or elements beyond its bits are inferred.
  • 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/subset-mask-cardinality-parity — tool.io

Similar or alternative tools