1 Introduction

1.1 Ranked choice voting in Maine

Commencing in June 2018, the State of Maine has used a type of ranked choice voting (RC) commonly called instant runoff (RC/IR). In November 2018 Maine became the first state to implement RC/IR in elections for the United States House of Representatives and United States Senate. The use of RC was decisive in one congressional contest, with CD2 incumbent Bruce Poliquin receiving the plurality (43.66%) of first round votes, but lacking a majority, lost in the second round of tabulation (Taylor and Stack 2018).

Subsequent to the November election, Congressman Poliquin and others filed a lawsuit against Maine Secretary of State Matthew Dunlap, seeking to be declared the CD2 winner by virtue of a plurality in the first round tabulations (Mistler 2018a). Congressman Poliquin and fellow plaintiffs maintained that

“… the RCV Act is unconstitutional, both facially and as applied, and that it violates the Voting Rights Act. They maintain that the ballot form and instructions were too confusing and that the manner by which Defendant Dunlap tabulated the votes diluted the votes cast by Poliquin supporters and otherwise disenfranchised too many Maine voters to withstand scrutiny.”

While unsuccessful, the Poliquin lawsuit brought attention to the tabulation of RC/IR ballots. Public criticism included references to a ``proprietary algorithm’’ used by the State to mechanize runoff tabulations (Muszynski 2018). The algorithm in question is implemented in proprietary software, and as such, is not available for public scrutiny. Nonetheless, shortly after the public release of cast vote records on November 21, 2018, multiple parties reported successful independent duplication of official State tabulations (Mistler 2018b), pointing out

“… that the software the state uses is proprietary. But the rules that are used by that software are just as public as the election results.”

It would seem that independent duplication of official results falls short of validating the propriety of proprietary software. In particular, the following questions remain:

  1. Are the rules complete? Do the rules completely determine the disposition of every ballot? If not, proprietary software would seem inappropriate.

  2. Are the rules consistent? If not, every implementation will fall short and a revision of the rules is indicated.

  3. Are the rules independent? Would a proper subset of the rules always produce the same result? Independence is a component of clarity and concision, key attributes for the communication and implementation of the rules.

  4. Does the implementation conform to the rules? Independent implementations often share share common flaws. Duplication of results for a single election is inconclusive.

The validation of software implementations is an extraordinary complex enterprise and has been carefully considered elsewhere (U. S. E. A. Commission 2019b, 2019a; U. E. A. Commission 2015). The focus here is the rules.

1.2 Approach

The case study follows from the author’s effort to independently and unofficially validate RC/IR tabulations presented by State of Maine for the three RC/IR contests. In particular, the goal was to do the following:

  1. Create a mathematical model of tabulation processing rendered in the vocabulary of set theory.

  2. Examine State of Maine RC/IR election rules in the context of the model.

  3. Develop and implement an algorithm to independently verify (potentially) tabulations produced by the proprietary algorithm currently deployed in State of Maine RC/IR elections.

To accomplish the first two tasks, only official and publicly available sources were used to identify RC/IR tabulation rules. To avoid adopting hidden assumptions, others with potential knowledge of rules or tabulation implementations were not consulted. A “clean room” strategy likewise affords an opportunity to evaluate the independence (clarity and concision) embodied by the rules. The assumption being:

Official rules ought to be sufficient to guide a software implementation of an independent tabulator capable of reproducing Maine RC/IR tabulations.

The results of the modeling effort are provided in a seperate document. An R package rcvr (Recievor) has been written to accomplish the final task is demonstrated in the sections that follow.

2 Recievor

Minimal packages required for rcvr are plyr and tidyverse.1

  library(plyr)
  library(tidyverse)
  library(kableExtra)
  library(rcvr)

2.1 Contest database

Metadata to reconstruct elections are stored in the textfile contest_keys.txt, including filenames and URLs for downloading original cast vote record files from the Maine Office of the Secretary of State, Division of Elections (Maine Office of Secretary of State n.d.). Thus far, three data sets are available, including:

  • June 12, 2018 - Primary Election
    • Governor - Democrat (132250 CVRs)
    • Representative to Congress District 2 - Democrat (50845 CVRs)
  • November 6, 2018 - General Election
    • Representative to Congress District 2 (296077 CVRs)
  dat <- read.table("contest_keys.txt",
                    sep = "|",
                    col.names = c(
                      "object",
                      "field",
                      "value"
                    ),
                    stringsAsFactors = FALSE,
                    comment.char = "#")
  knitr::kable(dat,
               row.names = FALSE,
               caption   = "Contest Keys Database") %>%
    kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"),
                  full_width = FALSE) %>%
    scroll_box(width = "100%", height = "300px")
Contest Keys Database
object field value
object field value
gov_June contest_name Democratic Primary Election
gov_June office Governor
gov_June date_str 06122018
gov_June cvr_url https://www.maine.gov/sos/cec/elec/results/2018
gov_June re_url https://www.maine.gov/sos/cec/elec/data/data-txt
gov_June alternative Cote
gov_June alternative Dion, D
gov_June alternative Dion, M
gov_June alternative Eves
gov_June alternative Mills
gov_June alternative Russell
gov_June alternative Sweet
gov_June alternative Write-in
gov_June ambiguity undervote
gov_June ambiguity overvote
gov_June cvr_file govd-1.xlsx
gov_June cvr_file govd-2.xlsx
gov_June cvr_file govd-3.xlsx
gov_June cvr_file govd-4.xlsx
gov_June cvr_file govd-5.xlsx
gov_June path inst/extdata
d2_June contest_name Democratic Primary Election
d2_June office Congressional District 2
d2_June date_str 06/12/2018
d2_June cvr_url https://www.maine.gov/sos/cec/elec/results/2018
d2_June re_url https://www.maine.gov/sos/cec/elec/data/data-txt
d2_June alternative Fulford
d2_June alternative Golden
d2_June alternative Olson
d2_June alternative St. Clair
d2_June ambiguity undervote
d2_June ambiguity overvote
d2_June cvr_file congressd2-1.xlsx
d2_June cvr_file congressd2-2.xlsx
d2_June cvr_file congressd2-3.xlsx
d2_June cvr_file congressd2-4.xlsx
d2_June path inst/extdata
d2_Nov contest_name General Election
d2_Nov office Congressional District 2
d2_Nov date_str 11062018
d2_Nov cvr_url https://www.maine.gov/sos/cec/elec/results/2018
d2_Nov re_url https://www.maine.gov/sos/cec/elec/data/data-txt
d2_Nov cvr_file Nov18CVRExportFINAL1.xlsx
d2_Nov cvr_file Nov18CVRExportFINAL2.xlsx
d2_Nov cvr_file Nov18CVRExportFINAL3.xlsx
d2_Nov cvr_file AUXCVRProofedCVR95RepCD2.xlsx
d2_Nov cvr_file UOCAVA2CVRRepCD2.xlsx
d2_Nov cvr_file UOCAVA-AUX-CVRRepCD2.xlsx
d2_Nov cvr_file UOCAVA-FINALRepCD2.xlsx
d2_Nov cvr_file RepCD2-8final.xlsx
d2_Nov alternative Bond
d2_Nov alternative Golden
d2_Nov alternative Hoar
d2_Nov alternative Poliquin
d2_Nov ambiguity undervote
d2_Nov ambiguity overvote
d2_Nov path inst/extdata
munidist url https://www.maine.gov/sos/cec/elec/2013/munidist2013.xlsx
munidist file_name munidist2013.xlsx
townshipdist url https://www.maine.gov/sos/cec/elec/apport/townshipdist.xlsx
townshipdist file_name townshipdist.xlsx
voting_place url https://www.maine.gov/sos/cec/elec/data/votingplace1119.xlsx

2.2 Contest instances

Recievor models each election using an S3 class contest.2

Use rrcv::contest() to construct a contest instance, which will store metadata as attributes and edited ballot data in an underlying dataframe3.

  1. If original == TRUE the contest_str must be set to an object found in the contest database, as well as valid values for source, CVR_file, and alternative fields matching object.

  2. If original == FALSE parameters for a folder (source =) and a list of cast vote records (CVR_files =) must be supplied when invoking rcvr::contest().

Once a contest instance is created tabulation is accomplished using rcvr::conduct_runoff().

2.3 Tabulation options

Tabulation of contest instances is accomplished by rcvr::conduct_runoff(), which provides options for processing overvotes and undervotes.4

For example under Maine rules, an overvote at a particular rank invalidates that choice and all subsequent choices. Other jurisdictions may ignore any or all overvotes. Under Maine rules, single undervotes are ignored but two consecutive undervotes invalidate all subsequent choice (Elections 2018). Maine law is more restrictive, with two sequential undervotes invalidating subsequent choices(Legislature n.d.). The default for rcvr::conduct_runoff()

  • sequentialU == TRUE
  • max_U = 2
  • sequentialO == TRUE
  • max_O = 1

3 Retabulations

3.1 June 2018 Democratic Primary for Governor

Call the constructor and encode the ballot choices to append to random ballot displayed in table below.

  gov_June <- rcvr::contest(
                      contest_name = "Democratic Primary for Governor",
                      original     = TRUE,
                      contest_str  = "gov_June",
                      creator      = "Ken Lane")
  codes    <- rcvr::get_codes(gov_June)
  kable(rcvr::show_contest(gov_June),
          row.names = FALSE,
          booktabs  = TRUE,
          caption   = "Metadata: Democratic Primary for Governor",
          col.names = c("Item", "Value"),
          digits    = 2,
          longtable = TRUE) %>%
    kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"),
                  full_width        = FALSE) %>%
    scroll_box(width = "100%", height = "300px")
Metadata: Democratic Primary for Governor
Item Value
Office Governor
Jurisdiction Maine
CVR location https://www.maine.gov/sos/cec/elec/results/2018
CVR file govd-1.xlsx
CVR file govd-2.xlsx
CVR file govd-3.xlsx
CVR file govd-4.xlsx
CVR file govd-5.xlsx
Candidate Cote, Adam Roland
Candidate Dion, Donna J.
Candidate Dion, Mark N.
Candidate Eves, Mark W.
Candidate Mills, Janet T.
Candidate Russell, Diane Marie
Candidate Sweet, Elizabeth A.
Candidate Write-in
Number of Candidates 8
Number of Ranks 8
Number of Ballots 132250
  num_ballots <- attr(gov_June, "num_records")
  df <- as.data.frame(gov_June)
  df <- mutate(df, code = codes)
  knitr::kable(df[sample(1:num_ballots, 100, replace = FALSE),],
               row.names = FALSE,
               caption   = "100 Random Ballots: Democratic Primary for Governor") %>%
    kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
    scroll_box(width = "100%", height = "300px")
