Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Ranked Choice Voting - Relative Choice Voting - Binary Search - Binary Sort

  1. #1
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default Ranked Choice Voting - Relative Choice Voting - Binary Search - Binary Sort

    Have you ever been in a situation where you had to vote for class president, and you have to choose between your two best friends. Your best friends gets 15 votes each, including the votes from other class members. However, a bully gets 16 votes and becomes class president. You consider and believed that if only one of your best friends were running, then that one would have gotten a sum of 30 votes (15+15) and win by a landslide. This is a problem with the algorithm used in voting.


    What does Binary Search and Binary Sort have in common. They are all based on two values being compared.

    Binary Search

    If you have a list of 1000 words in alphabetic order, and within it, there is the word "house". You are tasked to search for the exact index of that word. You could use a binary search. The algorithm compares at the middle of the list. Eg the middle has "dog" thus "house" must be in the second half of the list. The second half of the list has 500 words and that is now the new sub list the algo is interested in. Then the algo compares the middle of that sub list and finds "roof" so it knows which half of the sub list to look at. A smaller list of 250 words.
    The algo will logically divide the list of interest into two sub list, and so on until it ends when it finds the word. As you can see it does not look at all the words, just a few words and the sub list of interest get exponentially smaller.

    Rough Index is also a powerful algo. It is not memory feasible to have a perfect index stored for every word given the size of the initial list. (You have to strike a balance between the amount of rough indices and the list size) However you can have a rough index for where B words start, and C words, D words and so on. This gives a total of 26 rough indices. (Rough indices of AA, AB, AC, AD words would give 26x26 index size so a optimal balance is suggested or else you can have an indices size greater than the initial list size).

    The binary search can be combined with rough index to provide an even more powerful and quicker search because only the sub list from the H index to the I index would be of interest to the binary search input.


    Binary Sort

    Please see this wonderful video. The idea is to sort a list of numbers from smallest to largest. The list is logically broken down to element components. A sub list of element one. Also that element 1 sub list is also a sorted list. Two smaller sorted list are then combined to form a bigger sorted list. This is relatively easy to do. In your head, think of the steps to combine in order 4,9,11,20 and 2,6,31. It is basically the reverse of binary search. You start with 1000 numbers which means 1000 small sorted list. The algo runs and you have 500 two element sorted lists, then 250 four element sorted list and so on, until 1 1000 element sorted list.

    P vs. NP - The Biggest Unsolved Problem in Computer Science - by Up and Atom
    (video starts at 8:30 with sorting algos but an interesting watch from beginning)



    For the problem at the top and the video below, I propose Relative Choice Voting and it uses the input of Rank Choice Voting. Rel CV is my upgrade to Rank CV. I believe it to be better in selecting what people really want. I will try to run an app and demonstrate some examples and put in any binary search or sort optimizations if encountered.



    Rank Choice Voting



    More vids:
    What Is Rank Choice Voting? | NBC News Now

    Can Ranked-Choice Voting Change U.S. Elections?


    Relative Choice Voting

    Let's say that there are 6 candidates (1-6). Voters indicate a prioritized list. Eg
    1,4,2
    6,5,1,4,3,2
    4
    3,6,2,1
    5,4, , ,3
    1,1,1,1,1,1 (it does not matter as it is the same as just 1)
    5,4,6

    This is all the voter has to do. (It is even simpler if there are 4 candidates) The algorithm does all the work.
    One vote, one increment. Foundation.
    If you don't have a vote then you don't have a chance. Foundation.

    The algo compares all 6 candidates, but two at a time in all combinations, and registers the relative votes.

    The algo compares two candidates. Let's say, candidates 1 and 2. The algo uses the priority vote lists.
    In the above when a "1" is present (first occurrence) and there is no "2" in front it, then a vote is counted towards candidate 1. Also when there is a 2 present and no 1 is present before it, then a vote is counted for candidate 2. Then the relative weight of "1" to "2" is the simple difference of their votes.
    Thus {1,4,2} {6,5,1,4,3,2} {1,1,1,1,1,1} count as three votes for candidate 1
    And {3,6,2,1} counts as a vote for candidate 2. Thus candidate 1 is more commonly desired relative to candidate 2
    (3 votes take away 1 vote gives a relative weight of +2 for candidate "1" vs "2")

    The algo then goes to the next possible selection, "1" and "3" using the same criteria above.
    {1,4,2} {6,5,1,4,3,2} {1,1,1,1,1,1} counts as three votes for candidate 1
    and
    {3,6,2,1} {5,4, , ,3} counts as two votes for candidate 3
    (3 votes take away 2 votes gives a relative weight of +1 for candidate "1" vs "3")

    The algo then goes to the next possible selection, "1" and "4" using the same criteria above.
    (4 votes take away 3 votes gives a relative weight of +1 for candidate "1" vs "4")

    After each selection of two candidates are compared to give relative weights, then each candidate's total weight is the sum from all selections that include that candidate.
    For example,
    the total relative weights for candidate "1" is the sum of the relative weights of "1" vs "2", "1" vs "3", "1" vs "4", "1" vs "5" and "1" vs "6".
    For example,
    the total relative weights for candidate "2" is the sum of the relative weights of "2" vs "1", "2" vs "3", "2" vs "4", "2" vs "5" and "2" vs "6".
    (Note: the relative weight of "2" vs "1" is just minus of "1" vs "2")
    The candidate with the greatest sum would be the victor.


    Relative Choice Voting - Another Example

    Please take a look at the video above. (Remember that Relative Choice Voting is an upgrade to Ranked Choice Voting)
    Candidates are N, W, E, and S
    Ranked votes are:
    26 x N,S,E,W (ie 26 people choose N as 1st choice, S as 2nd choice, E as 3rd choice, and W as last choice)
    15 x S,E,N,W
    17 x E,S,N,W
    42 x W,N,S,E

    All possible selection of two candidates are:
    N vs W
    N vs E
    N vs S
    W vs E
    W vs S
    E vs S

    Relative weights are:
    N vs W = 26 + 15 + 17 - 42 = 16
    N vs E = 26 - 15 - 17 + 42 = 36
    N vs S = 26 - 15 - 17 + 42 = 36
    W vs E = -26 - 15 - 17 + 42 = -16
    W vs S = -26 - 15 - 17 + 42 = -16
    E vs S = -26 - 15 + 17 - 42 = - 66

    Total relative weights for each candidates:
    N = 16 + 36 + 36 = 88
    W = -16 - 16 - 16 = -48
    E = -36 + 16 - 66 = -86
    S = -36 + 16 + 66 = 46

    N wins, followed by S, followed by W, and the least favorite to the whole is E

    Judge for yourself if that should be the correct output


    Relative Choice Voting - A Simple Explanation

    Imagine four candidates A, B, C, and D. Visualize them as vertices on a shape such as a pyramid.

    Relative weights were calculated and let them be, for example:
    AB = 6
    AC = 4
    AD = -2
    BC = 3
    BD = -5
    CD = 1

    Since A, B, C, D are points of a pyramid, we can create a rule that AB means that B is displaced by the amount relative to A, and B's displacement relative to C and D is not affected. If AB was negative then A would be displaced while B remains.

    Moving the loosing point is just half the pictures.

    The above would give total displacement (losses) as:
    A=2
    B=11
    C=7
    D=1
    If smaller is better, then D wins (This is half of the picture)
    We can say that D wins because it was barely moved

    Consider the pyramid again. Let's us say that AB gives it amount to a safe position of A relative to B. C and D not affected. A is displaced if the amount is positive, and B remains.
    Moving the winning point is the other half of the picture.

    The same relative weights above now would give a total displacement (wins) as
    A=10
    B=3
    C=1
    D=7
    If larger is better, then A wins (This is other half of the picture)
    We can say that A wins because it moved the most

    The correct algorithm is to add both halves of the picture (losses and wins)
    A = 10-2 = 8
    B = 3-11 = -8
    C = 1-7 = -6
    D = 7-1 = 6

    A seems to be the real victor given the relative weights at the beginning.

    This is the simple sum of all the relative weights of AB AC and AD = 6 + 4 -2 = 8
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  2. #2
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default Relative Choice Voting - No flaws so far

    Relative Choice Voting - No flaws so far

    Does not have the problems of Plurality voting.

    More accurate that Rank Choice Voting/Instant Runoff Voting as it is an upgrade to the algorithm.

    Is not affected by the rounds of the voting in Multiple Round Voting as all selection of candidates are used. It also does not matter the order which it goes through them.

    Carries more metrics that Condorcet Voting. It does not just records that N wins over E, but also by how many votes.

    Also, the same extra metric (which is a metric that I believe must be include as requirements of the foundation) would not easy deadlock if voters prefer A over B, B over C, and C over A, as the metrics for each would likely be different. eg number of voters who prefer A over B may likely not equal number of voters who prefer B over C (See video above)

    To be honest, I cant research all the methods of voting to see if Relative Choice Voting was implemented before under a different name, but in any case I endorse it under whatever name.



    Voting system can encounter the issue of a Tie. Some voting systems may use a Tie Breaker. Eg, flip a coin, or most loving to people, etc
    This algorithm will output all winners with the maximum sum, and thus any ties.

    If you don't have a vote then you don't have a chance, thus vote. Be allowed to vote.

    Some criteria to research:
    Mutual Majority
    Monotonicity
    Later No Harm
    Independence of Irrelevant Alternatives
    Participation
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  3. #3
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    I had to read it twice to figure out that this was more about politics that actual programming. Personally this would only complicate the voting process for people who have been trying to reduce its variables for years. Politics is not interested in a fair vote. its wants a decisive vote.

  4. #4
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Quote Originally Posted by owen View Post
    I had to read it twice to figure out that this was more about politics that actual programming. Personally this would only complicate the voting process for people who have been trying to reduce its variables for years. Politics is not interested in a fair vote. its wants a decisive vote.
    It is still a work in progress. Mostly needs testing and research into voting criteria. That being said, it was argued in the video that a flawless voting system could not be created because of inherent defects. I am contesting that idea with the mathematics that I used in my solution.

    Whether there was political intent in it being said to be impossible, and in my response that it may be possible, it still does not affect the nature or accuracy of the algorithm.

    Even if a perfect vote system may not be achievable, I believe such a system can be improved. Make better until ... one day perhaps next to Perfect!
    For example, an App could be used for voting to make it easier, but it would be susceptible to hacking and identity fraud (depending on the type of electronic security used). Such a design would be not advised under those circumstances. However, if you have secure electronic booths, that you enter with a government id via scanning, then inside you have a touch screen interface, and you pick and choose, one candidate alone, or a rank set, at your ease and pleasure. Then it can't be all that more complicated than what we are used to in 'ticking' paper of two choices and have your little finger dipped in ink. Then the back end software count the votes. (The software send the raw input to two pc at different location. At the end there checksum should be the same for each pol booth)

    This voting algorithm does not have to be used in government politics alone. It can be used in web polls. We have seen polls where a vlogger may ask for a poll to know what is the best topic that viewers want to see. Now this is the beauty of the algo (if it really passes all the test). Remember, polls normally have multiple choices, lets say 4. And often two of the choices are close for a significant amount of viewers. This makes the more irrelevant choices seem closer to the popular choices because of the way interested viewers' votes are divided. It would be more accurate if you care about two topics then you could click A then B or B then A (If you do not care about the other topics then you do not have to click them. If it is one topic you are interested in then you click that one topic) When the vlogger release a video on the improved algorithm, then they may statistically have more views or likes because of the selection of that topic. This is as much mathematical brilliance, as it can be politics.

    The algorithm is as decisive (with any number of parties, two or more) as the common two party only voting algorithm. Also as accurate. But its accuracy is kept in 3 or more parties.

    People who are inherently unfair will not want a fair voting algorithm. This is fact. They may pretend like they want it, to style and trick people, but they genuine don't want things that are fair. Anyways I offer this algorithm to fair people. Be reminded that it is in the testing phase.

    (And I will try to do the coding set forth)
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  5. #5
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Thinking of a situation where this algorithm is more decisive.

    Let's say the vlogger has:
    50 votes for A only
    and 50 votes for B then A.
    Then this would be a tie in normal polling as well as in this algorithm

    Now let's say the vlogger has:
    50 votes for A only
    and 50 votes for B then A.
    and 1 vote for C then A.
    Then this would be a tie in normal polling but A would win in this algorithm

    The analogy of uses more metrics in the voting process is like using decimal places in money. Less likely to have ties, eg $1 not equal $1.01
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  6. #6
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Uploaded code in:
    https://anonymousfiles.io/1lr0EO0a/
    rar md5 hash 487bcda9f723d2a29594ae8e54742e05

    Still a work in progress

    Of the voting criteria listed:

    I am still researching if any are violated.


    An interesting case is:
    Four candidates A B C D.
    50 people vote for A then C, and 50 people vote for B then C
    C is winner. Does this feel like it satisfies the majority.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  7. #7
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Remember that if you do not have a vote then you do not have a chance.

    If you vote for A then C, then C would be your second choice. If you do not have any other choice the just vote A only.

    Consider a mother who is deciding on what to make for the children. Children will eat the food only if they like it. Some children like Ackee (A) then Chicken (C). Some children only want Beef (B) then Chicken (C). The mother only can cook one food Ackee, Beef or Chicken. What would be the best choice for the mother?
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  8. #8
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    The problem is not the actual voting mechanism but the perception of the out come. The mechanism will work but no one will implement it because it adds complication to the process. Fairness is relative to the education of the participants. It does not matter if the output is technically fair if no one believes that its fair.

    Btw that C# code is verbose asf even for such a simple prototype.

  9. #9
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Quote Originally Posted by owen View Post
    The mechanism will work but no one will implement it because it adds complication to the process.
    It adds complication!? It removes the complication of merging different meals into just 2 meal options, by letting voters decide.

    Lets say a mother has 9 meals she can prepare. She has 12 children. She will only cook one meal. It is more work for her to splice off attribute of the 9 meals down to a 2 meal option (ie she chooses which two meals has the attributes of all the meals). Then let the children vote from just those two meals. When she could skip all that, give the children an app on her phone, they pick what they want only (in rank order), and presto, the algo and technology does the rest. And you can be sure that the maximum satisfaction in the choice was made. (The algorithm can be tested)

    Essentially there are often more than two choices. The process of selecting down to just two: is a hidden complication. What voters then see is: a simpler two party choice, which is often opinionated as nothing they want at all. (What if the mother chose the wrong two meals to begin with) The amount of satisfaction can be measured from the amount of food that is left back after the meal is ate.


    In the USA, a lot of work is done in filtering out two top candidates, from many candidates, so as to input into a two candidate voting system. There are some pre-voting foolishness with Electoral College.

    https://www.usa.gov/election#:~:text...e%20president.

    "Electoral College
    Map of the U.S. showing the number of electoral college votes by state.

    In other U.S. elections, candidates are elected directly by popular vote. But the president and vice president are not elected directly by citizens. Instead, they’re chosen by “electors” through a process called the Electoral College.

    The process of using electors comes from the Constitution. It was a compromise between a popular vote by citizens and a vote in Congress.
    "

    https://www.voanews.com/usa/how-us-p...-process-works

    "How do the Democratic and Republican parties select their presidential nominees?

    Presidential primary elections or caucuses are held in each U.S. state and territory as part of the nominating process of U.S. presidential elections. Some states only hold primary elections, some only hold caucuses, and others use a combination of both.

    The primaries and caucuses are staggered between January and June before the general election in November.
    "


    In Jamaica, we have seats and then Prime Minister. I am not against the idea of having seats. But I fail to see how implementing a different computer algorithm is more complicated.

    We have more than two parties in Jamaica. And I have shown where the normal poll voting is inaccurate. How much more complicated it is to ask voters to pick a ranked choice of only what they want e.g BC or AB (If it was food, you do not pick what you do not want. You pick only what you want to eat, in order eg Beef then Chicken, or Ackee then Beef) It is new idea but not a difficult concept.

    https://thecommonwealth.org/our-memb...ution-politics
    "The 21 senators are appointed by the Governor-General, 13 of them on the advice of the Prime Minister, and eight on the advice of the Leader of the Opposition. The House of Representatives has 63 directly elected members. The Governor-General appoints the Prime Minister (the MP best able to lead the majority of the House) and Leader of the Opposition. The cabinet (Prime Minister and at least 11 ministers) has executive responsibility. Elections are held at intervals not exceeding five years."

    https://en.wikipedia.org/wiki/List_o...ies_in_Jamaica
    • People's National Party (PNP) – Social democratic, pro-republican. The opposition as of February 2016, 31 seats[1]
    • Jamaica Labour Party (JLP) – Conservative. The ruling party having 32 seats.
    • National Democratic Movement – Minor conservative party
    • New Nation Coalition – Recently formed party
    • Revolutionary Konservative Movement (RKM) – Recently formed Party with a Jamaica first agenda. Conservative populism
    • Left Alliance for National Democracy and Socialism (LANDS) – Formed in 2016 as a generally far-Leftist party organization. Currently doesn't engage in electoral politics.[2][3]


    https://en.wikipedia.org/wiki/Elections_in_Jamaica
    "The House of Representatives has 63 members, elected for a five-year term in single-seat constituencies."

    https://en.wikipedia.org/wiki/Politics_of_Jamaica
    "Party Votes % Seats +/–
    Jamaica Labour Party 437,178 49.5 32 +11
    People's National Party 433,629 49.1 31 –11
    Marcus Garvey People's Progressive Party 260 0.03 0 0
    National Democratic Movement 223 0.03 0 0
    People's Progressive Party 91 0.01 0 New
    Independents A 212 0.01 0 0
    Independents B 1,021 0.13 0 0
    Invalid/Rejected Ballots 9,875 – – –
    Total 882,489 100 63 0
    Registered voters/turnout 1,824,412 48.37% – –
    Source: Electoral Commission (100% of vote counted)"

    Quote Originally Posted by owen View Post
    It does not matter if the output is technically fair if no one believes that its fair.
    Yes. I agree. People need basic education. There are those who prevent this so as to control people easier. Education will not come from that mindset but from a progressive mindset.



    Quote Originally Posted by owen View Post
    The problem is not the actual voting mechanism but the perception of the out come.
    Normally I would not care about such a mechanism. But I see that the current mechanism is mathematically flawed. Especially when I see the choices that are selected and compare it to majority satisfaction. Normally, I would just care about what we can do to improve the nation, and humankind. There is so much wrong with the perception eg some people are die hard JLP or die hard PNP without knowing anything about what their party is doing. Right now, I am just concerned with what Jamaica is doing with itself, and with our brother and sister countries.



    Quote Originally Posted by owen View Post
    Btw that C# code is verbose asf even for such a simple prototype.
    I leave the cleaning up and summarizing of the code to the younger generation. I have other projects working on. The essential mathematics is complete. I leave it to someone else to simplify.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  10. #10
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Uploaded code in:
    https://anonymousfiles.io/Gm5JF0qM/
    rar md5 hash bdf97011069ddaef3449e89d152a8d0a

    First Patch but still a work in progress

    Majority criterion and Independence of Irrelevant Alternatives were violated. Second patch is in the making.

    Example:
    If there are 4 candidates A,B,C, and D

    and the votes are:
    4xA,C (four people vote for A then C)
    5xB,
    B should win
    This has been patched

    3xA,C,
    3xB,
    3xD,
    A,B,D should tie

    3xA,C,
    3xB,
    3xD,
    3xC,
    C should win (not implemented yet)
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •