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

Fix Your SDLC Before Adopting Gen AI in Your Organisation: Bannon’s Call to Action at QCon London

During her keynote at QCon London, Tracy Bannon, architect and researcher at MITRE, argued that AI will be able to enhance the software development lifecycle, though currently it’s at the “code completion” rather than “code generation” phase. Throughout her presentation, she continuously stresses the importance of keeping humans in the loop and fixing your company’s SDLC before embracing AI.

By Olimpiu Pop

Presentation: Embrace Complexity; Tighten Your Feedback Loops

Fred Hebert discusses various small approaches and patterns that influence how teams deal with reliability, and highlights some of the key interactions and behaviors.

By Fred Hebert

Google Trains User Interface and Infographics Understanding AI Model ScreenAI

Google Research recently developed ScreenAI, a multimodal AI model for understanding infographics and user interfaces. ScreenAI is based on the PaLI architecture and achieves state-of-the-art performance on several tasks.

By Anthony Alford

Shadow API Detection for Google Cloud Environments in Preview

During Google Cloud Next, Google announced the preview release of shadow API detection in Advanced API Security, part of the Apigee API Management solution. This managed API Broker service in the Google Cloud allows users to design, secure, deploy, monitor, and analyze APIs.

By Steef-Jan Wiggers

Java News Roundup: JobRunr 7.0, Introducing the Commonhaus Foundation, Payara Platform, Devnexus

This week's Java roundup for April 8th, 2024 features news highlighting: JobRunr 7.0; introducing the Commonhaus Foundation; the April 2024 edition of Payara Platform; JEP 473, Stream Gatherers (Second Preview), and JEP 469, Vector API (Eighth Incubator), Proposed to Target for JDK 23; and Devnexus 2024.

By Michael Redlich

© 2024   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service