100 Random Ballots: Democratic Primary for Governor
id precinct style 1st 2nd 3rd 4th 5th 6th 7th 8th code
319136 Sedgwick DEM Ballot Style 61 Mills, Janet T. Cote, Adam Roland Eves, Mark W. undervote undervote undervote undervote undervote EADUUUUU
457439 Appleton DEM Ballot Style 15 Sweet, Elizabeth A. Eves, Mark W. Russell, Diane Marie Mills, Janet T. Dion, Mark N. Dion, Donna J. Cote, Adam Roland undervote GDFECBAU
439052 Auburn All DEM Ballot Style 26 Mills, Janet T. Dion, Mark N. Sweet, Elizabeth A. Dion, Donna J. Russell, Diane Marie Eves, Mark W. Cote, Adam Roland undervote ECGBFDAU
80729 Alfred DEM Ballot Style 8 Cote, Adam Roland Mills, Janet T. Sweet, Elizabeth A. undervote undervote undervote undervote undervote AEGUUUUU
152190 Enfield DEM Ballot Style 115 Mills, Janet T. Cote, Adam Roland Eves, Mark W. Dion, Mark N. undervote undervote undervote undervote EADCUUUU
78542 Arundel DEM Ballot Style 18 Sweet, Elizabeth A. Mills, Janet T. Eves, Mark W. undervote undervote undervote undervote undervote GEDUUUUU
444297 Auburn W4 DEM Ballot Style 27 Mills, Janet T. Sweet, Elizabeth A. Eves, Mark W. Cote, Adam Roland Dion, Donna J. Dion, Mark N. Russell, Diane Marie undervote EGDABCFU
279732 Waterville W1 DEM Ballot Style 251 Dion, Mark N. Mills, Janet T. undervote undervote undervote undervote undervote undervote CEUUUUUU
133002 Bangor W1 DEM Ballot Style 37 Sweet, Elizabeth A. Eves, Mark W. Russell, Diane Marie Cote, Adam Roland Mills, Janet T. undervote undervote undervote GDFAEUUU
337036 Portland W5 P1 DEM Ballot Style 208 undervote undervote undervote undervote undervote undervote undervote undervote UUUUUUUU
391598 Windham W1 DEM Ballot Style 263 Dion, Mark N. undervote undervote undervote undervote undervote undervote undervote CUUUUUUU
63001 Limington DEM Ballot Style 161 Dion, Donna J. Sweet, Elizabeth A. Cote, Adam Roland Dion, Mark N. Russell, Diane Marie Mills, Janet T. Eves, Mark W. undervote BGACFEDU
33854 Saco W2 DEM Ballot Style 223 Sweet, Elizabeth A. Dion, Donna J. Russell, Diane Marie Mills, Janet T. Eves, Mark W. Dion, Mark N. Cote, Adam Roland undervote GBFEDCAU
385507 Windham W1 DEM Ballot Style 264 Mills, Janet T. Cote, Adam Roland Dion, Mark N. Eves, Mark W. Sweet, Elizabeth A. Russell, Diane Marie Dion, Donna J. undervote EACDGFBU
205578 Mount Desert DEM Ballot Style 38 Mills, Janet T. Eves, Mark W. Cote, Adam Roland Sweet, Elizabeth A. undervote undervote undervote undervote EDAGUUUU
199877 Bristol DEM Ballot Style 56 Mills, Janet T. Eves, Mark W. Sweet, Elizabeth A. Dion, Mark N. Cote, Adam Roland Dion, Donna J. Russell, Diane Marie undervote EDGCABFU
403220 Yarmouth DEM Ballot Style 88 Eves, Mark W. Mills, Janet T. Cote, Adam Roland undervote undervote undervote undervote undervote DEAUUUUU
16674 Wells W1 DEM Ballot Style 255 Sweet, Elizabeth A. Cote, Adam Roland Eves, Mark W. Mills, Janet T. Dion, Mark N. Dion, Donna J. Russell, Diane Marie undervote GADECBFU
364315 South Portland W1 DEM Ballot Style 237 Sweet, Elizabeth A. Mills, Janet T. Eves, Mark W. undervote undervote undervote undervote undervote GEDUUUUU
369802 Falmouth W1 DEM Ballot Style 119 Mills, Janet T. Dion, Mark N. Eves, Mark W. Russell, Diane Marie Sweet, Elizabeth A. Dion, Donna J. Cote, Adam Roland undervote ECDFGBAU
57965 Lyman W1 DEM Ballot Style 169 Eves, Mark W. Dion, Mark N. Mills, Janet T. undervote undervote undervote undervote undervote DCEUUUUU
266717 Dixfield DEM Ballot Style 76 Cote, Adam Roland Eves, Mark W. Sweet, Elizabeth A. Dion, Donna J. Dion, Mark N. Mills, Janet T. Russell, Diane Marie undervote ADGBCEFU
424897 Fort Fairfield DEM Ballot Style 111 Cote, Adam Roland Mills, Janet T. Eves, Mark W. Russell, Diane Marie undervote undervote undervote undervote AEDFUUUU
93926 Searsmont DEM Ballot Style 157 Cote, Adam Roland Mills, Janet T. Dion, Mark N. Eves, Mark W. Russell, Diane Marie Sweet, Elizabeth A. Dion, Donna J. undervote AECDFGBU
320765 Portland W4 P2 DEM Ballot Style 211 Mills, Janet T. Cote, Adam Roland Eves, Mark W. Sweet, Elizabeth A. Dion, Mark N. undervote undervote undervote EADGCUUU
490194 Eustis DEM Ballot Style 6 Mills, Janet T. Eves, Mark W. Cote, Adam Roland Sweet, Elizabeth A. Dion, Mark N. undervote undervote undervote EDAGCUUU
491763 Westport Island DEM Ballot Style 52 Mills, Janet T. undervote undervote undervote undervote undervote undervote undervote EUUUUUUU
302246 Hallowell DEM Ballot Style 135 Sweet, Elizabeth A. Eves, Mark W. Cote, Adam Roland Mills, Janet T. Dion, Mark N. undervote undervote undervote GDAECUUU
381010 Harrison DEM Ballot Style 60 Cote, Adam Roland Mills, Janet T. Dion, Mark N. Eves, Mark W. undervote undervote undervote undervote AECDUUUU
381911 Windham W1 DEM Ballot Style 264 Mills, Janet T. Cote, Adam Roland Eves, Mark W. Sweet, Elizabeth A. Dion, Donna J. Russell, Diane Marie Dion, Donna J. undervote EADGBFBU
254425 Bangor W1 DEM Ballot Style 36 Mills, Janet T. Sweet, Elizabeth A. Dion, Donna J. Dion, Mark N. Cote, Adam Roland Eves, Mark W. Russell, Diane Marie undervote EGBCADFU
185793 Farmingdale DEM Ballot Style 120 Mills, Janet T. Dion, Mark N. Cote, Adam Roland Dion, Donna J. undervote undervote undervote undervote ECABUUUU
93591 Searsmont DEM Ballot Style 157 Mills, Janet T. Sweet, Elizabeth A. Cote, Adam Roland undervote undervote undervote undervote undervote EGAUUUUU
365472 South Portland W1 DEM Ballot Style 237 Cote, Adam Roland Mills, Janet T. Dion, Mark N. Eves, Mark W. Sweet, Elizabeth A. Dion, Donna J. Russell, Diane Marie undervote AECDGBFU
375374 Standish W1 DEM Ballot Style 241 Cote, Adam Roland Mills, Janet T. Eves, Mark W. Dion, Mark N. Sweet, Elizabeth A. undervote undervote undervote AEDCGUUU
325098 Portland W3 P2 DEM Ballot Style 210 Dion, Mark N. Mills, Janet T. Sweet, Elizabeth A. Russell, Diane Marie Dion, Donna J. Cote, Adam Roland Eves, Mark W. undervote CEGFBADU
507790 Ellsworth W3 DEM Ballot Style 114 Mills, Janet T. Eves, Mark W. Sweet, Elizabeth A. undervote undervote undervote undervote undervote EDGUUUUU
315583 Surry DEM Ballot Style 51 Mills, Janet T. Eves, Mark W. undervote undervote undervote undervote undervote undervote EDUUUUUU
325383 Portland W3 P2 DEM Ballot Style 209 Cote, Adam Roland Mills, Janet T. Eves, Mark W. Sweet, Elizabeth A. undervote undervote undervote undervote AEDGUUUU
332709 Portland W1 P1 DEM Ballot Style 202 Mills, Janet T. Sweet, Elizabeth A. Russell, Diane Marie undervote undervote undervote undervote undervote EGFUUUUU
67981 Eliot DEM Ballot Style 113 Eves, Mark W. Sweet, Elizabeth A. undervote undervote undervote undervote undervote undervote DGUUUUUU
194499 Nobleboro W1 DEM Ballot Style 56 Cote, Adam Roland Mills, Janet T. Sweet, Elizabeth A. Eves, Mark W. Russell, Diane Marie Dion, Donna J. Dion, Mark N. undervote AEGDFBCU
50057 North Berwick W1 DEM Ballot Style 45 Eves, Mark W. Mills, Janet T. Sweet, Elizabeth A. Cote, Adam Roland undervote undervote undervote undervote DEGAUUUU
238282 Gorham W1-P2 DEM Ballot Style 128 Eves, Mark W. Dion, Donna J. Sweet, Elizabeth A. Russell, Diane Marie Cote, Adam Roland Dion, Mark N. Mills, Janet T. undervote DBGFACEU
484308 Vinalhaven DEM Ballot Style 140 Eves, Mark W. Cote, Adam Roland Mills, Janet T. Dion, Donna J. Dion, Mark N. Russell, Diane Marie Sweet, Elizabeth A. overvote DAEBCFGO
359173 Westbrook W4 DEM Ballot Style 261 Cote, Adam Roland Dion, Mark N. Eves, Mark W. undervote undervote undervote undervote undervote ACDUUUUU
32407 Kennebunk W1 DEM Ballot Style 144 undervote undervote undervote undervote undervote undervote undervote undervote UUUUUUUU
429855 Lewiston W5 DEM Ballot Style 155 Cote, Adam Roland Mills, Janet T. undervote undervote undervote undervote undervote undervote AEUUUUUU
344875 Portland W5 P2 DEM Ballot Style 216 Cote, Adam Roland Dion, Mark N. Eves, Mark W. Mills, Janet T. Dion, Donna J. Russell, Diane Marie Sweet, Elizabeth A. undervote ACDEBFGU
368865 Falmouth W1 DEM Ballot Style 119 Mills, Janet T. Dion, Mark N. Eves, Mark W. Dion, Donna J. Cote, Adam Roland Russell, Diane Marie Sweet, Elizabeth A. undervote ECDBAFGU
462249 Portland W3 P1 DEM Ballot Style 209 Sweet, Elizabeth A. Mills, Janet T. Eves, Mark W. Dion, Mark N. undervote undervote undervote undervote GEDCUUUU
173213 Richmond W1 DEM Ballot Style 53 Mills, Janet T. Cote, Adam Roland Sweet, Elizabeth A. undervote Russell, Diane Marie Dion, Donna J. Dion, Mark N. Eves, Mark W. EAGUFBCD
10803 Biddeford W1 DEM Ballot Style 49 undervote undervote undervote undervote undervote undervote undervote undervote UUUUUUUU
347905 Portland W2 P1 DEM Ballot Style 203 Sweet, Elizabeth A. Eves, Mark W. Russell, Diane Marie undervote undervote undervote undervote undervote GDFUUUUU
208272 Bar Harbor DEM Ballot Style 38 Mills, Janet T. Eves, Mark W. Russell, Diane Marie Sweet, Elizabeth A. undervote undervote undervote undervote EDFGUUUU
140925 Lubec DEM Ballot Style 101 Mills, Janet T. Sweet, Elizabeth A. Eves, Mark W. Russell, Diane Marie undervote undervote undervote undervote EGDFUUUU
106096 Dover-Foxcroft DEM Ballot Style 21 Cote, Adam Roland Sweet, Elizabeth A. Eves, Mark W. Mills, Janet T. Russell, Diane Marie Dion, Donna J. Dion, Mark N. undervote AGDEFBCU
392214 Yarmouth DEM Ballot Style 88 Mills, Janet T. Cote, Adam Roland Sweet, Elizabeth A. undervote undervote undervote undervote undervote EAGUUUUU
177462 Winthrop DEM Ballot Style 220 Sweet, Elizabeth A. undervote undervote undervote undervote undervote undervote undervote GUUUUUUU
118181 Old Town DEM Ballot Style 190 Eves, Mark W. Dion, Mark N. undervote undervote undervote undervote undervote undervote DCUUUUUU
263951 Paris DEM Ballot Style 197 Mills, Janet T. Dion, Mark N. undervote Cote, Adam Roland undervote undervote undervote undervote ECUAUUUU
162627 Buckfield DEM Ballot Style 67 Mills, Janet T. Dion, Donna J. Eves, Mark W. Cote, Adam Roland Russell, Diane Marie Dion, Mark N. Sweet, Elizabeth A. undervote EBDAFCGU
228662 Raymond W1 DEM Ballot Style 83 Cote, Adam Roland Dion, Mark N. Mills, Janet T. undervote undervote undervote undervote undervote ACEUUUUU
80864 Alfred DEM Ballot Style 8 Mills, Janet T. Eves, Mark W. Cote, Adam Roland Sweet, Elizabeth A. Russell, Diane Marie undervote Dion, Mark N. Dion, Donna J. EDAGFUCB
505906 Lewiston W2 DEM Ballot Style 149 Cote, Adam Roland undervote undervote undervote undervote undervote undervote undervote AUUUUUUU
501719 Solon DEM Ballot Style 171 Cote, Adam Roland Dion, Mark N. Sweet, Elizabeth A. Russell, Diane Marie Dion, Donna J. undervote undervote undervote ACGFBUUU
294525 Augusta W4 DEM Ballot Style 28 Sweet, Elizabeth A. Cote, Adam Roland Russell, Diane Marie Dion, Mark N. Eves, Mark W. Mills, Janet T. Dion, Donna J. undervote GAFCDEBU
285517 Waterville W1 DEM Ballot Style 252 Cote, Adam Roland Eves, Mark W. Sweet, Elizabeth A. Mills, Janet T. Dion, Mark N. Russell, Diane Marie Dion, Donna J. undervote ADGECFBU
207977 Bar Harbor DEM Ballot Style 38 Mills, Janet T. Cote, Adam Roland undervote undervote undervote undervote undervote undervote EAUUUUUU
79442 Arundel DEM Ballot Style 18 Eves, Mark W. Dion, Mark N. Cote, Adam Roland Sweet, Elizabeth A. Russell, Diane Marie Dion, Donna J. Mills, Janet T. undervote DCAGFBEU
447416 Lisbon DEM Ballot Style 163 Mills, Janet T. Cote, Adam Roland Dion, Mark N. Sweet, Elizabeth A. undervote Russell, Diane Marie Eves, Mark W. undervote EACGUFDU
196031 Damariscotta DEM Ballot Style 102 Cote, Adam Roland undervote undervote undervote undervote undervote undervote undervote AUUUUUUU
182682 Winslow DEM Ballot Style 266 Mills, Janet T. undervote undervote undervote undervote undervote undervote undervote EUUUUUUU
268991 Greenwood DEM Ballot Style 3 Write-in undervote undervote undervote undervote undervote undervote undervote HUUUUUUU
355364 South Portland All DEM Ballot Style 78 Sweet, Elizabeth A. Eves, Mark W. Cote, Adam Roland Mills, Janet T. Russell, Diane Marie undervote undervote undervote GDAEFUUU
291821 Augusta All DEM Ballot Style 29 Cote, Adam Roland Dion, Mark N. Dion, Donna J. Russell, Diane Marie Sweet, Elizabeth A. Eves, Mark W. Mills, Janet T. undervote ACBFGDEU
200435 Boothbay Harbor DEM Ballot Style 52 Mills, Janet T. undervote undervote undervote undervote undervote undervote undervote EUUUUUUU
399415 Scarborough W1 DEM Ballot Style 230 undervote undervote undervote undervote undervote undervote undervote undervote UUUUUUUU
80689 Alfred DEM Ballot Style 8 Sweet, Elizabeth A. Cote, Adam Roland Eves, Mark W. Dion, Mark N. Mills, Janet T. Russell, Diane Marie undervote Dion, Donna J. GADCEFUB
238630 Gorham W1-P2 DEM Ballot Style 128 Cote, Adam Roland Russell, Diane Marie Dion, Mark N. Eves, Mark W. Sweet, Elizabeth A. Dion, Mark N. undervote undervote AFCDGCUU
277147 Waterville W1 DEM Ballot Style 251 Cote, Adam Roland Dion, Mark N. Dion, Donna J. Mills, Janet T. Eves, Mark W. Russell, Diane Marie Sweet, Elizabeth A. undervote ACBEDFGU
492694 Ripley DEM Ballot Style 73 Sweet, Elizabeth A. Mills, Janet T. Eves, Mark W. Dion, Mark N. Cote, Adam Roland undervote undervote undervote GEDCAUUU
71393 Eliot DEM Ballot Style 113 Eves, Mark W. Cote, Adam Roland Mills, Janet T. Sweet, Elizabeth A. undervote undervote undervote undervote DAEGUUUU
200666 Boothbay Harbor DEM Ballot Style 52 Mills, Janet T. undervote undervote undervote undervote undervote undervote undervote EUUUUUUU
390999 Windham W1 DEM Ballot Style 263 Cote, Adam Roland undervote undervote undervote undervote undervote undervote undervote AUUUUUUU
191935 Jefferson DEM Ballot Style 143 undervote undervote undervote undervote undervote undervote undervote undervote UUUUUUUU
95626 Topsham DEM Ballot Style 245 Mills, Janet T. Cote, Adam Roland Eves, Mark W. Sweet, Elizabeth A. Dion, Mark N. Dion, Donna J. Russell, Diane Marie undervote EADGCBFU
139617 Acton DEM Ballot Style 2 Cote, Adam Roland Eves, Mark W. Sweet, Elizabeth A. Mills, Janet T. Dion, Donna J. Russell, Diane Marie Dion, Mark N. undervote ADGEBFCU
491736 Westport Island DEM Ballot Style 52 Cote, Adam Roland Sweet, Elizabeth A. Dion, Mark N. undervote undervote undervote undervote undervote AGCUUUUU
11766 Biddeford W1 DEM Ballot Style 47 Mills, Janet T. Dion, Donna J. undervote undervote undervote undervote undervote undervote EBUUUUUU
204311 Lamoine DEM Ballot Style 38 Sweet, Elizabeth A. Eves, Mark W. Dion, Mark N. Cote, Adam Roland Dion, Donna J. Mills, Janet T. Russell, Diane Marie undervote GDCABEFU
220435 Thomaston DEM Ballot Style 239 Mills, Janet T. Cote, Adam Roland Eves, Mark W. Dion, Mark N. Sweet, Elizabeth A. undervote undervote undervote EADCGUUU
358578 Westbrook W4 DEM Ballot Style 261 Mills, Janet T. Dion, Mark N. Sweet, Elizabeth A. undervote undervote undervote undervote Cote, Adam Roland ECGUUUUA
398693 Scarborough W1 DEM Ballot Style 230 Mills, Janet T. Sweet, Elizabeth A. Dion, Donna J. Russell, Diane Marie Cote, Adam Roland Dion, Mark N. Eves, Mark W. undervote EGBFACDU
402242 Yarmouth DEM Ballot Style 88 Mills, Janet T. Sweet, Elizabeth A. Russell, Diane Marie Dion, Donna J. undervote undervote undervote undervote EGFBUUUU
131101 Corinna DEM Ballot Style 94 Cote, Adam Roland Dion, Mark N. Eves, Mark W. Mills, Janet T. Sweet, Elizabeth A. Russell, Diane Marie Dion, Donna J. undervote ACDEGFBU
185818 Farmingdale DEM Ballot Style 120 Cote, Adam Roland Eves, Mark W. Sweet, Elizabeth A. Mills, Janet T. Dion, Mark N. Dion, Donna J. Russell, Diane Marie undervote ADGECBFU
356182 South Portland All DEM Ballot Style 78 Mills, Janet T. Sweet, Elizabeth A. undervote Eves, Mark W. Dion, Mark N. Dion, Donna J. Cote, Adam Roland Write-in EGUDCBAH
366638 Westbrook W2 DEM Ballot Style 260 Eves, Mark W. Eves, Mark W. Eves, Mark W. undervote undervote undervote undervote undervote DDDUUUUU
332697 Portland W1 P1 DEM Ballot Style 202 Sweet, Elizabeth A. Cote, Adam Roland Mills, Janet T. undervote undervote undervote undervote undervote GAEUUUUU

