Skip to content

Main content

Multiset Word Adjacent Equality Count Tool

Calculate multiset word adjacent equality count from explicit caller-supplied inputs.

Loading tool…

Description

Count equal adjacent symbols in a supplied word.

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.

Count equal adjacent symbols in a supplied word.

When to use this tool

Use Multiset Word Adjacent Equality Count when checking the stated word, set, multiset or composition convention.

How to use the tool and how it works

  1. Enter word. 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 equalNeighbors. Use the output convention below.

Count equal adjacent symbols in a supplied word. Compare each position after the first with its predecessor and return equalNeighbors.1

Input fieldMeaning and unitsAccepted input
wordWordRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
equalNeighborsEqual NeighborsRequired. Safe integer.
json
{
  "input": {
    "word": [
      "a",
      "a",
      "b",
      "b",
      "b"
    ]
  },
  "output": {
    "equalNeighbors": 3
  }
}

Limitations and assumptions

  • The last and first positions are not compared; this is a linear word statistic rather than a circular adjacency count.
  • 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/multiset-word-adjacent-equality-count — tool.io

Similar or alternative tools