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
- Enter mask. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| mask | Mask | Required. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| count | Count | Required. Safe integer. |
| odd | Odd | Required. Boolean. |
{
"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
Similar or alternative tools
- Subset Complement Cardinality Shift
Update complement cardinality after a supplied subset change.
- Subset Fixed Intersection Budget
Check intersection-size feasibility from set cardinalities.