\(~\)

June 2018 gubernatorial primary results posted by the State of Maine can be found here. This tabulation cannot be reproduced using the process described by the administrative rules (Elections 2018). The tabulation corresponding to the rules is easily generated.

tab1 <- rcvr::conduct_runoff(gov_June)
df1  <- rcvr::make_report4(tab1)

Official Maine results can be duplicated by “tweaking” the rules.5

tab2 <- rcvr::conduct_runoff(gov_June,
                             sequentialU = TRUE,
                             june2018    = TRUE)
df2  <- rcvr::make_report4(tab2)
June 2018 Democratic Primary for Governor
Round 1
Round 2
Round 3
Round 4
Rules Reported Rules Reported Rules Reported Rules Reported
Candidate Names
Cote, Adam Roland 35478 35478 37543 37543 42623 42623 53866 53866
Dion, Donna J. 1596 1596 0 0 0 0 0 0
Dion, Mark N. 5200 5200 0 0 0 0 0 0
Eves, Mark W. 17887 17887 19521 19521 0 0 0 0
Mills, Janet T. 41735 41735 44042 44042 49945 49945 63387 63384
Russell, Diane Marie 2728 2728 0 0 0 0 0 0
Sweet, Elizabeth A. 20767 20767 22987 22987 29944 29944 0 0
Write-in 748 748 0 0 0 0 0 0
Ballot Exhausted
By Overvotes 430 430 472 472 507 507 580 580
By Undervotes 5681 5681 7568 7568 9056 9056 14152 14155
By Exhausted Choices 0 0 117 117 175 175 265 265

While internally consistent (non-contradictory), the administrative rules are not in alignment with the corresponding statute with regard to skipped rankings (Legislature n.d.). In fact, parties reporting duplicating November CD2 tabulations were unable to duplicate results for the June Gubernatorial primary use the same algorithm.6

Three idiosyncratic ballots from the June 2018 gubernatorial primary have been identified.

r1   <- unlist(tab1$round4$result)
r2   <- unlist(tab2$round4$result)
diff <- (r1 != r2)
df   <- gov_June %>% as.data.frame()
df   <- mutate(df, code = codes)
dat  <- df[diff, c(1, 2, 12)]
knitr::kable(dat, 
             row.names = FALSE,
             booktabs  = TRUE,
             caption   = "Ballots of Interest",
             col.names = c("CVR ID", "Precinct", "Coded Choices"),
             digits    = 2,
             longtable = TRUE)  %>%
  kable_styling(bootstrap_options = c("striped", "repeat_header"),
                full_width        = FALSE)
Ballots of Interest
CVR ID Precinct Coded Choices
485831 Dixmont GDUBUFEH
265479 Porter BGDCUFUE
335281 Portland W2 P2 GUBFDUEA

