Skip to content

Main content

Rank Position Score Ballot Tally

Explicit supplied candidate IDs and finite ballot observations only; no voter authenticity, eligibility, audit certification or election-result guarantee. Apply explicit caller rank-position points to strict partial rankings; unranked candidates receive zero, no hidden Borda variant or tie ranks.

Loading tool…

Description

Tally explicit rank-position scores for partial rankings, assigning zero to omitted candidates.

A ballot record is an explicit selection or ordered list of literal candidate IDs. A tally depends on its rule: first choice, approval, positional scores and pairwise comparisons use different evidence. Partial rankings do not by themselves define a preference for or against omitted candidates. Counts and weights describe supplied records, not certified voters.

Tally explicit rank-position scores for partial rankings, assigning zero to omitted candidates.

When to use this tool

Use explicit position scores to compare scoring conventions on partial ranked ballots.

How to use the tool and how it works

  1. Enter candidates, ballotsJson, positionScores using the definitions below. Serialize JSON text fields in the decoded shape shown below.
  2. Run the operation. Resolve input-format errors before interpreting an output.
  3. Read result.tally, using the stated boundary, ordering, sign and absence conventions.

Require one finite position score per declared candidate. For each ballot, add the score at each listed rank to that candidate; unlisted candidates receive zero from that ballot.1

Input fieldMeaning and unitsAccepted input
candidatesDistinct literal candidate IDs in the output row/column order.Dense list of at most 128 literal strings, each at most 8,192 UTF-16 units.
ballotsJsonJSON array of ballot arrays of literal candidate IDs. Each row is a selection or partial ranking according to this operation; empty ballots are allowed.Text, at most 8,192 UTF-16 code units; narrower grammar/range rules also apply.
positionScoresOne finite, possibly signed score per candidate-bank position; the entry at index j is assigned to rank j.Dense list of at most 128 finite numbers, under the stated integer/range rules.

These decoded structures show the examples inside JSON text fields. Supply their serialized JSON strings as input.

json
{
  "ballotsJson": [
    [
      "a",
      "b"
    ],
    [
      "b",
      "a"
    ],
    []
  ]
}
Output fieldInterpretation
resultObject containing the fields below.
result.tallyCandidate records in declared bank order with support, count or score fields determined by this operation.
json
{
  "input": {
    "candidates": [
      "a",
      "b",
      "c"
    ],
    "ballotsJson": "[[\"a\",\"b\"],[\"b\",\"a\"],[]]",
    "positionScores": [
      2,
      1,
      0
    ]
  },
  "output": {
    "result": {
      "tally": [
        {
          "candidate": "a",
          "score": 3
        },
        {
          "candidate": "b",
          "score": 3
        },
        {
          "candidate": "c",
          "score": 0
        }
      ]
    }
  }
}

Limitations and assumptions

  • Position scores may be signed and need not follow a standard scoring system. Partial rankings do not assign the remaining position scores to omitted candidates.
  • Candidate banks use distinct exact string IDs. Unless an audit explicitly accepts them for reporting, unknown IDs and repeated IDs within a ballot are rejected. Rankings may be partial. These operations do not authenticate records, infer voter intent or apply jurisdiction-specific election rules.
  • Every declared outer field is required and unknown outer fields are rejected. Strings and JSON text have size limits, lists are bounded to 128 entries, and JSON nesting/node counts are bounded. Tighter operation-specific bounds stated above take precedence.
  • Numeric outputs must remain finite and within safe-integer magnitude. Original record indexes and cell coordinates are zero-based; stated half-open ranges exclude their end.

Alternative or Complementary methods

Choose a tally rule before comparing outcomes. Audit candidate identity and repeated entries first, retain the treatment of empty and partial ballots, and apply any election-specific eligibility or tie-breaking procedure separately.

References

  1. Tool behavior and example: Rank Position Score Ballot Tally — tool.io

Similar or alternative tools