Skip to content

Main content

Sequence Two Run Boundary Count

Count resulting runs when two explicit constant-value runs are concatenated, accounting for empty runs and equality.

Loading tool…

Description

Calculate length and run count when joining two constant-value runs.

Sequence calculations depend on the reference index, common difference or ratio, and whether a domain uses exact integers or real-valued arithmetic. Alternation depends on index parity; modular arithmetic chooses a representative in a fixed residue interval. A supplied local rule is not discovered from data and need not establish a complete recurrence or prediction model.

Calculate length and run count when joining two constant-value runs.

When to use this tool

Use Sequence Two Run Boundary Count when you already have firstRunLength, secondRunLength, sameValue and need to calculate length and run count when joining two constant-value runs.

How to use the tool and how it works

  1. Enter firstRunLength, secondRunLength, sameValue. 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 combinedLength, resultingRunCount. Use the output convention below.

Require nonnegative safe whole run lengths; sum with BigInt then export a number. Empty runs contribute no run; two nonempty runs merge only when sameValue=true.1

Input fieldMeaning and unitsAccepted input
firstRunLengthFirst Run LengthRequired. Safe integer; minimum 0.
secondRunLengthSecond Run LengthRequired. Safe integer; minimum 0.
sameValueSupplied equality assertion used only when both runs are nonempty.Required. Boolean.
Output fieldInterpretationReturned shape
combinedLengthSafe integer sum; unsafe output is rejected.Required. Safe integer.
resultingRunCountResulting Run CountRequired. Safe integer.
json
{
  "input": {
    "firstRunLength": 3,
    "secondRunLength": 4,
    "sameValue": true
  },
  "output": {
    "combinedLength": 7,
    "resultingRunCount": 1
  }
}

Limitations and assumptions

  • The equality flag is supplied and values are not examined; a total beyond the safe-integer output range is rejected.
  • 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 the complete sequence definition and initial conditions for recurrence analysis. Choose exact integer or rational arithmetic when large indices or exact terms matter; local reference shifts and residue operations do not discover a generating rule.

References

  1. Calculation and input contract: sequence/sequence-two-run-boundary-count — tool.io

Similar or alternative tools