The three ballots would be awarded to candidate E (Janet Mills) in the fourth round using the “two consecutive” trimming rule. Independent implementations report 3 fewer votes for Janet Mills in the final round than the official tabulation. The results generated by the proprietary algorithm can be achieved by trimming each ballot after the second skipped ranking, except where the first skipped ranking is the first choice ranking. There were three such exceptional ballots

  • File: govd-2.xlsx, Row: 1315, Code: UGUBAEDC, Cast Vote Record: 13216: Precinct: Old Orchard Beach
  • File: govd-2.xlsx, Row: 33534, Code: UGUECGAF, Cast Vote Record: 141592: Precinct: Eastport
  • File: govd-2.xlsx, Row: 41151, Code: UCUAUUUU, Cast Vote Record: 173959: Precinct: Harpswell W1

3.2 June 2018 Maine CD2 Democratic Primary

Use contest.R to construct a contest instance.

  d2_June <- rcvr::contest(
    contest_name = "2018 Maine CD2 Democratic Primary",
    original     = TRUE,
    contest_str  = "d2_June",
    creator      = "Ken Lane",
    quietly      = TRUE)
  codes    <- rcvr::get_codes(d2_June)
Metadata: CD2 Democratic Primary
Item Value
Office Congressional District 2
Jurisdiction Maine
CVR location https://www.maine.gov/sos/cec/elec/results/2018
CVR file congressd2-1.xlsx
CVR file congressd2-2.xlsx
CVR file congressd2-3.xlsx
CVR file congressd2-4.xlsx
Candidate Fulford, Jonathan S.
Candidate Golden, Jared F.
Candidate Olson, Craig R.
Candidate St. Clair, Lucas R.
Number of Candidates 4
Number of Ranks 5
Number of Ballots 50845
  num_ballots <- attr(d2_June, "num_records")
  df <- as.data.frame(d2_June)
  df <- mutate(df, code = codes)
  knitr::kable(df[sample(1:num_ballots, 100, replace = FALSE),],
               row.names = FALSE,
               caption   = "100 Random Ballots: CD2 Democratic Primary") %>%
    kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
    scroll_box(width = "100%", height = "300px")
100 Random Ballots: CD2 Democratic Primary
id precinct style 1st 2nd 3rd 4th 5th code
124379 Orono All DEM Ballot Style 191 St. Clair, Lucas R. Golden, Jared F. Fulford, Jonathan S. Olson, Craig R. undervote DBACU
105345 Dover-Foxcroft DEM Ballot Style 21 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
126713 Hermon DEM Ballot Style 138 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
444134 Auburn W4 DEM Ballot Style 27 St. Clair, Lucas R. Golden, Jared F. Fulford, Jonathan S. Olson, Craig R. undervote DBACU
250343 Sherman DEM Ballot Style 59 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
149787 Howland DEM Ballot Style 115 Golden, Jared F. undervote undervote undervote undervote BUUUU
502453 Prospect DEM Ballot Style 218 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
427776 Lewiston W6 DEM Ballot Style 155 Golden, Jared F. undervote undervote undervote undervote BUUUU
263095 Paris DEM Ballot Style 197 Golden, Jared F. St. Clair, Lucas R. Olson, Craig R. undervote undervote BDCUU
311641 Bucksport DEM Ballot Style 68 Golden, Jared F. undervote undervote undervote undervote BUUUU
502989 Freedom DEM Ballot Style 62 Fulford, Jonathan S. undervote undervote undervote undervote AUUUU
254147 Bangor W1 DEM Ballot Style 36 St. Clair, Lucas R. Olson, Craig R. Fulford, Jonathan S. Golden, Jared F. undervote DCABU
430469 Lewiston W7 DEM Ballot Style 155 Golden, Jared F. Olson, Craig R. St. Clair, Lucas R. undervote undervote BCDUU
508317 Orland DEM Ballot Style 104 Golden, Jared F. St. Clair, Lucas R. Olson, Craig R. undervote undervote BDCUU
202833 Southwest Harbor DEM Ballot Style 97 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
504445 Waterford DEM Ballot Style 244 Golden, Jared F. Fulford, Jonathan S. undervote undervote undervote BAUUU
283692 Oakland W1 DEM Ballot Style 187 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
444214 Auburn W4 DEM Ballot Style 23 Golden, Jared F. Fulford, Jonathan S. undervote undervote undervote BAUUU
431714 Lewiston W4 DEM Ballot Style 152 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
449897 Poland W1 DEM Ballot Style 200 Olson, Craig R. St. Clair, Lucas R. Fulford, Jonathan S. Golden, Jared F. undervote CDABU
296560 Monmouth W1 DEM Ballot Style 178 Golden, Jared F. Fulford, Jonathan S. Olson, Craig R. undervote undervote BACUU
496065 Garland DEM Ballot Style 87 Olson, Craig R. St. Clair, Lucas R. Golden, Jared F. undervote undervote CDBUU
129017 Bangor W1 DEM Ballot Style 37 Golden, Jared F. Fulford, Jonathan S. St. Clair, Lucas R. Olson, Craig R. undervote BADCU
433628 Lewiston W1 DEM Ballot Style 150 Golden, Jared F. undervote undervote undervote undervote BUUUU
495649 Sweden DEM Ballot Style 244 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
267512 Fryeburg DEM Ballot Style 63 undervote undervote undervote undervote undervote UUUUU
127362 Hermon DEM Ballot Style 138 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
485795 Dixmont DEM Ballot Style 94 Fulford, Jonathan S. St. Clair, Lucas R. Olson, Craig R. Golden, Jared F. undervote ADCBU
419405 Caribou DEM Ballot Style 79 St. Clair, Lucas R. Olson, Craig R. Golden, Jared F. Fulford, Jonathan S. undervote DCBAU
424698 Fort Fairfield DEM Ballot Style 111 St. Clair, Lucas R. Golden, Jared F. undervote undervote undervote DBUUU
9628 Bangor W1 DEM Ballot Style 34 Golden, Jared F. Olson, Craig R. Fulford, Jonathan S. St. Clair, Lucas R. undervote BCADU
508098 Orland DEM Ballot Style 104 St. Clair, Lucas R. Olson, Craig R. undervote undervote undervote DCUUU
263754 Paris DEM Ballot Style 197 Golden, Jared F. St. Clair, Lucas R. Olson, Craig R. Fulford, Jonathan S. undervote BDCAU
252924 Oxford DEM Ballot Style 195 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
432312 Lewiston W4 DEM Ballot Style 149 Olson, Craig R. St. Clair, Lucas R. Fulford, Jonathan S. undervote Golden, Jared F. CDAUB
112428 Millinocket DEM Ballot Style 110 Golden, Jared F. undervote undervote undervote undervote BUUUU
282601 Oakland W1 DEM Ballot Style 187 Golden, Jared F. Olson, Craig R. Fulford, Jonathan S. St. Clair, Lucas R. undervote BCADU
109844 Orrington DEM Ballot Style 193 Olson, Craig R. Golden, Jared F. undervote undervote undervote CBUUU
483313 New Sweden DEM Ballot Style 79 St. Clair, Lucas R. Olson, Craig R. Fulford, Jonathan S. Golden, Jared F. undervote DCABU
508379 Fayette DEM Ballot Style 122 St. Clair, Lucas R. Golden, Jared F. Fulford, Jonathan S. undervote undervote DBAUU
503571 Belfast W3 DEM Ballot Style 41 undervote undervote undervote undervote undervote UUUUU
505698 Lewiston W2 DEM Ballot Style 149 Golden, Jared F. undervote undervote undervote undervote BUUUU
310231 Ellsworth W1 DEM Ballot Style 114 Golden, Jared F. undervote undervote undervote undervote BUUUU
205364 Mount Desert DEM Ballot Style 38 undervote undervote undervote undervote undervote UUUUU
309248 Ellsworth W4 DEM Ballot Style 114 St. Clair, Lucas R. Golden, Jared F. undervote undervote undervote DBUUU
113389 Dexter DEM Ballot Style 87 St. Clair, Lucas R. Golden, Jared F. Olson, Craig R. undervote undervote DBCUU
600015 Northport DS200 Olson, Craig R. St. Clair, Lucas R. Fulford, Jonathan S. Golden, Jared F. undervote CDABU
140624 Palermo DEM Ballot Style 157 Golden, Jared F. St. Clair, Lucas R. Olson, Craig R. Fulford, Jonathan S. undervote BDCAU
447780 Auburn W3 DEM Ballot Style 27 Golden, Jared F. Fulford, Jonathan S. St. Clair, Lucas R. Olson, Craig R. undervote BADCU
318846 Castine DEM Ballot Style 84 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
206953 Bar Harbor DEM Ballot Style 38 undervote undervote undervote undervote undervote UUUUU
141444 Lubec DEM Ballot Style 101 Golden, Jared F. undervote undervote undervote undervote BUUUU
487216 Cornville DEM Ballot Style 22 Golden, Jared F. St. Clair, Lucas R. Olson, Craig R. Fulford, Jonathan S. undervote BDCAU
215030 Strong DEM Ballot Style 91 Golden, Jared F. St. Clair, Lucas R. Fulford, Jonathan S. Olson, Craig R. undervote BDACU
483300 New Sweden DEM Ballot Style 79 undervote undervote undervote undervote undervote UUUUU
454123 Auburn W1 DEM Ballot Style 23 Golden, Jared F. St. Clair, Lucas R. Fulford, Jonathan S. Olson, Craig R. undervote BDACU
122909 Orono All DEM Ballot Style 191 undervote undervote undervote undervote undervote UUUUU
323129 Wilton DEM Ballot Style 91 undervote undervote undervote undervote undervote UUUUU
427010 Madawaska DEM Ballot Style 99 undervote undervote undervote undervote undervote UUUUU
501701 Solon DEM Ballot Style 171 Golden, Jared F. St. Clair, Lucas R. Fulford, Jonathan S. Olson, Craig R. undervote BDACU
269771 Bethel DEM Ballot Style 3 St. Clair, Lucas R. Golden, Jared F. Olson, Craig R. undervote undervote DBCUU
485291 Stetson DEM Ballot Style 116 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
205821 Mount Desert DEM Ballot Style 38 Golden, Jared F. St. Clair, Lucas R. Olson, Craig R. Fulford, Jonathan S. undervote BDCAU
263554 Paris DEM Ballot Style 197 undervote undervote undervote undervote undervote UUUUU
92797 Fairfield DEM Ballot Style 117 St. Clair, Lucas R. Olson, Craig R. Golden, Jared F. Fulford, Jonathan S. undervote DCBAU
489147 Jonesboro DEM Ballot Style 4 Golden, Jared F. Fulford, Jonathan S. St. Clair, Lucas R. Olson, Craig R. undervote BADCU
498043 Milbridge DEM Ballot Style 4 undervote undervote undervote undervote undervote UUUUU
125630 Bangor W1 DEM Ballot Style 36 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
423993 Van Buren DEM Ballot Style 99 Golden, Jared F. Fulford, Jonathan S. Olson, Craig R. St. Clair, Lucas R. undervote BACDU
323067 Wilton DEM Ballot Style 91 undervote undervote undervote undervote undervote UUUUU
450710 Poland W1 DEM Ballot Style 201 undervote undervote undervote undervote undervote UUUUU
202800 Southwest Harbor DEM Ballot Style 97 Golden, Jared F. St. Clair, Lucas R. Olson, Craig R. undervote undervote BDCUU
119529 Hampden DEM Ballot Style 136 Golden, Jared F. St. Clair, Lucas R. Olson, Craig R. Fulford, Jonathan S. undervote BDCAU
452419 Auburn W2 DEM Ballot Style 24 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
495712 Roxbury DEM Ballot Style 176 Golden, Jared F. undervote undervote undervote undervote BUUUU
437981 Mechanic Falls DEM Ballot Style 174 Golden, Jared F. undervote undervote undervote undervote BUUUU
327986 Farmington DEM Ballot Style 121 undervote undervote undervote undervote undervote UUUUU
308746 Ellsworth W4 DEM Ballot Style 114 St. Clair, Lucas R. Golden, Jared F. undervote undervote undervote DBUUU
508310 Orland DEM Ballot Style 104 Olson, Craig R. St. Clair, Lucas R. Golden, Jared F. Fulford, Jonathan S. undervote CDBAU
463191 Corinth DEM Ballot Style 95 St. Clair, Lucas R. Golden, Jared F. Olson, Craig R. Fulford, Jonathan S. undervote DBCAU
494511 Portage Lake DEM Ballot Style 19 St. Clair, Lucas R. Golden, Jared F. Olson, Craig R. undervote undervote DBCUU
130579 Corinth DEM Ballot Style 95 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
252135 Oxford DEM Ballot Style 195 undervote undervote undervote undervote undervote UUUUU
482668 Washburn DEM Ballot Style 85 undervote undervote undervote undervote undervote UUUUU
144059 Saint Albans DEM Ballot Style 73 undervote undervote undervote undervote undervote UUUUU
501178 Mattawamkeag DEM Ballot Style 90 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
495050 Weld DEM Ballot Style 31 Golden, Jared F. Olson, Craig R. undervote undervote undervote BCUUU
208212 Bar Harbor DEM Ballot Style 38 Golden, Jared F. St. Clair, Lucas R. undervote undervote undervote BDUUU
443878 Auburn W4 DEM Ballot Style 27 Golden, Jared F. Olson, Craig R. undervote undervote undervote BCUUU
494486 Chapman DEM Ballot Style 50 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
108700 Veazie DEM Ballot Style 246 St. Clair, Lucas R. Golden, Jared F. Olson, Craig R. undervote undervote DBCUU
320205 Dedham DEM Ballot Style 104 Olson, Craig R. undervote undervote undervote undervote CUUUU
489476 Westfield DEM Ballot Style 50 St. Clair, Lucas R. Fulford, Jonathan S. Golden, Jared F. Olson, Craig R. undervote DABCU
446217 Lisbon DEM Ballot Style 163 Golden, Jared F. undervote undervote undervote undervote BUUUU
272638 Brownfield DEM Ballot Style 63 St. Clair, Lucas R. Olson, Craig R. undervote undervote undervote DCUUU
483574 Brooksville DEM Ballot Style 61 St. Clair, Lucas R. undervote undervote undervote undervote DUUUU
452188 Auburn W2 DEM Ballot Style 24 Golden, Jared F. undervote undervote undervote undervote BUUUU
283078 Oakland W1 DEM Ballot Style 187 Golden, Jared F. Olson, Craig R. undervote undervote undervote BCUUU
107457 Milo DEM Ballot Style 21 St. Clair, Lucas R. Golden, Jared F. undervote undervote undervote DBUUU
107150 Greenville DEM Ballot Style 1 Golden, Jared F. undervote undervote undervote undervote BUUUU

