This method does something that I think is entirely new: it determines the quality of its output based solely on an input parameter. The higher the number, the better quality. Note that if you supply the value 0, it will simply give you plurality winner. A value of 1 gives you IRV. 2 and above are where the new stuff kicks in. The higher the value, the more processing is necessary, (exponentially) so after 4 or 5 it may get pretty impractical, depending on number of voters and especially number of candidates.

**Background:** (simple explanation of IRV, for comparison)

IRV improves upon plurality (i.e., a count of first choice votes) with a form of iterative refinement. It still uses plurality, but in a "process of elimination" loop, giving better results.... results that, among other things, reduce vote splitting and the incentive for voters to vote strategically.

**The new method:**

Recursive IRV is a way of continuing this process of refinement by doing an inner process of elimination, in order to determine which candidate to eliminate in the outer process of elimination. So instead of using plurality to determine the "bad candidates" to eliminate, it uses plurality to determine the "good candidates" to eliminate from the determination of which are "bad candidates," and therefore to be eliminated.

To the degree that IRV improves upon plurality, this method can improve upon IRV.

**and by extension....**

There is no limit to the depth that we can descend, other than computer power. The more we descend, the more we dilute the impact of it being based on plurality. This in turn reduces the voter's incentive to strategically vote (such as by exaggerating differences between perceived front-runners).

Each time we descend another level, it alternates between using plurality and "anti-plurality" in the innermost loop, the latter finding bad candidates rather than good candidates.

The elimination process, when eliminating good candidates, will look a bit different from the process when eliminating bad candidates. Most of the changes happen at the beginning of the elimination process rather than toward the end, since the popular candidates will be eliminated first, sending large numbers of votes to other candidates. This is perfectly fine, but just different.

A by-product of this process is that the method will be Condorcet compliant, which regular IRV is not. But again, it goes beyond that, continuing to improve the quality of the results even when no candidate is a Condorcet winner. It is to be seen if this improves the results indefinitely, but it's a good bet that it keeps getting better at each recursion depth.

**Arrow's theorem**

This may be a way to effectively get around Arrow's theorem, which proves we can never completely get rid of this strategic incentive. Remember, there is nothing in the theorem that proves that we can't continue to reduce that incentive. closer and closer to being non-existent. Other voting methods, such as Schulze Sequential Dropping, attempt to do so with increasingly complex logic, that is hard to explain, hard to put into programming code, and hard to put into legal code. This one keeps the explanation and code relatively simple, and determines the degree of refinement simply by setting a parameter, the recursion depth.

That's not to say it is yet proven that it eliminates all strategic considerations, even at the hypothetical infinite recursion. (I'm going to need some other minds on that project. @Andy-Dienes? )

**As a way of bringing together competing camps of the voting reform community**

Here is possibly the real value of the method. Not so much in actually being a practical method for public elections, but as an academic exercise in service of an important persuasive argument.

For instance, there is a certain value to this as a way to convince IRV fans that IRV can be made Condorcet compliant, without doing anything beyond applying "more IRV." Those who are in love with IRV might be convinced that this (and Condorcet methods in general) is simply "more of a good thing."

Meanwhile, Condorcet fans might see this and change their perception of IRV: rather than thinking it is a irreparably flawed mechanism, they can think of it as a good mechanism that just isn't applied strongly enough.

**The CodePen:**

This is a work in progress. https://codepen.io/karmatics/pen/PoRvYaX

It needs better output. But you can see (if you look carefully) that it gets the "right results" for Burlington 2009.

This one has more readable output, but it hard coded to a depth of 2. (the first one will eventually be able to just set a parameter for recursion depth....needs a bit more work) https://codepen.io/karmatics/pen/bGvZKqP

]]>I just wouldn't consider Reverse STAR an IRV variant, really. Reverse STAR is two stage, but I can't see how you can extend that much further. Short of doing what I suggested above, use IRV recursion, but when it gets to maximum depth, using Score rather than Plurality. As I mentioned, I think that would converge to the same results as using plurality at final stage.

]]>Short of a formal proof, we could try some examples and see whether they conform to your hypothesis that the variants and recursive Hare converge to the same results.

]]>Recursion could also be applied to other IRV variants.

Which IRV variants? Just curious.

The algorithm I currently have could work with various differences, such as instead of doing plurality as the last step, it does something like Score or Borda count. Or considering that the winner is the one with the least last place votes.

