Skip to content

Main content

Ballot Exhaustion Last Preference Token Tool

Find the next explicitly continuing preference; does not conduct or certify an election count.

Loading tool…

Description

Find the next explicitly continuing preference; does not conduct or certify an election count.

Election and representation indicators depend on the selected vote, seat, population, or eligibility denominator. A threshold also needs an explicit equality and rounding rule. A single quotient, balance, or share can support a larger counting workflow without implementing the full electoral procedure.

Find the next explicitly continuing preference; does not conduct or certify an election count.

When to use this tool

Use Ballot Exhaustion Last Preference Token when you need this particular counting term under an explicit vote, seat, threshold, or reporting-base rule.

How to use the tool and how it works

  1. Enter preferences, continuing. Keep parallel arrays aligned. 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 exhausted, nextPreference, preferenceIndex. Inspect exhausted before interpreting the associated values.

Find the first exact preference token present in continuing. Return its zero-based preferenceIndex and nextPreference, or exhausted=true, preferenceIndex=-1, and nextPreference="" when none exists.1

Input fieldMeaning and unitsAccepted input
preferencesPreferencesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
continuingContinuingRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
exhaustedExhaustedRequired. Boolean.
nextPreferenceNext PreferenceRequired. Text; maximum UTF-16 length 8192.
preferenceIndexZero-based first continuing preference, or -1 if exhausted.Required. Safe integer.
json
{
  "input": {
    "preferences": [
      "A",
      "B",
      "C"
    ],
    "continuing": [
      "C"
    ]
  },
  "output": {
    "exhausted": false,
    "nextPreference": "C",
    "preferenceIndex": 2
  }
}

Limitations and assumptions

  • An empty string may itself be a valid supplied token, so inspect exhausted and preferenceIndex. Rankings are not deduplicated or validated as a complete ballot.
  • 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

Compare the supplied counting rule with the authoritative procedure for the relevant election or chamber. Complete allocations need additional eligibility, ranking, transfer, tie, and reporting rules beyond one arithmetic term.

References

  1. Calculation and input contract: political-science/ballot-exhaustion-last-preference-token — tool.io

Similar or alternative tools

  • Ballot Exhaustion Share

    Audit supplied ballot disposition counts under an explicit denominator convention.

  • Ballot Transfer Exhaustion One Round

    For nonnegative integer transferable, exhausted within transferable, and nonnegative integer receivedByCandidates, return continuing=sum(receivedByCandidates), accounted=exhausted+continuing, and balanced=(accounted===transferable).