\(~\)

Second district results can be reproduced using the administrative rules. Fewer ranks (5) avoid the rare pathologies found in the gubernatorial primary. In fact, the “tweaked” algorithm produces the same result as the official tabulation and the rules. First, using the administrative rules.

tab1 <- rcvr::conduct_runoff(d2_June)
df3 <- make_report2(tab1)

And now invoke the “tweaked” version.

tab2 <- rcvr::conduct_runoff(
  d2_June,
  sequentialU = TRUE,
  june2018    = TRUE)
df4 <- make_report2(tab2)
df  <- cbind(df3[,1:2], df4[,2], df3[,3], df4[,3])
June 2018 Maine CD2 Democratic Primary
Round 1
Round 2
Rules Reported Rules Reported
Candidate Names
Fulford, Jonathan S. 2489 2489 0 0
Golden, Jared F. 20987 20987 23611 23611
Olson, Craig R. 3993 3993 0 0
St. Clair, Lucas R. 17742 17742 19853 19853
Ballot Exhausted
By Overvotes 108 108 134 134
By Undervotes 5526 5526 7217 7217
By Exhausted Choices 0 0 30 30

3.3 November 2018 CD2 General Election

Use contest.R to construct a contest instance.

  d2_Nov <- rcvr::contest(
                      contest_name = "November 2018 Maine CD2 General Election",
                      original     = TRUE,
                      contest_str  = "d2_Nov",
                      creator      = "Ken Lane",
                      quietly      = TRUE)
  codes <- get_codes(d2_Nov)
Metadata: CD2 General Election
Item Value
Office Congressional District 2
Jurisdiction Maine
CVR location https://www.maine.gov/sos/cec/elec/results/2018
CVR file Nov18CVRExportFINAL1.xlsx
CVR file Nov18CVRExportFINAL2.xlsx
CVR file Nov18CVRExportFINAL3.xlsx
CVR file AUXCVRProofedCVR95RepCD2.xlsx
CVR file UOCAVA2CVRRepCD2.xlsx
CVR file UOCAVA-AUX-CVRRepCD2.xlsx
CVR file UOCAVA-FINALRepCD2.xlsx
CVR file RepCD2-8final.xlsx
Candidate Bond, Tiffany L.
Candidate DEM Golden, Jared F.
Candidate Hoar, William R.S.
Candidate REP Poliquin, Bruce
Number of Candidates 4
Number of Ranks 5
Number of Ballots 296077
  num_ballots <- attr(d2_Nov, "num_records")
  df <- as.data.frame(d2_Nov)
  df <- mutate(df, code = codes)
  knitr::kable(df[sample(1:num_ballots, 100, replace = FALSE),],
               row.names = FALSE,
               caption   = "100 Random Ballots: CD2 General Election") %>%
    kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
    scroll_box(width = "100%", height = "300px")