My hypothesis, far from proven, is that they would all converge to the same result. If that were actually proven, that would be pretty notable, I'd think.

]]>Sorry for being so bothersome.

Not at all, I appreciate your taking an interest.

Do you know any programming language? I think the JS implementation is quite nice and clean, as is most of ChatGPTs stuff. It is cleaner than if I wrote it directly, unless I had put a huge amount of effort in. However, if you know python or whatever, I can ask chatGPT to produce a python version. It's quite good at that.

The code could be simplified if I removed the part where it passes back data so we can show a big nested json structure as output. If all you want is a winner, the code would possibly be easier to read, but not easier to follow by running a CodePen since there'd be no output of "process"

That said, the easiest way to follow it is to follow the chatgpt conversation as I prompted it to build it. Not only can you see what I asked it in plain English, it explains the code in plain English.

Do you at least get the main idea? Let me try to put my thoughts into a logical series of statements, starting with the most simple and obvious.

Plurality can be applied to ranked ballots. That is, you can count the first place votes and ignore all the rest.

Plurality voting can be used to find either a "good candidate", or a "bad candidate". The best candidate is defined as having the most first choice votes. The worst is defined as having the fewest first choice votes. (ties are possible and need to be accounted for, but for the rest of this we'll ignore them)

Plurality logic is used within IRV. In this case, it looks for bad candidates, since it needs to eliminate these candidates. So regular IRV could be said to eliminate plurality losers.

IRV can be used to find a bad candidate, just as plurality can. To do this, we eliminate good candidates (plurality winners) one by one. So both Plurality voting, and IRV voting, are able to produce an inverse result (i.e. "loser")

Given that IRV can produce an inverse result, it can be substituted for Plurality within IRV logic. So we can produce a recursive IRV, that calls inverse IRV, to determine who to eliminate. That IRV election, though, calls into Plurality to produce its result. This is one level of recursion.

And we can continue doing this to any depth. If the depth is an odd number (1 being normal IRV, 2 being the above described first level of recursion), it will always use inverse plurality. If the depth is even, it will use regular plurality. (notice that there doesn't appear to be any different results with odd vs even recursion depth. It just seems to get more accurate at greater depth)

Let me know if any of this helps, or if you want me to try to put it in another language or form.

]]>While my current implementation is javascript, I didn't "write" it so much as prompted ChatGPT to write it, and since I did it very step by step, it should be easy to follow.

Here is the chatGPT conversation: https://sharegpt.com/c/fyOiNHy

It didn't make any mistakes, so it is pretty easy to follow, but I was careful in terms of prompting it to do one thing at a time.

Here is the codepen: https://codepen.io/karmatics/pen/KKxeEEJ?editors=1010

First I asked ChatGPT to parse ranked ballots and put them into a reasonable data structure. Then I had it so it could clone that data structure and remove a candidate (from the list of candidates as well as from the ballots), to allow for elimination.

Then I made a function "doPlurality" to do a plurality calculation on that, and return the winner(s) in an array (in case of tie it can be more than one). Then I had that function be able to do it inverted, to find the plurality loser.

Then I had it make a function "doIRV": to do an IRV tabulation on it, which in turn calls the "doPlurality" function multiple times, inverted so it picks the loser so that candidate can be eliminated.

Then I made sure doIRV could be inverted itself.

Finally, I made doIRV so it can recurse to a given depth, which means that, instead of calling doPlurality to find candidates to eliminate, it calls doIRV. (until it reaches the specified depth, when it will call doPlurality) Whether calling doIRV or doPlurality, it always reverses the "findLoser" flag from that sent to the containing function. (you want it to look for "bad" candidates to eliminate, but look for "good" candidates to eliminate from being eliminated, and so on)

I'm not sure what you are looking for as far as a formal definition, but if you need something else please let me know. Between my chatGPT prompts, the actual code, and the running app on CodePen it should be pretty concisely defined.

It would be awesome if you were able to do some kind of proof or at least an analysis.

]]>@jack-waugh said in Recursive IRV:

I wonder whether it can be proven that adding more and more layers of recursion eventually converges on a fixed outcome, for any given set of ballots.

I'd love to see it proven. It seems to me that it is obviously true, but it is beyond my capabilities to actually prove it. Currently I am relying on intuition as well as just testing it on sample data.

I could try to prove it, but I might need a more formal definition of the method for it. If possible not in JavaScript

]]>I wonder whether it can be proven that adding more and more layers of recursion eventually converges on a fixed outcome, for any given set of ballots.

