Instant Runoff Voting (IRV) is a fascinating way to run an election. The basic idea is that voters rank the candidates and the votes for the least popular candidate are automatically moved to the remaining candidates until one is selected winner.


Ready for the challenge? Code up a solution in your favorite language by midnight Sunday, February 14th, Eastern Standard Time. [ed. looks like we have a deadline error, so hold on to your hats, let us remedy this] Submit it to contest at codetown dot us. Also, post the link or code on this Discussion so the group can see it. We're allowing a little more time for this contest, so the results will be judged by...you! A poll will be posted in Contest Town so you can vote for your favorite app. Maybe we can use IRV to decide?

The winner will receive ... bear with us, as we're waiting to hear back from our sponsor, but this contest is going up now to give you the maximum possible amount of time to code. Good luck!

Views: 887

Replies to This Discussion

Am I too late? I think Eric and Dan may already be tied to win this contest. Regardless, I'm uploading my entry. One interesting thing- with my dataset, some ballots actually lost all their selections after the second run-off ( I had seven candidates, people selected the top four) so the total votes decreased. At first I thought this was a bug, but this might be one of the complaints people have with the system of instant runoffs. (?)
Attachments:
All - thanks for your submissions. We are still searching for a prize sponsor, so until we get one, the door is open at least until 2/14 for submissions. Stay tuned!
The code that I wrote at last night's meeting is posted at http://github.com/ericlavigne/instant-runoff

I have not yet figured out how to post the video online, as it weighs in at 3.5GB.

It's good to see that some others have submitted solutions. Looks like Michael's solution is a bit ahead of mine as it can read votes in from a file. And of course Dan's is way ahead since it has been used for real elections.
wait, really? where can I find Dan's entry?

Eric Lavigne said:
The code that I wrote at last night's meeting is posted at http://github.com/ericlavigne/instant-runoff

I have not yet figured out how to post the video online, as it weighs in at 3.5GB.

It's good to see that some others have submitted solutions. Looks like Michael's solution is a bit ahead of mine as it can read votes in from a file. And of course Dan's is way ahead since it has been used for real elections.
wait, really? where can I find Dan's entry?

He talked about it at both the January and February GatorJUG meetings, but I haven't seen either the code or the running program. I think it was a project for Santa Fe Community College.
it is a large project that is not portable. This is why i was not trying to enter it. I could take snippets of code or screenshots and post it for people to look at. time permitting at our next meeting i will demo it. There is a staff side that allows us to enter in who is running for what position. It allows creation of parties. It allows the user to enter a date and time range, this range controls when the ballot appears to students on our student website. The students must log in to see it. If they do not meet certain parameters they are not allowed to vote. Must be enrolled in classes currently for instance.
The staff side includes allowing staff to see a sample ballot, and a results page.
it is a large project that is not portable. This is why i was not trying to enter it. I could take snippets of code or screenshots and post it for people to look at. time permitting at our next meeting i will demo it.

This sounds interesting, and I would certainly be interested in seeing code, screenshots, and/or a demo.
All my data is in tables. I used the power of sql to do part of my counting.
vote_cnt is the order that this candidate was put in by the voters.
ex
SELECT
COUNT(*)

INTO
:SR1037W1.COUNT

FROM
OWNERSQL.SRT_GOVT_VOTES T1

WHERE T1.ACAD_BEG_YR = :ACAD_BEG_YR AND
T1.ID_NUM = :SEARCH_ID1 AND
T1.VOTE_CNT = :SEARCH_CNT1
AND EXISTS(SELECT * FROM OWNERSQL.SRT_GOVT_VOTES T2
WHERE T2.ACAD_BEG_YR = :ACAD_BEG_YR AND
T1.SSN = T2.SSN AND
T2.ID_NUM = :SEARCH_ID2 AND
T2.VOTE_CNT = :SEARCH_CNT2
)

The results of multiple sql queries is combined and then compared.
if one candidate has > half votes then we are done and present the results.
else
determine who is in last place.
then do sql queries to give his votes to the others.
i'll print some code out and show everyone the system next month.

next student goverment voting is:
The next Student Government Election will begin on 03/31/2010 at 08:00 AM. Voting will end 04/01/2010 at 03:00 PM.
you can come by and question the voters/students and see what they think.
During your presentation I wasn't fully following your logic as I don't deal with Clojure, Lisp or functional programming much. But now after looking at your code I see pretty much followed your line of attack, when I wrote it I thought I was taking a different approach.
During your presentation I wasn't fully following your logic as I don't deal with Clojure, Lisp or functional programming much. But now after looking at your code I see pretty much followed your line of attack, when I wrote it I thought I was taking a different approach.

Any suggestions for how I could have explained it better? What did you understand later that you didn't understand during the presentation?
Update on contest winning entry: Michael, Kevin and Eric, we have not gotten a sponsor for Contest 2 yet, though since we haven't chosen a winner yet, the door is still open. Here's the plan. If we don't get a sponsor by the next GatorJUG meeting, I will choose a prize for the winning entry. I'll continue to search for a sponsor. And, stay tuned for Contest #3! Since all the entries are from GatorJUG members, we'll discuss the conclusion of this contest at the next GatorJUG meeting in March. Sound fair? Let me ask of you that you post the features each of your entries implements here as a comment.

RSS

Happy 10th year, JCertif!

Notes

Welcome to Codetown!

Codetown is a social network. It's got blogs, forums, groups, personal pages and more! You might think of Codetown as a funky camper van with lots of compartments for your stuff and a great multimedia system, too! Best of all, Codetown has room for all of your friends.

When you create a profile for yourself you get a personal page automatically. That's where you can be creative and do your own thing. People who want to get to know you will click on your name or picture and…
Continue

Created by Michael Levin Dec 18, 2008 at 6:56pm. Last updated by Michael Levin May 4, 2018.

Looking for Jobs or Staff?

Check out the Codetown Jobs group.

 

Enjoy the site? Support Codetown with your donation.



InfoQ Reading List

How to Tame Technical Debt in Software Development

According to Marijn Huizenveld, discipline is key to preventing accumulating technical debt. In order to be disciplined you should make it difficult to ignore the debt. Heuristics like fixing small issues immediately, agreeing on a timebox for improvement, and making messy things look messy, can help tame technical debt.

By Ben Linders

xAI Opens Grok as an Open-Source Model

Elon Musk announced that xAI would make its AI chatbot Grok open source, and now the release is accessible on GitHub and Hugging Face. This move enables researchers and developers to expand upon the model, influencing how xAI evolves Grok in the face of competition from tech giants like OpenAI, Meta, Google, Microsoft, and others.

By Daniel Dominguez

Presentation: Portfolio Analysis at Scale: Running Risk and Analytics on 15+ Million Portfolios Every Day

William Chen discusses the importance of trimming your computational graph, storing data in multiple formats, leveraging open source, and considering multiple dimensions of modularization.

By William Chen

Redis Switches to SSPLv1: Restrictive License Sparks Fork by Former Maintainers

Redis has recently announced a change in their license by transitioning from the open-source BSD to the more restrictive Server Side Public License (SSPLv1). The move has promptly led to a fork initiated by former maintainers and reignited discussions surrounding the sustainability of open-source initiatives.

By Renato Losio

DigitalOcean Introduces CPU-based Autoscaling for its App Plaform

DigitalOcean has launched automatic horizontal scaling for its App Platform PaaS, aiming to free developers from the burden of scaling services up or down based on CPU load all by themselves.

By Sergio De Simone

© 2024   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service