100 Random Ballots: CD2 General Election
id precinct style 1st 2nd 3rd 4th 5th code
373446 Poland W1 CAN Ballot Style 220 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
652500 Milbridge CAN Ballot Style 4 REP Poliquin, Bruce Bond, Tiffany L. undervote undervote undervote DAUUU
71926 Norridgewock CAN Ballot Style 187 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
656584 Wesley CAN Ballot Style 41 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
355601 Caribou/Connor CAN Ballot Style 82 DEM Golden, Jared F. Hoar, William R.S. Bond, Tiffany L. REP Poliquin, Bruce undervote BCADU
17774 Unity CAN Ballot Style 65 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. undervote REP Poliquin, Bruce BACUD
90771 Orrington CAN Ballot Style 211 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
57620 Madison W1 CAN Ballot Style 187 Bond, Tiffany L. undervote undervote undervote undervote AUUUU
122239 Millinocket CAN Ballot Style 118 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
644711 Detroit CAN Ballot Style 115 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
108557 Old Town/Argyle Twp CAN Ballot Style 208 DEM Golden, Jared F. Hoar, William R.S. Bond, Tiffany L. REP Poliquin, Bruce undervote BCADU
111149 Old Town/Argyle Twp CAN Ballot Style 208 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
628217 Eastbrook CAN Ballot Style 12 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
129745 Lisbon CAN Ballot Style 178 Bond, Tiffany L. Hoar, William R.S. undervote undervote undervote ACUUU
67650 Palmyra CAN Ballot Style 76 DEM Golden, Jared F. Hoar, William R.S. Bond, Tiffany L. REP Poliquin, Bruce REP Poliquin, Bruce BCADD
609910 Hammond CAN Ballot Style 106 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
48610 Otisfield CAN Ballot Style 213 REP Poliquin, Bruce Bond, Tiffany L. Hoar, William R.S. undervote undervote DACUU
29750 Lincolnville CAN Ballot Style 44 REP Poliquin, Bruce Hoar, William R.S. Bond, Tiffany L. undervote undervote DCAUU
99506 Oakland W1 CAN Ballot Style 205 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
314271 Castine CAN Ballot Style 88 REP Poliquin, Bruce Hoar, William R.S. Bond, Tiffany L. undervote DEM Golden, Jared F. DCAUB
398933 Auburn W4 CAN Ballot Style 23 DEM Golden, Jared F. REP Poliquin, Bruce Bond, Tiffany L. REP Poliquin, Bruce DEM Golden, Jared F. BDADB
359761 Caribou/Connor CAN Ballot Style 82 DEM Golden, Jared F. REP Poliquin, Bruce Bond, Tiffany L. Hoar, William R.S. DEM Golden, Jared F. BDACB
64071 Fairfield CAN Ballot Style 125 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
652268 Columbia Falls CAN Ballot Style 4 undervote undervote undervote undervote undervote UUUUU
46407 Belfast W1 CAN Ballot Style 42 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
96264 Orrington CAN Ballot Style 211 REP Poliquin, Bruce Bond, Tiffany L. Hoar, William R.S. undervote undervote DACUU
203506 Bangor W1 CAN Ballot Style 37 REP Poliquin, Bruce REP Poliquin, Bruce REP Poliquin, Bruce REP Poliquin, Bruce undervote DDDDU
415746 Livermore Falls CAN Ballot Style 180 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
202441 Bangor W1 CAN Ballot Style 35 DEM Golden, Jared F. REP Poliquin, Bruce undervote undervote undervote BDUUU
54623 Skowhegan CAN Ballot Style 257 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
661586 Monson CAN Ballot Style 1 REP Poliquin, Bruce Hoar, William R.S. DEM Golden, Jared F. Bond, Tiffany L. undervote DCBAU
651564 East Machias CAN Ballot Style 109 DEM Golden, Jared F. Hoar, William R.S. undervote undervote undervote BCUUU
626893 Brooksville CAN Ballot Style 64 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
624811 Chesterville CAN Ballot Style 97 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
657841 Charlotte CAN Ballot Style 32 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
660171 Cranberry Isles Ward 1 CAN Ballot Style 103 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
294635 Bar Harbor CAN Ballot Style 38 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
651583 East Machias CAN Ballot Style 109 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
251200 Paris CAN Ballot Style 216 Bond, Tiffany L. undervote undervote undervote undervote AUUUU
426263 Lewiston All CAN Ballot Style 164 REP Poliquin, Bruce REP Poliquin, Bruce REP Poliquin, Bruce Bond, Tiffany L. Bond, Tiffany L. DDDAA
625059 Chesterville CAN Ballot Style 97 REP Poliquin, Bruce DEM Golden, Jared F. Hoar, William R.S. Bond, Tiffany L. undervote DBCAU
466255 Gouldsboro CAN Ballot Style 139 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
281933 Wayne CAN Ballot Style 283 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
151908 Benton W1 CAN Ballot Style 5 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
284881 Ellsworth W4 CAN Ballot Style 122 Hoar, William R.S. DEM Golden, Jared F. Bond, Tiffany L. REP Poliquin, Bruce undervote CBADU
47462 Belfast W1 CAN Ballot Style 42 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
198195 Corinth CAN Ballot Style 101 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
440260 Auburn All CAN Ballot Style 27 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
351708 Limestone CAN Ballot Style 175 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
365076 Turner CAN Ballot Style 163 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
626535 Verona Island CAN Ballot Style 112 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
455687 Sullivan CAN Ballot Style 139 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
226891 Bangor W1 CAN Ballot Style 37 REP Poliquin, Bruce Bond, Tiffany L. Hoar, William R.S. DEM Golden, Jared F. undervote DACBU
11607 Brewer W1 CAN Ballot Style 60 overvote DEM Golden, Jared F. undervote undervote undervote OBUUU
8408 147111 UOCAVA DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
406627 Auburn W4 CAN Ballot Style 27 REP Poliquin, Bruce Bond, Tiffany L. Hoar, William R.S. DEM Golden, Jared F. undervote DACBU
631218 Hartford CAN Ballot Style 148 REP Poliquin, Bruce REP Poliquin, Bruce REP Poliquin, Bruce REP Poliquin, Bruce REP Poliquin, Bruce DDDDD
434031 Durham CAN Ballot Style 117 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
300089 Bar Harbor CAN Ballot Style 38 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
244975 Rumford CAN Ballot Style 191 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
351349 Fort Kent CAN Ballot Style 51 DEM Golden, Jared F. REP Poliquin, Bruce Bond, Tiffany L. Hoar, William R.S. undervote BDACU
10322 Lubec CAN Ballot Style 109 DEM Golden, Jared F. Hoar, William R.S. undervote undervote undervote BCUUU
659123 Washburn CAN Ballot Style 89 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
279178 Monmouth W1 CAN Ballot Style 194 Bond, Tiffany L. DEM Golden, Jared F. Hoar, William R.S. undervote REP Poliquin, Bruce ABCUD
54938 Skowhegan CAN Ballot Style 257 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
616373 Greene CAN Ballot Style 144 DEM Golden, Jared F. REP Poliquin, Bruce undervote undervote undervote BDUUU
646290 Jackson CAN Ballot Style 65 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
252067 Paris CAN Ballot Style 216 DEM Golden, Jared F. Hoar, William R.S. undervote undervote undervote BCUUU
617635 Greene CAN Ballot Style 144 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. undervote REP Poliquin, Bruce BACUD
631666 Stow CAN Ballot Style 3 REP Poliquin, Bruce Bond, Tiffany L. Hoar, William R.S. DEM Golden, Jared F. undervote DACBU
190838 Eddington CAN Ballot Style 61 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
206868 Charleston CAN Ballot Style 93 DEM Golden, Jared F. Hoar, William R.S. Bond, Tiffany L. undervote REP Poliquin, Bruce BCAUD
629779 Roxbury CAN Ballot Style 191 REP Poliquin, Bruce Bond, Tiffany L. Hoar, William R.S. DEM Golden, Jared F. undervote DACBU
34688 Clinton CAN Ballot Style 99 DEM Golden, Jared F. DEM Golden, Jared F. Bond, Tiffany L. DEM Golden, Jared F. Hoar, William R.S. BBABC
237275 West Paris CAN Ballot Style 288 REP Poliquin, Bruce DEM Golden, Jared F. undervote undervote undervote DBUUU
337258 Presque Isle W1 CAN Ballot Style 237 DEM Golden, Jared F. REP Poliquin, Bruce Hoar, William R.S. Bond, Tiffany L. undervote BDCAU
26850 Searsmont CAN Ballot Style 172 REP Poliquin, Bruce Hoar, William R.S. undervote undervote undervote DCUUU
109468 Old Town/Argyle Twp CAN Ballot Style 208 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. undervote undervote BACUU
274264 Monmouth W1 CAN Ballot Style 194 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. undervote undervote BACUU
83900 Dover-Foxcroft CAN Ballot Style 21 DEM Golden, Jared F. Hoar, William R.S. undervote Bond, Tiffany L. REP Poliquin, Bruce BCUAD
25865 Palermo CAN Ballot Style 172 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
647193 Thorndike CAN Ballot Style 65 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
8720 Machias CAN Ballot Style 109 DEM Golden, Jared F. Hoar, William R.S. Bond, Tiffany L. REP Poliquin, Bruce undervote BCADU
355983 Caribou/Connor CAN Ballot Style 82 REP Poliquin, Bruce Bond, Tiffany L. DEM Golden, Jared F. Hoar, William R.S. undervote DABCU
110770 Old Town/Argyle Twp CAN Ballot Style 208 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. undervote undervote BACUU
184612 Bangor W1 CAN Ballot Style 34 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
366969 Turner CAN Ballot Style 163 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
20514 Stockton Springs CAN Ballot Style 239 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. undervote undervote BACUU
655186 Whiting CAN Ballot Style 109 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
27475 Searsmont CAN Ballot Style 172 undervote undervote undervote undervote undervote UUUUU
180075 Hampden CAN Ballot Style 147 REP Poliquin, Bruce DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. undervote DBACU
240912 Norway CAN Ballot Style 203 REP Poliquin, Bruce Hoar, William R.S. Bond, Tiffany L. DEM Golden, Jared F. undervote DCABU
37621 Islesboro CAN Ballot Style 156 Bond, Tiffany L. Hoar, William R.S. DEM Golden, Jared F. REP Poliquin, Bruce undervote ACBDU
638455 Guilford CAN Ballot Style 1 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
62026 Fairfield CAN Ballot Style 125 DEM Golden, Jared F. undervote undervote undervote undervote BUUUU
658675 West Gardiner CAN Ballot Style 287 undervote undervote undervote undervote REP Poliquin, Bruce UUUUD
96675 Orono All CAN Ballot Style 209 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU
241177 Norway CAN Ballot Style 203 REP Poliquin, Bruce undervote undervote undervote undervote DUUUU
111272 Old Town/Argyle Twp CAN Ballot Style 208 REP Poliquin, Bruce Hoar, William R.S. Bond, Tiffany L. DEM Golden, Jared F. undervote DCABU
325162 Farmington CAN Ballot Style 129 DEM Golden, Jared F. Bond, Tiffany L. Hoar, William R.S. REP Poliquin, Bruce undervote BACDU