I'd love to see it proven. It seems to me that it is obviously true, but it is beyond my capabilities to actually prove it. Currently I am relying on intuition as well as just testing it on sample data.

]]>a vs. b: no winner.

```
a vs. c: no winner.
c vs. b: no winner.
```

-|

]]>Just imagine you have two voters and three candidates with preferences a>b>c and c>b>a. Wouldn't this method delete b in the first step which was the condorcet winner?

It might, but I don't consider that a good example since to me it is (or should be) a three way tie.

If you have a case where there are no pairwise ties, and there is a Condorcet winner which it misses, I'd be interested in seeing it.

]]>The ones that are not "engineered" use connectionism and/or Darwinism, but techniques like that are not relevant here. Before people tried those, they were engineering the solution, i. e. designing it top to bottom by hand.

]]>Look at it this way. What IRV attempts to do, prior to doing the final calculation (i.e. "determine who is preferred by more people"), is to remove irrelevant alternatives so the calculation is not affected by them. But it does the elimination rather crudely, based on "negative plurality". (least first choice votes)

This just takes it to another level, using the same logic for the elimination as it does for the final determination. As you go to further and further recursion depths, this should get more and more accurate, as the "crude part" is less and less relevant.

My general hypothesis is that Condorcet compliance is simply an easy to define step on the way to our goal of "immune to vote splitting." IRV logic is obviously closer to this goal than plurality, but since it can result in missing the Condorcet winner, it isn't very far toward the goal. Applying the logic twice appears to make it Condorcet compliant. Applying it 3 or more times moves it ever closer to the goal.

Since it is technically impossible to apply it an infinite number of times, this doesn't violate Arrow's theorem (and the like).

]]>Hare to the zeroth power is choose-one plurality.

Hare to the first power is Hare.

Hare squared does about (n - 1)(n - 1)/2 rounds, concerned with promotion of candidates rather than elimination of them.

I have three candidates and want to get down to two. Whom do I promote first? It's a tie between a and c. I have to appeal to @rob for tiebreaking rules, or make up my own.

Can you give an example that doesn't tie at any stage?

]]>```
doEliminationLoop = (candidates, ballotsExp, isNegative) => {
var results = {
rounds: []
};
var numCandidates = candidates.length;
for(var i=0; i<numCandidates; i++) {
var candidatesSorted = // (depth>0) ?
//sortedCandidatesByEliminationRounds(candidates, ballotsExp, true, 1) :
sortedCandidatesByFirstPlaceVotes(candidates, ballotsExp);
console.log(depth + " " + isNegative)
console.log(JSON.stringify(candidatesSorted,0,2))
var toBeEliminated = candidatesSorted[(isNegative)?0:candidatesSorted.length-1];
results.rounds.push(candidatesSorted);
//setValue('output_2', JSON.stringify(candidatesSorted,0,2))
// maybe use Array.filter?
candidates = []; // rebuild array without winner
for(var j=0; j<candidatesSorted.length; j++) {
if(candidatesSorted[j].name != toBeEliminated.name) {
candidates.push(candidatesSorted[j].name);
}
}
}
results.winner = results.rounds[results.rounds.length-1][0]
return results
}
```

His condition on `isNegative`

is key here. He's sorting the candidates the same way, based on top rankings, but he's picking whom to eliminate from the list from either the top or the bottom of the list.

Now I am fully confused. Would you be able to give a complete (and self-contained) description of the rule? (Pseudocode would also work)

]]>I have not checked @rob's assertion that just one level of recursion will make the system comply with Condorcet.

]]>@rob means he wants to apply the Hare method recursively. A given incarnation of the method might put a fixed limit on the depth of recursion. The bottom will just use Hare. If not at the bottom, conduct an IRV election among the remaining candidates to decide which one to eliminate from the list for the subsequent round of tallying.

I am still not sure if I fully understand. "If not at the bottom, conduct an IRV election among the remaining candidates to decide which one to eliminate from the list for the subsequent round of tallying." This doesnt really make sense to me. Wouldnt this just eliminate a candidate with lowest plurality score?

]]>@rob means he wants to apply the Hare method recursively. A given specification of the recursive method might put a fixed limit on the depth of recursion. The bottom will just use Hare. If not at the bottom, conduct an IRV election among the remaining candidates to decide which one to eliminate from the list for the subsequent round of tallying.

]]>