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: 888

Replies to This Discussion

features? well, ok. as of the (I swear) final revision (attached here; will also be on my ite space whenever I can access the server): instantrunoff.rar

--it reads ballots in from a file or from command line input. (file format is limited to txt, though.)
--you can vote for as many or as few people on a ballot as you care to. to put it another way, max. votes/ballot is up to you, not me, but you don't have to vote for the maximum.
--no vote is ignored. if your ballot reads MickeyMouse GoofyDog DonaldDuck it'll take that as readily as John Bill Jeff. depending on your point of view, this may not be a feature, but I think write-ins are as American as baseball and apple pie. (Goofy is supposed to be a dog, right?)
--it's verbose. for each round, you see who got the most votes, who was eliminated, and who's left in the runoff.
--it's 93 lines, including liberal commenting.
--it does what it's supposed to.

Michael Levin said:
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.
hm. attachment didn't work.
try this.

Michael Newman said:
features? well, ok. as of the (I swear) final revision (attached here; will also be on my ite space whenever I can access the server): instantrunoff.rar

--it reads ballots in from a file or from command line input. (file format is limited to txt, though.)
--you can vote for as many or as few people on a ballot as you care to. to put it another way, max. votes/ballot is up to you, not me, but you don't have to vote for the maximum.
--no vote is ignored. if your ballot reads MickeyMouse GoofyDog DonaldDuck it'll take that as readily as John Bill Jeff. depending on your point of view, this may not be a feature, but I think write-ins are as American as baseball and apple pie. (Goofy is supposed to be a dog, right?)
--it's verbose. for each round, you see who got the most votes, who was eliminated, and who's left in the runoff.
--it's 93 lines, including liberal commenting.
--it does what it's supposed to.

Michael Levin said:
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.
I created an instant-runoff Clojure library, which would be useful for someone who is creating an election application (commandline/web/etc) in Java or any other JVM language. It is only 32 source lines of code, not including the "def candidates" and "def votes" statements which were only used for testing. The winner function takes a list of ballots and a set of candidates as input and returns the winner - a simple and orthogonal API.

http://github.com/ericlavigne/instant-runoff/blob/master/src/electi...

The code was written and thoroughly tested in front of a live audience. Unfortunately those tests were in a Clojure prompt and were lost when my laptop batteries died. I have started rebuilding the test suite, as shown in the following file.

http://github.com/ericlavigne/instant-runoff/blob/master/test/elect...
Since I was out of town for the March meeting, let's get together at the April meeting (at the Civic Media Center) to determine a winner.

Michael Newman said:
features? well, ok. as of the (I swear) final revision (attached here; will also be on my ite space whenever I can access the server): instantrunoff.rar

--it reads ballots in from a file or from command line input. (file format is limited to txt, though.)
--you can vote for as many or as few people on a ballot as you care to. to put it another way, max. votes/ballot is up to you, not me, but you don't have to vote for the maximum.
--no vote is ignored. if your ballot reads MickeyMouse GoofyDog DonaldDuck it'll take that as readily as John Bill Jeff. depending on your point of view, this may not be a feature, but I think write-ins are as American as baseball and apple pie. (Goofy is supposed to be a dog, right?)
--it's verbose. for each round, you see who got the most votes, who was eliminated, and who's left in the runoff.
--it's 93 lines, including liberal commenting.
--it does what it's supposed to.

Michael Levin said:
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.
My project just ran for real. Some of the students are fussing. It is interesting to read some of thier posts.

http://www.facebook.com/pages/Avant-Garde/277009322419?ref=ts

We had 4 parties.
two obviously lost and two where very, very close for winning. The party that had the most number one votes then lost because the party in second place had the most second and third place votes.

very interesting.


Michael Levin said:
Since I was out of town for the March meeting, let's get together at the April meeting (at the Civic Media Center) to determine a winner.

Michael Newman said:
features? well, ok. as of the (I swear) final revision (attached here; will also be on my ite space whenever I can access the server): instantrunoff.rar

--it reads ballots in from a file or from command line input. (file format is limited to txt, though.)
--you can vote for as many or as few people on a ballot as you care to. to put it another way, max. votes/ballot is up to you, not me, but you don't have to vote for the maximum.
--no vote is ignored. if your ballot reads MickeyMouse GoofyDog DonaldDuck it'll take that as readily as John Bill Jeff. depending on your point of view, this may not be a feature, but I think write-ins are as American as baseball and apple pie. (Goofy is supposed to be a dog, right?)
--it's verbose. for each round, you see who got the most votes, who was eliminated, and who's left in the runoff.
--it's 93 lines, including liberal commenting.
--it does what it's supposed to.

Michael Levin said:
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.
Dan Lackey said:
My project just ran for real. Some of the students are fussing. It is interesting to read some of thier posts.

Congrats Dan!

Some people are upset about losing, and the new system is an easy scapegoat. Still, even in the losing party there are people saying to stop being so childish. Sounds like it went well.
I have had projects blow up in my face for having mistakes in them before. I have never had one blow up because it was done properly.
Pretty funny really.


Eric Lavigne said:
Dan Lackey said:
My project just ran for real. Some of the students are fussing. It is interesting to read some of thier posts.

Congrats Dan!

Some people are upset about losing, and the new system is an easy scapegoat. Still, even in the losing party there are people saying to stop being so childish. Sounds like it went well.

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

For Practitioners, by Practitioners: Solve Your Software Challenges at InfoQ & QCon Software Events

Behind every InfoQ Dev Summit and QCon software development conference is a collective of distinguished senior software practitioners who carefully curate the topics based on the crucial trends and essential best practices you need to know about. These architects and leaders are charged with creating THE conference they would want to attend.

By Artenisa Chatziou

How Technology Can Drive Culture Change in Software Organisations

Technological improvements like containers, VMs, infrastructure-as-code, software-defined-networking, collaborative version control, and CI/CD can make it possible to fix cultural issues around organisational dynamics and bad product delivery. According to Nigel Kersten, software leaders should leverage tech to create positive changes in organisational dynamics and relationships between teams.

By Ben Linders

Radius is Now a Cloud Native Compute Foundation (CNCF) Sandbox Project

The Microsoft Azure Incubations Team recently announced the approval of Radius as a Cloud Native Compute Foundation (CNCF) sandbox project. Radius is a cloud-native, cloud-agnostic application platform that the CNCF has recognized as having the potential to contribute to the cloud-native ecosystem.

By Steef-Jan Wiggers

Spring Now Offers Free Access for the Spring Academy Pro Content

The Spring team has announced that the Pro Content from their Spring Academy will no longer require a paid subscription to improve the learning experience for the Spring community. The Spring Academy will continue to provide new content in the future.

By Johan Janssen

Podcast: Navigating AI, Platform Engineering, and Staff-Plus: InfoQ Dev Summit Boston Preview

In this InfoQ podcast, host Daniel Bryant sat down with speakers from the InfoQ Dev Summit Boston (June 24-25) and discussed the critical challenges and decisions developers are currently facing. Topics covered include platform engineering, the evolution of senior software developer roles into Staff-Plus positions, AI's impact on the SDLC, and the importance of security.

By Eder Ignatowicz, Loiane Groner, David Grizzanti, Thiago Ghisi

© 2024   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service