\(~\)

Tabulations using the administrative rules agree with official results see here.

tab <- rcvr::conduct_runoff(d2_Nov)
df  <- make_report2(tab)
November 2018 Maine CD2 General Election
Round 1 Round 2
Candidate Names
Bond, Tiffany L. 16552 0
DEM Golden, Jared F. 132013 142440
Hoar, William R.S. 6875 0
REP Poliquin, Bruce 134184 138931
Ballot Exhausted
By Overvotes 435 533
By Undervotes 6018 13838
By Exhausted Choices 0 335

4 Session Information

  xfun::session_info(dependencies = FALSE)
## R version 3.6.3 (2020-02-29)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19041)
## 
## Locale:
##   LC_COLLATE=English_United States.1252 
##   LC_CTYPE=English_United States.1252   
##   LC_MONETARY=English_United States.1252
##   LC_NUMERIC=C                          
##   LC_TIME=English_United States.1252    
## 
## Package version:
##   rcvr_0.1.0        kableExtra_1.3.4  forcats_0.5.1     stringr_1.4.0    
##   dplyr_1.0.5       purrr_0.3.4       readr_1.4.0       tidyr_1.1.3      
##   tibble_3.1.0      ggplot2_3.3.3     tidyverse_1.3.0   plyr_1.8.6       
##   Rcpp_1.0.6        svglite_2.0.0     lubridate_1.7.10  assertthat_0.2.1 
##   digest_0.6.27     utf8_1.2.1        R6_2.5.0          cellranger_1.1.0 
##   backports_1.2.1   reprex_1.0.0      evaluate_0.14     httr_1.4.2       
##   highr_0.8         pillar_1.5.1      rlang_0.4.10      readxl_1.3.1     
##   rstudioapi_0.13   jquerylib_0.1.3   rmarkdown_2.7     webshot_0.5.2    
##   munsell_0.5.0     broom_0.7.5       compiler_3.6.3    modelr_0.1.8     
##   xfun_0.22         pkgconfig_2.0.3   systemfonts_1.0.1 htmltools_0.5.1.1
##   tidyselect_1.1.0  fansi_0.4.2       viridisLite_0.3.0 crayon_1.4.1     
##   dbplyr_2.1.0      withr_2.4.1       grid_3.6.3        jsonlite_1.7.2   
##   gtable_0.3.0      lifecycle_1.0.0   DBI_1.1.1         magrittr_2.0.1   
##   scales_1.1.1      cli_2.3.1         stringi_1.5.3     fs_1.5.0         
##   xml2_1.3.2        bslib_0.2.4       ellipsis_0.3.1    generics_0.1.0   
##   vctrs_0.3.7       tools_3.6.3       glue_1.4.2        hms_1.0.0        
##   yaml_2.2.1        colorspace_2.0-0  rvest_1.0.0       knitr_1.31       
##   haven_2.3.1       sass_0.3.1

Bibliography

Commission, United States Election Assistance. 2019a. “Draft Recommendations for Requirements for the Voluntary Voting System Guidelines 2.0.” September 9, 2019. https://collaborate.nist.gov/voting/pub/Voting/VVSG20DraftRequirements/vvsg-2.0-2019-09-09-DRAFT-requirements.pdf.
———. 2019b. “Voluntary Voting System Guidelines.” September 9, 2019. https://www.eac.gov/voting-equipment/voluntary-voting-system-guidelines.
Commission, US Election Assistance. 2015. EAC Voting System Testing and Certification Program Manual, Version 2.0. https://www.eac.gov/assets/1/28/Cert.Manual.4.1.15.FINAL.pdf.
Elections, Division of. 2018. “29-250 Code of Maine Rules Chapter 535: Rules Governing the Administration of Election Determined by Ranked-Choice Voting.” State of Maine Office of the Secretary of State, Bureau of Corporations. November 2, 2018. https://www.maine.gov/sos/cec/rules/29/250/250c535.docx.
Legislature, 129th State of Maine. n.d. “21-a § 723-a Determination of Winner in Election for an Office Elected by Ranked-Choice Voting.” Accessed December 18, 2019. http://www.mainelegislature.org/legis/statutes/21-A/title21-Asec723-A.html.
Maine Office of Secretary of State, State of. n.d. “Election Results.” Accessed December 20, 2019. https://www.maine.gov/sos/cec/elec/results/index.html.
Mistler, Steve. 2018a. “In Tight Race, Maine Republican Sues to Block State’s Ranked-Choice Voting Law.” National Public Radio. November 13, 2018. https://www.npr.org/2018/11/13/667435326/facing-defeat-maine-republican-sues-to-block-states-ranked-choice-voting-law.
———. 2018b. “’It’s Just Math’ — Mainers Recreate Ranked-Choice Voting Results to Test the Process,” December. https://www.mainepublic.org/post/its-just-math-mainers-recreate-ranked-choice-voting-results-test-process.
Muszynski, Kristen Schulze. 2018. “Explanation of Cd2 Final Tabulation,” November. https://www.maine.gov/sos/news/2018/explanation-cd2-final-tablulation.html.
Taylor, Kate, and Liam Stack. 2018. “Maine’s Bruce Poliquin, Lone Republican in House from New England, Loses Re-Election.” New York Times, November. https://www.nytimes.com/2018/11/15/us/politics/poliquin-maine-loses.html.

  1. kableExtra loaded soley to render this document and is not needed by Recievor.↩︎

  2. See contest() manual page here.↩︎

  3. See clean_cvr_alternatives() manual page here and standardize_rankings here.↩︎

  4. See manual page for conduct_runoff() here.↩︎

  5. Tweaking implemented in tabulate_cvr_rank(). See manual page here.↩︎

  6. Personal communication with Nathan Tefft. See his python implementation here.↩︎