Description
Return zero pairs for an empty list.
List-length arithmetic predicts how many positions a structural operation will create, discard, or leave unused. Empty lists and exact multiples need explicit counting conventions.
Return zero pairs for an empty list.
When to use this tool
Use List Pairwise Adjacency Output Count when you need a list operation's count or padding budget.
How to use the tool and how it works
- Enter length, cyclic. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read pairs. Use the output convention below.
Return zero pairs for an empty list. Otherwise return length for cyclic adjacency or length minus one for ordinary adjacency.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| length | Length, count, or code length under the stated domain and unit convention. | Required. Safe integer; minimum 0. |
| cyclic | Cyclic | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| pairs | Pairs | Required. Safe integer. |
{
"input": {
"length": 5,
"cyclic": false
},
"output": {
"pairs": 4
}
} Limitations and assumptions
- A cyclic singleton has one self-pair; no values or pair contents are generated.
- 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 list lengths and choose the operation's empty-input and tail policies before transforming values.
References
Similar or alternative tools
- Duplicate Run Internal Edge Count
Sum runLength minus one across positive integer runLengths using exact integer intermediates, then return the numeric internalEdges.
- List Cycle One Step Predecessor
Subtract one from a valid index and reduce modulo positive length for predecessor.