text:
Strategic Voting, The Game
One of the most common voting systems for single-winner elections is the plurality voting method.  Simply put, the candidate with the most votes wins.  Plurality voting, however, is mathematically unsound and is liable to create situations in which voters are driven to vote for the "lesser of two evils" as opposed to the candidate they truly prefer.
In this game, you will write program that takes advantage of the plurality voting system.  It will cast a vote for one of three candidates in an election.  Each candidate is associated with a certain payoff for yourself, and your goal is to maximize your expected payoff.
The payoffs are "uniformly" randomly distributed, change with each election, and add to 100.  Candidate A could have payoff 40, Candidate B could have payoff 27, and Candidate C could have payoff 33.  Each player has a different set of payoffs.
When it is your turn to vote, you will have incomplete information. Listed below is the information that you will have available to you.  Since you don't know what other player's individual payoffs are, it will be your challenge to predict how they would vote given the current poll results.

The partial results of the election so far
The number of entrants (excluding yourself), who haven't voted yet
Your personal payoffs for each of the candidates
The total group payoffs for each of the candidates

After each player has been given a chance to vote, the candidate with the most votes wins in accordance with plurality voting.  Each player then receives the number of points that corresponds the their payoff from that candidate.  If there is a tie in votes, then the number of points assigned will be the average of the tied candidates.
Tournament Structure
When first instantiated, the entrant will be told the number of elections held in the tournament.  I will attempt to run  an extremely large number of elections.  Then, each election will be carried out one-by-one.
After the entrants are shuffled, each is given a turn to vote.  They are given the limited information listed above and return a number signifying their vote. After each election is over, each bot is given the final poll results and their score increase from that election.
The victorious entrant will be the one with the highest total score after some large number of elections have been held.  The controller also computes a "normalized" score for each contestant by comparing its score to the score distribution predicted for a randomly-voting bot.
Submission Details
Submissions will take the form of Java 8 classes.  Each entrant must implement the following interface:
public interface Player
{
    public String getName();
    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs);
    public void receiveResults(int[] voteCounts, double result);
}

Your constructor should take a single int as a parameter, which will represent the number of elections that will be held.
The getName() method returns the name to be used on the leaderboard.  This allows you to have nicely-formatted names, just don't go crazy.
The getVote(...) method returns 0, 1, or 2 to signify which candidate will receive the vote.
The receiveResults(...) method is mainly to enable the existence of more complex strategies that use historical data.
You are allowed to create pretty much any other methods / instance variables you wish to record and process the information given to you.

Tournament Cycle, Expanded

The entrants are each instantiated with new entrantName(int numElections).
For each election:

The controller randomly determines the payoffs for each player for this election.  The code for this is given below.  Then, it shuffles players and has them start voting.
The entrant's method public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs) is invoked, and the entrant returns their vote of 0, 1, or 2 for the candidate of their choice.
Entrants whose getVote(...) method doesn't return a valid vote will be assigned a random vote.
After everyone has voted, the controller determines the election results by the plurality method.
The entrants are informed of the final vote counts and their payoff by calling their method public void receiveResults(int[] voteCounts, double result).

After all elections have been held, the winner is the one with the highest score.

The Random Distribution of Payoffs
The exact distribution will have a significant effect on gameplay. I have chosen a distribution with a large standard deviation (about 23.9235) and which is capable of creating both very high and very low payoffs.  I have checked that each of the three payoffs has an identical distribution.
public int[] createPlayerPayoffs()
{
    int cut1;
    int cut2;
    do{
        cut1 = rnd.nextInt(101);
        cut2 = rnd.nextInt(101);
    } while (cut1 + cut2 > 100);
    int rem = 100 - cut1 - cut2;
    int[] set = new int[]{cut1,cut2,rem};
    totalPayoffs[0] += set[0];
    totalPayoffs[1] += set[1];
    totalPayoffs[2] += set[2];
    return set;
}

More Rules
Here are some more generalized rules.

Your program must not run/modify/instantiate any parts of the controller or other entrants or their memories.
Since your program stays "live" for the whole tournament, don't create any files.
Don't interact with, help, or target any other entrant programs.
You may submit multiple entrants, as long as they are reasonably different, and as long as you follow the above rules.
I haven't specified an exact time limit, but I would greatly appreciate runtimes that are significantly less than a second per call.  I want to be able to run as many elections as feasible.

The Controller
The controller can be found here.  The main program is Tournament.java.  There are also two simple bots, which will be competing, titled RandomBot and PersonalFavoriteBot.  I will post these two bots in an answer.
Leaderboard
It looks like ExpectantBot is the current leader, followed by Monte Carlo and then StaBot.
Leaderboard - 20000000 elections:
   767007688.17 (  937.86) - ExpectantBot
   766602158.17 (  934.07) - Monte Carlo 47
   766230646.17 (  930.60) - StatBot
   766054547.17 (  928.95) - ExpectorBot
   764671254.17 (  916.02) - CircumspectBot
   763618945.67 (  906.19) - LockBot
   763410502.67 (  904.24) - PersonalFavoriteBot343
   762929675.17 (  899.75) - BasicBot
   761986681.67 (  890.93) - StrategicBot50
   760322001.17 (  875.37) - Priam
   760057860.67 (  872.90) - BestViableCandidate (2842200 from ratio, with 1422897 tie-breakers of 20000000 total runs)
   759631608.17 (  868.92) - Kelly's Favorite
   759336650.67 (  866.16) - Optimist
   758564904.67 (  858.95) - SometimesSecondBestBot
   754421221.17 (  820.22) - ABotDoNotForget
   753610971.17 (  812.65) - NoThirdPartyBot
   753019290.17 (  807.12) - NoClueBot
   736394317.17 (  651.73) - HateBot670
   711344874.67 (  417.60) - Follower
   705393669.17 (  361.97) - HipBot
   691422086.17 (  231.38) - CommunismBot0
   691382708.17 (  231.01) - SmashAttemptByEquality (on 20000000 elections)
   691301072.67 (  230.25) - RandomBot870
   636705213.67 ( -280.04) - ExtremistBot
The tournament took 34573.365419071 seconds, or 576.2227569845166 minutes.

Here are some older tournament, but none of the bots have changed in functionality since these runs.
Leaderboard - 10000000 elections:
   383350646.83 (  661.14) - ExpectantBot
   383263734.33 (  659.99) - LearnBot
   383261776.83 (  659.97) - Monte Carlo 48
   382984800.83 (  656.31) - ExpectorBot
   382530758.33 (  650.31) - CircumspectBot
   381950600.33 (  642.64) - PersonalFavoriteBot663
   381742600.33 (  639.89) - LockBot
   381336552.33 (  634.52) - BasicBot
   381078991.83 (  631.12) - StrategicBot232
   380048521.83 (  617.50) - Priam
   380022892.33 (  617.16) - BestViableCandidate (1418072 from ratio, with 708882 tie-breakers of 10000000 total runs)
   379788384.83 (  614.06) - Kelly's Favorite
   379656387.33 (  612.31) - Optimist
   379090198.33 (  604.83) - SometimesSecondBestBot
   377210328.33 (  579.98) - ABotDoNotForget
   376821747.83 (  574.84) - NoThirdPartyBot
   376496872.33 (  570.55) - NoClueBot
   368154977.33 (  460.28) - HateBot155
   355550516.33 (  293.67) - Follower
   352727498.83 (  256.36) - HipBot
   345702626.33 (  163.50) - RandomBot561
   345639854.33 (  162.67) - SmashAttemptByEquality (on 10000000 elections)
   345567936.33 (  161.72) - CommunismBot404
   318364543.33 ( -197.86) - ExtremistBot
The tournament took 15170.484259763 seconds, or 252.84140432938332 minutes.

I also ran a second 10m tournament, confirming ExpectantBot's lead.
Leaderboard - 10000000 elections:
   383388921.83 (  661.65) - ExpectantBot
   383175701.83 (  658.83) - Monte Carlo 46
   383164037.33 (  658.68) - LearnBot
   383162018.33 (  658.65) - ExpectorBot
   382292706.83 (  647.16) - CircumspectBot
   381960530.83 (  642.77) - LockBot
   381786899.33 (  640.47) - PersonalFavoriteBot644
   381278314.83 (  633.75) - BasicBot
   381030871.83 (  630.48) - StrategicBot372
   380220471.33 (  619.77) - BestViableCandidate (1419177 from ratio, with 711341 tie-breakers of 10000000 total runs)
   380089578.33 (  618.04) - Priam
   379714345.33 (  613.08) - Kelly's Favorite
   379548799.83 (  610.89) - Optimist
   379289709.83 (  607.46) - SometimesSecondBestBot
   377082526.83 (  578.29) - ABotDoNotForget
   376886555.33 (  575.70) - NoThirdPartyBot
   376473476.33 (  570.24) - NoClueBot
   368124262.83 (  459.88) - HateBot469
   355642629.83 (  294.89) - Follower
   352691241.83 (  255.88) - HipBot
   345806934.83 (  164.88) - CommunismBot152
   345717541.33 (  163.70) - SmashAttemptByEquality (on 10000000 elections)
   345687786.83 (  163.30) - RandomBot484
   318549040.83 ( -195.42) - ExtremistBot
The tournament took 17115.327209018 seconds, or 285.25545348363335 minutes.

o.O wow, mine did so poorly!

According to what I've seen in the code, the 2nd parameter is the number of votes remaining. And the first one is an Array containing a count of all the votes. Am I correct?

@IsmaelMiguel Yes.

And the 1st parameter has all the votes I've made or everybody's votes?

The second.  They are the partial results of the election, which are the votes made by the people ahead of you in the shuffled order.

Thanks a lot dude. May I ask you a dump of the array (from an example run) for 20 elections? I must improve my code, and I'm not happy with it right now. Also, is there a way to see how many votes a candidate currently has? (Since I'm not a Java programmer, and don't have a Java IDE, it is hard to do everything by memory)

Wow, didn't expect my bot to do very well, but it's much worse than I though ! Have to work on it !

@Katenkyo I had faith on your bot. And on mine as well. Yours seemed to be (at least) on 3rd.

I'm pretty sure that my entry (BestViableCandidate) and CircumspectBot have the exact same algorithm, although the code is clearly different. (Mine looks like it was written by somebody barely passing Java 101...). I suspect that the difference in our scores is due to the luck of the draw rather than any actual difference in behavior. I have to see if I can think of a way to improve on the model with the limited information we have available. Good contest.

You may also want to look at what happens when you give the voters a bunch of clones. At a brief glance, sometimesSecondBestBot, NoThirdPartyBot and optimist all seem to benefit from larger voting pools.(As do extremistBot and, in its own way, communismBot but that's less important)

I have now changed my entry (although not the name in the posting) to use a different algorithm. Once I realized that the same method as my original bot had already been entered it didn't seem right to clutter up the standings with two identical selections.

It's peculiar that so many of the strategies will vote for their least favorite candidate, even though this is strictly a worse decision than voting for either of the other two...

@RalphMarshall, technically your submission wasn't identical. It differed in the case that the only remaining candidate had a payoff of zero. :P

I wonder how the results would change if you removed the more erratic bots; e.g. ran a tournament using just the bots that score over 600. Or 500 or 400 or something; not sure where the best cutoff would be.

As a quick mathematical note, any voting method with multiple options is also"unsound." Purlarity voting is probably inferior though.

NoThirdPartyBot
This bot tries to guess which candidate will be third, and votes the candidate he likes best of the two front runners.
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class NoThirdPartyBot implements Player {

    public NoThirdPartyBot(int e) {
    }

    @Override
    public String getName() {
        return "NoThirdPartyBot";
    }

    @Override
    public int getVote(int[] voteCounts, int votersRemaining, int[] payoffs,
            int[] totalPayoffs) {
        List<Integer> order = order(totalPayoffs);

        if (payoffs[order.get(0)] > payoffs[order.get(1)]) {
            return order.get(0);
        } else {
            return order.get(1);
        }
    }

    static List<Integer> order(int[] array) {
        List<Integer> indexes = Arrays.asList(0, 1, 2);
        Collections.sort(indexes, (i1, i2) -> array[i2] - array[i1]);
        return indexes;
    }

    @Override
    public void receiveResults(int[] voteCounts, double result) {
    }
}

CircumspectBot
This bot votes for his favorite that hasn't been mathematically eliminated.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class CircumspectBot implements Player {

    public CircumspectBot(int elections) {
    }

    @Override
    public String getName() {
        return "CircumspectBot";
    }

    @Override
    public int getVote(int[] voteCounts, int votersRemaining, int[] payoffs,
            int[] totalPayoffs) {
        List<Integer> indexes = new ArrayList<>();
        int topVote = Arrays.stream(voteCounts).max().getAsInt();
        for (int index = 0; index < 3; index++) {
            if (voteCounts[index] + votersRemaining + 1 >= topVote) {
                indexes.add(index);
            }
        }
        Collections.sort(indexes, (i1, i2) -> payoffs[i2] - payoffs[i1]);

        return indexes.get(0);
    }

    @Override
    public void receiveResults(int[] voteCounts, double result) {

    }

}

I'd wager Circumspect Bot is strictly better than Personal Favorite Bot. Nice.

ExpectantBot
This bot computes the expected value of each voting option assuming that all voters afterwards will vote randomly.
import java.util.Arrays;

public class ExpectantBot implements Player {

    public ExpectantBot(int elections) {
    }

    @Override
    public String getName() {
        return "ExpectantBot";
    }

    static double choose(int x, int y) {
        if (y < 0 || y > x) return 0;
        if (y > x/2) {
            // choose(n,k) == choose(n,n-k),
            // so this could save a little effort
            y = x - y;
        }

        double denominator = 1.0, numerator = 1.0;
        for (int i = 1; i <= y; i++) {
            denominator *= i;
            numerator *= (x + 1 - i);
        }
        return numerator / denominator;
    }

    double expectedPayout(int[] voteCounts, int[] payoffs, int votersRemaining) {
        double total = 0.0;
        for (int firstPartyVoters = 0; firstPartyVoters <= votersRemaining; firstPartyVoters++) {
            for (int secondPartyVoters = 0; secondPartyVoters <= votersRemaining - firstPartyVoters; secondPartyVoters++) {
                int thirdPartyVoters = votersRemaining - firstPartyVoters - secondPartyVoters;

                int [] newVoteCounts = voteCounts.clone();
                newVoteCounts[0] += firstPartyVoters;
                newVoteCounts[1] += secondPartyVoters;
                newVoteCounts[2] += thirdPartyVoters;
                int highest = Arrays.stream(newVoteCounts).max().getAsInt();
                int payoff = 0;
                int winCount = 0;
                for (int index = 0; index < 3; index++) {
                    if (newVoteCounts[index] == highest) {
                        payoff += payoffs[index];
                        winCount++;
                    }
                }
                double v = (double)payoff / (double) winCount;
                double value = choose(votersRemaining, firstPartyVoters)*choose(votersRemaining - firstPartyVoters, secondPartyVoters)*v*Math.pow(1/3.0, votersRemaining);
                total += value;
            }
        }
        return total;
    }

    @Override
    public int getVote(int[] voteCounts, int votersRemaining, int[] payoffs,
            int[] totalPayoffs) {

        int bestVote = 0;
        double bestScore = 0.0;
        for (int vote = 0; vote < 3; vote++) {
            voteCounts[vote]++;
            double score = expectedPayout(voteCounts, payoffs, votersRemaining);
            if (score > bestScore) {
                bestVote = vote;
                bestScore = score;
            }
            voteCounts[vote]--;
        }
        return bestVote;

    }

    @Override
    public void receiveResults(int[] voteCounts, double result) {
    }

}

Without heavy metagaming from the other opponents, I'd be surprised if anything beats this guy.

@DoctorHeckle, I had hopes for StatBot, but I think you are right.

HipBot
HipBot doesn't care about payouts. Money is just a sedative that distracts from true art.
HipBot wants to vote for someone real, not just some corporate shill. He also wants to wear their campaign shirt after their (presumably) humiliating defeat, so he feels superior whenever the winner does something wrong.
Therefore, HipBot votes for the person with the lowest votes or, if there's a tie, whoever's got the better payout. Eating organic-only isn't free.
public class HipBot implements Player{

    public HipBot(int rounds){ /*Rounds are a social construct*/ }

    public String getName(){ return "HipBot"; }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs){

        int coolest = 0;
        int lowest = 100000000;
        int gains = 0;

        for( int count = 0; count < voteCounts.length; count++ ){

            if( voteCounts[count] < lowest || (voteCounts[count] == lowest && payoffs[count] > gains) ){

                lowest = voteCounts[count];
                coolest = count;
                gains = payoffs[count];

            }

        }

        return coolest;

    }

    public void receiveResults(int[] voteCounts, double result){ /*The past is dead*/ }

}

HipBot is also untested, so let me know if there's anything going on.
EDIT: added in more competitive tiebreaking, pithy comments.

works for me, although his pity for the looser doesn't do much for his score :)

He's won in his mind, and for him, that's all that matters :D

PersonalFavoriteBot
This bot simply votes for the candidate with the highest personal payoff, ignoring everything else.  One of the main points of this challenge is to demonstrate how this is not the optimal strategy.
import java.lang.Math;
import java.util.Random;
/**
 * This bot picks the candidate with the highest personal payoff, ignoring everyone else's actions.
 *
 * @author PhiNotPi
 * @version 5/27/15
 */
public class PersonalFavoriteBot implements Player
{
    Random rnd;
    String name;
    /**
     * Constructor for objects of class PersonalFavoriteBot
     */
    public PersonalFavoriteBot(int e)
    {
       rnd = new Random();
       name = "PersonalFavoriteBot" + rnd.nextInt(1000);
    }

    public String getName()
    {
        return name;
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        //return rnd.nextInt(3);
        int maxloc = 0;
        for(int i = 1; i< 3; i++)
        {
            if(payoffs[i] > payoffs[maxloc])
            {
                maxloc = i;
            }
        }
        return maxloc;
    }

    public void receiveResults(int[] voteCounts, double result)
    {

    }
}

RandomBot
This bot votes randomly.  Regardless of the number of elections carried out (as long as it's reasonably high, like over 100), this contestant's normalized score  fluctuates between -2 and 2.
import java.lang.Math;
import java.util.Random;
/**
 * This bot votes for a random candidate.
 *
 * @author PhiNotPi
 * @version 5/27/15
 */
public class RandomBot implements Player
{
    Random rnd;
    String name;
    /**
     * Constructor for objects of class RandomBot
     */
    public RandomBot(int e)
    {
       rnd = new Random();
       name = "RandomBot" + rnd.nextInt(1000);
    }

    public String getName()
    {
        return name;
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        return rnd.nextInt(3);
    }

    public void receiveResults(int[] voteCounts, double result)
    {

    }
}

Follower
Follower wants to fit in. It thinks the best way to accomplish that is by voting the same way as everyone else, or at least with the plurality so far. It'll break ties towards its own preference, to show a little independence. But not too much.
public class Follower implements Player
{
    public Follower(int e) { }

    public String getName()
    {
        return "Follower";
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        int mostPopular = 0;
        int mostVotes = voteCounts[0];
        for (int i = 1; i < voteCounts.length; i++) {
            int votes = voteCounts[i];
            if (votes > mostVotes || (votes == mostVotes && payoffs[i] > payoffs[mostPopular])) {
                mostPopular = i;
                mostVotes = votes;
            }
        }
        return mostPopular;

    }

    public void receiveResults(int[] voteCounts, double result) { }
}

Note: I haven't tested this, so let me know if there are any errors.

It seems to work.

Best Viable Candidate
Pretty heavily revised version of my original submission. This one still eliminates any candidates that cannot win given the remaining votes to be cast, but then uses a strategy that tries to optimize the relative payoff rather than the absolute one. The first test is to take the ratio of my personal payoff to the overall payoff for each candidate, looking for the best value there. I then look for other ratios that are very close to the best and if there is one that has a lower overall payoff than the very best I pick that one instead. Hopefully this will tend to depress the payout of the other players while keeping mine reasonably high.
This bot does almost as well as the original on in my own testing, but not quite. We'll have to see how it does against the full field.
 /**
  * This bot picks the candidate with the highest relative payoff out of those
  * candidates who are not already mathematically eliminated.
  *
  * @author Ralph Marshall
  * @version 5/28/2015
  */

import java.util.List;
import java.util.ArrayList;

public class BestViableCandidate implements Player
{
    private static int NUM_CANDIDATES = 3;
    private int relativeCount = 0;
    private int relativeCountLowerTotal = 0;
    private int totalRuns;

    public BestViableCandidate(int r) {
        totalRuns = r;
    }

    public String getName() {
        return "BestViableCandidate (" + relativeCount + " from ratio, with " + relativeCountLowerTotal + " tie-breakers of " + totalRuns + " total runs)";
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs) {

        int i, maxVoteSoFar = 0;

        // First we figure out the maximum possible number of votes each candidate would get
        // if every remaining bot voted for it
        int [] maxPossibleVotes = new int[NUM_CANDIDATES];
        for (i = 0; i < NUM_CANDIDATES; i++) {

            // The voters remaining does not include me, so we need to add one to it
            maxPossibleVotes[i] = voteCounts[i] + votersRemaining + 1;

            if (voteCounts[i] > maxVoteSoFar) {
                maxVoteSoFar = voteCounts[i];
            }
        }

        // Then we throw out anybody who cannot win even if they did get all remaining votes
        List<Integer> viableCandidates = new ArrayList<Integer>();
        for (i = 0; i < NUM_CANDIDATES; i++) {
            if (maxPossibleVotes[i] >= maxVoteSoFar) {
                viableCandidates.add(Integer.valueOf(i));
            }
        }

        // And of the remaining candidates we pick the one that has the personal highest payoff
        // relative to the payoff to the rest of the voters
        int maxCandidate = -1;
        double maxRelativePayoff = -1;
        int maxPayoff = -1;
        int minTotalPayoff = Integer.MAX_VALUE;

        int originalMaxCandidate = -1;
        double originalMaxPayoff = -1;

        double DELTA = 0.01;

        double tiebreakerCandidate = -1;

        for (Integer candidateIndex : viableCandidates) {
            double relativePayoff = (double) payoffs[candidateIndex] / (double) totalPayoffs[candidateIndex];
            if (maxRelativePayoff < 0 || relativePayoff - DELTA > maxRelativePayoff) {
                maxRelativePayoff = relativePayoff;
                maxCandidate = candidateIndex;

                maxPayoff = payoffs[candidateIndex];
                minTotalPayoff = totalPayoffs[candidateIndex];

            } else if (Math.abs(relativePayoff - maxRelativePayoff) < DELTA) {
                if (totalPayoffs[candidateIndex] < minTotalPayoff) {
                    tiebreakerCandidate = candidateIndex;

                    maxRelativePayoff = relativePayoff;
                    maxCandidate = candidateIndex;

                    maxPayoff = payoffs[candidateIndex];
                    minTotalPayoff = totalPayoffs[candidateIndex];

                }
            }

            if (payoffs[candidateIndex] > originalMaxPayoff) {
                originalMaxPayoff = payoffs[candidateIndex];
                originalMaxCandidate = candidateIndex;
            }
        }

        if (tiebreakerCandidate == maxCandidate) {
            relativeCountLowerTotal++;
        }

        if (originalMaxCandidate != maxCandidate) {
            /*                System.out.printf("%nSelecting candidate %d with relative payoff %f (%d/%d) instead of %d with relative payoff %f (%d/%d)%n",
                              maxCandidate, (double) payoffs[maxCandidate]/(double)totalPayoffs[maxCandidate], payoffs[maxCandidate], totalPayoffs[maxCandidate],
                              originalMaxCandidate, (double) payoffs[originalMaxCandidate]/(double)totalPayoffs[originalMaxCandidate], payoffs[originalMaxCandidate], totalPayoffs[originalMaxCandidate]);
            */
            relativeCount++;
        }

        return maxCandidate;
    }
}

Isn't this the same as CircumspectBot?

Yes, it turns out it is; I made a comment to that effect up in the main question. When I started coding it up I didn't realize exactly how that one worked. Since CircumspectBot was written first it should clearly get the credit for the idea.

I think you are missing the end of your class.

Thanks. I lost the last brace; there wasn't any other code after what was there.

Monte Carlo
This simulates a large amount of random elections. It then chooses the choice that maximizes it's own profits.
import java.util.ArrayList;
import java.util.List;

public class MonteCarlo implements Player{

    private static long runs = 0;
    private static long elections = 0;

    public MonteCarlo(int e) {
        elections = e;
    }

    @Override
    public String getName() {
        return "Monte Carlo (difficulty " + (runs / elections) + ")";
    }

    @Override
    public int getVote(int[] voteCounts, int votersRemaining, int[] payoffs, int[] totalPayoffs) {
        elections++;
        double[] predictedPayoffs = new double[3];
        long startTime = System.nanoTime();
        while (System.nanoTime() - startTime <= 200_000){ //Let's give us 200 micro-seconds.
            runs++;
            int[] simulatedVoteCounts = voteCounts.clone();
            for (int j = 0; j < votersRemaining; j++){
                simulatedVoteCounts[((int) Math.floor(Math.random() * 3))]++;
            }
            for (int j = 0; j < 3; j++) {
                simulatedVoteCounts[j]++;
                List<Integer> winners = new ArrayList<>();
                winners.add(0);
                for (int k = 1; k < 3; k++) {
                    if (simulatedVoteCounts[k] > simulatedVoteCounts[winners.get(0)]) {
                        winners.clear();
                        winners.add(k);
                    } else if (simulatedVoteCounts[k] == simulatedVoteCounts[winners.get(0)]) {
                        winners.add(k);
                    }
                }
                for (int winner : winners) {
                    predictedPayoffs[j] += payoffs[winner] / winners.size();
                }
                simulatedVoteCounts[j]--;
            }
        }
        int best = 0;
        for (int i = 1; i < 3; i++){
            if (predictedPayoffs[i] > predictedPayoffs[best]){
                best = i;
            }
        }
        return best;
    }

    @Override
    public void receiveResults(int[] voteCounts, double result) {

    }
}

StatBot
StatBot is based on ExpectantBot; however, instead of assuming that each vote is equally probable it collects stats on how people vote and uses that to estimate the probability.
import java.util.Arrays;

public class StatBot implements Player {

    static private int[][][] data = new int[3][3][3];
    private int[] voteCounts;

    StatBot(int unused) {

    }

    @Override
    public String getName() {
        return "StatBot";

    }

     static double choose(int x, int y) {
            if (y < 0 || y > x) return 0;
            if (y > x/2) {
                // choose(n,k) == choose(n,n-k),
                // so this could save a little effort
                y = x - y;
            }

            double denominator = 1.0, numerator = 1.0;
            for (int i = 1; i <= y; i++) {
                denominator *= i;
                numerator *= (x + 1 - i);
            }
            return numerator / denominator;
        }

    double expectedPayout(int[] voteCounts, int[] payoffs, int votersRemaining) {
        Integer[] indexes = {0, 1, 2};
        Arrays.sort(indexes, (i0, i1) -> voteCounts[i1] - voteCounts[i0]);
        int [] stats = data[indexes[0]][indexes[1]];
        int total_stats = Arrays.stream(stats).sum();
        double total = 0.0;
        for (int firstPartyVoters = 0; firstPartyVoters <= votersRemaining; firstPartyVoters++) {
            for (int secondPartyVoters = 0; secondPartyVoters <= votersRemaining - firstPartyVoters; secondPartyVoters++) {
                int thirdPartyVoters = votersRemaining - firstPartyVoters - secondPartyVoters;

                int [] newVoteCounts = voteCounts.clone();
                newVoteCounts[0] += firstPartyVoters;
                newVoteCounts[1] += secondPartyVoters;
                newVoteCounts[2] += thirdPartyVoters;
                int highest = 0;
                for (int h : newVoteCounts) {
                    if (h > highest) highest = h;
                }
                int payoff = 0;
                int winCount = 0;
                for (int index = 0; index < 3; index++) {
                    if (newVoteCounts[index] == highest) {
                        payoff += payoffs[index];
                        winCount++;
                    }
                }
                double v = (double)payoff / (double) winCount;
                double value = choose(votersRemaining, firstPartyVoters)*choose(votersRemaining - firstPartyVoters, secondPartyVoters)*v;
                value *= Math.pow((double)stats[0]/(double)total_stats, firstPartyVoters);
                value *= Math.pow((double)stats[1]/(double)total_stats, secondPartyVoters);
                value *= Math.pow((double)stats[2]/(double)total_stats, thirdPartyVoters);

                total += value;
            }
        }
        return total;
    }

    @Override
    public int getVote(int[] voteCounts, int votersRemaining, int[] payoffs,
            int[] totalPayoffs) {

        int bestVote = 0;
        double bestScore = 0.0;
        for (int vote = 0; vote < 3; vote++) {
            voteCounts[vote]++;
            double score = expectedPayout(voteCounts, payoffs, votersRemaining);
            if (score > bestScore) {
                bestVote = vote;
                bestScore = score;
            }
            voteCounts[vote]--;
        }
        voteCounts[bestVote]++;
        this.voteCounts = voteCounts;

        return bestVote;

    }

    @Override
    public void receiveResults(int[] endVoteCounts, double result) {
        Integer[] indexes = {0, 1, 2};
        Arrays.sort(indexes, (i0, i1) -> voteCounts[i1] - voteCounts[i0]);
        for(int i = 0; i < 3; i++){
            data[indexes[0]][indexes[1]][i] += endVoteCounts[i] - voteCounts[i];
        }
    }
}

Optimist
The Optimist is very optimistic and assumes that half of the remaining voters will vote for the candidate that gives it the best payoff.
import java.lang.Integer;
import java.lang.String;
import java.util.Arrays;
import java.util.Comparator;

public class Optimist implements Player
{
    public Optimist(int _) { }
    public String getName() { return "Optimist"; }
    public int getVote(int[] curVotes, int rem, final int[] payoffs, int[] _)
    {
        Integer[] opt = new Integer[] { 0, 1, 2 };
        Arrays.sort(opt, new Comparator<Integer>() { public int compare(Integer i1, Integer i2) { return payoffs[i1] > payoffs[i2] ? -1 : payoffs[i1] == payoffs[i2] ? 0 : 1; } });
        int a = curVotes[opt[0]], b = curVotes[opt[1]], c = curVotes[opt[2]];
        double rest = (double)rem / 4;
        if (b <= a + rest && c <= a + rest)
            return opt[0];
        else if (c <= b)
            return opt[1];
        else
            return opt[0];
    }
    public void receiveResults(int[] _, double __) { }
}

ABotDoNotForget
His goal is simple : determining the overall tendencies using the total payoffs and counting the number of time the lower/medium/higher ones won. He will then vote for the one that is most likely to win.
import java.util.ArrayList;

public class ABotDoNotForget implements Player
{
    private int nbElec;
    private int countElec=0;
    private int[] currPayoffs=new int[3];
    private int[] lmh=new int[3];
    private int[] wins=new int[3];

    public ABotDoNotForget(int nbElec)
    {
        this.nbElec=nbElec;
    }

    public String getName() {return "ABotDoNotForget";}

    public int getVote(int[] voteCounts,
                        int votersRemaining,
                        int[] payoffs,
                        int[] totalPayoffs)
    {
        countElec++;
        System.arraycopy(totalPayoffs, 0, currPayoffs, 0, totalPayoffs.length);

        if(countElec<=nbElec/20&&countElec<=20)
        {
            int best=0;
            for(int i=1;i<payoffs.length;i++)
                if(payoffs[i]>=payoffs[best])
                    best=i;
            return best;
        }

        for(int i =1;i<totalPayoffs.length;i++)
        {
            if(totalPayoffs[i]<totalPayoffs[i-1])
            {
                int tmp= totalPayoffs[i];
                totalPayoffs[i]=totalPayoffs[i-1];
                totalPayoffs[i-1]=tmp;
                if(i==2&&totalPayoffs[i-1]<totalPayoffs[i-2]){
                    tmp= totalPayoffs[i-1];
                    totalPayoffs[i-1]=totalPayoffs[i-2];
                    totalPayoffs[i-2]=tmp;
                }
            }
        }
        lmhDist(currPayoffs,totalPayoffs);
        int best=0;
        for(int i=1;i<wins.length;i++)
            if(wins[i]>=wins[best]){
                best=i;
            }
        int ownH=0;
        for(int i=1;i<payoffs.length;i++)
            if(payoffs[i]>=payoffs[ownH])
                ownH=i;
        int ownM=0;
        for(int i=1;i<payoffs.length;i++)
            if(payoffs[i]>=payoffs[ownM]&&i!=ownH)
                ownM=i;

        int persBest=(voteCounts[ownH]-voteCounts[ownM]+(votersRemaining/3)>=0
                &&voteCounts[ownH]-voteCounts[best]<(votersRemaining/3))?ownH:ownM;

        return persBest;

    }

    public void receiveResults(int[] voteCounts, double result)
    {
        int best=0,bestV=voteCounts[best];
        for(int i=1;i<voteCounts.length;i++)
            if(voteCounts[i]>=bestV){
                best=i;
                bestV=voteCounts[i];
            }
        wins[lmh[best]]++;

    }

    private void lmhDist(int[] a,int[] s)
    {
        ArrayList<Integer> al = new ArrayList<Integer>();
        al.add(a[0]);al.add(a[1]);al.add(a[2]);
        lmh[0]=al.indexOf(s[0]);
        lmh[1]=al.indexOf(s[1]);
        lmh[2]=al.indexOf(s[2]);

    }
}

Edit : Some change done in the decision algorythm, now takes into account his own best payoff. Should now be able to vote better when the current distribution was making him vote for his own Lower when others where voting for their Higher payoffs.

Priam
Priam hates recursion. He estimates the probability of each remaining bot based on the total payoffs and then calculates the best way of maximising his payoff.
public class Priam implements Player {
    private static double[] smallFactorials = {1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800.,87178291200.,1307674368000.,20922789888000.,355687428096000.,6402373705728000.,121645100408832000.,2432902008176640000.};
    @Override
    public String getName() {
        return "Priam";
    }

    @Override
    public int getVote(int[] voteCounts, int votersRemaining, int[] payoffs,
            int[] totalPayoffs) {
        int totalPayoff = totalPayoffs[0] + totalPayoffs[1] + totalPayoffs[2];
        double p0 = ((double)totalPayoffs[0])/totalPayoff;
        double p1= ((double) totalPayoffs[1])/totalPayoff;
        double p2 = ((double)totalPayoffs[2])/totalPayoff;
        double[] expectedPayoffs = {0,0,0};
        for(int myChoice=0;myChoice<3;myChoice++)
        {
            for(int x0 = 0; x0 <= votersRemaining; x0++)
            {
                for(int x1 = 0; x1 <= (votersRemaining-x0); x1++)
                {
                    int x2 = votersRemaining - (x1 + x0);
                    double probability =
                            Math.pow(p0, x0)
                            * Math.pow(p1, x1)
                            * Math.pow(p2, x2)
                            * Choose(votersRemaining, x0)
                            * Choose(votersRemaining-x0, x1);
                    int votes0 = voteCounts[0];
                    int votes1 = voteCounts[1];
                    int votes2 = voteCounts[2];
                    if(myChoice == 0)
                    {
                        votes0++;
                    }
                    else if(myChoice==1)
                    {
                        votes1++;
                    }
                    else
                    {
                        votes2++;
                    }

                    votes0+=x0;
                    votes1+=x1;
                    votes2+=x2;
                    if(votes0>votes1 && votes0>votes2)
                    {
                        expectedPayoffs[myChoice]+=probability*payoffs[0];
                    }
                    else if(votes1>votes2)
                    {
                        expectedPayoffs[myChoice]+=probability*payoffs[1];
                    }
                    else
                    {
                        expectedPayoffs[myChoice]+=probability*payoffs[2];
                    }
                }
            }
        }
        if(expectedPayoffs[0]>expectedPayoffs[1] && expectedPayoffs[0]>expectedPayoffs[2])
        {
            return 0;
        }
        else if(expectedPayoffs[1]>expectedPayoffs[2])
        {
            return 1;
        }
        else
        {
            return 2;
        }
    }

    private long Choose(int source, int team) {
        return Factorial(source)/(Factorial(team)*Factorial(source-team));
    }

    private long Factorial(int n) {
        if(n<=20)
        {
            return (long)smallFactorials[n];
        }
        double d=(double)n;
        double part1 = Math.sqrt(2*Math.PI*d);
        double part2 = Math.pow(d/Math.E, d);
        return (long)Math.ceil(part1 * part2);
    }

    @Override
    public void receiveResults(int[] voteCounts, double result) {

    }
    public Priam(int i)
    {

    }
}

Much much faster than Odysseus as there is no recursion (runs in time O(n^2)) and can do one million elections in about 15 seconds.

"I think this is the first bot to use the total payoffs parameter for its own benefit :)" Look at my bot (ABotDoNotForget), he's already using it, sorry :D

Very similiar to my latest bot, ExpectantBot, except that you use totalPayoffs to predict probability and I assume every vote is equally probable. I'm eager to see which strategy works best.

@WinstonEwert I think yours does, you've won the last three tests I did.

I've only just noticed the similarity- I was trying to make a version of Odysseus which didn't take 10 hours to run 100 elections, so I used for loops

To be honest, I was inspired to take my approach by Odysseus.

NoClueBot
NoClue does not actually know Java or math very well, so he has no idea if this weighting-ratio-thingy will help him win. But he's trying.
import java.lang.Math;
import java.util.*;
/**
 * Created by Admin on 5/27/2015.
 */
public class NoClueBot implements Player {

    public NoClueBot(int e) { }

    public String getName() {
        return "NoClueBot";
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs) {
        double x = 0;
        int y = 0;
        for (int i=0; i<3; i++) {
            double t = (double) voteCounts[i] * ((double) payoffs[i]/(double) totalPayoffs[i]);
            if (x<t) {
                x = t;
                y = i;
            }
        }
        return y;
    }

    public void receiveResults(int[] voteCounts, double result) { }
}

SomeClueBot
SomeClueBot has been decommissioned. actually uses logic! used to use logic, which turned out to be inefficient, so instead he became mindful of the total payoff, not his own. uses logic again! But he doesn't do well with all these followers and optimists, and even people who don't care! :)

SometimesSecondBestBot
Basically PersonalFavouriteBot, improved (in theory).
import java.lang.Math;
/**
 * Created by Admin on 5/27/2015.
 */
public class SometimesSecondBestBot implements Player {
    public SometimesSecondBestBot(int e) { }

    public String getName() {
        return "SometimesSecondBestBot";
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs) {
        int m = 0;
        int n = 0;
        for(int i = 1; i< 3; i++) {
            if(payoffs[i] > payoffs[m]) { n = m; m = i; }
        }
        return (voteCounts[n]>voteCounts[m]&&totalPayoffs[n]>totalPayoffs[m])||(voteCounts[m]+votersRemaining<voteCounts[n])||voteCounts[m]+votersRemaining<voteCounts[Math.min(3-n-m, 2)] ? n : m;
    }

    public void receiveResults(int[] voteCounts, double result) { }
}

It looks like you calculate a number that is the largest of three weights and than take that value mod 3 to pick the best candidate. Is that correct and if so isn't it basically a random number? I understand that you're calling this "math is hard Barbie", so I'm not sure I have the concept.

@RalphMarshall Yes, it's basically random. However, I totally did not intend to do that, wasn't paying attention, haha. Fixed it now.

@PhiNotPhi I think I've fixed it going out of range now. And yeah, I'm not surprised.

My god this is bad.. in my defense work was extremely mentally draining today.

The extremist
Always vote for the candidate with the lowest payoff
public class ExtremistBot implements Player
{
    public ExtremistBot(int e){}

    public void receiveResults(int[] voteCounts, double result){}

    public String getName(){
        return "ExtremistBot";
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        int min = 0;
        for(int i = 1; i<payoffs.length; i++){
            if(payoffs[i] <payoffs[min]){
                min = i;
            }
        }
        return min;
    }
}

SmashAttemptByEquality
The goal is to equalize all the candidats, then SMASH! all the other bots on the last round.
This is a destructive algorith that tries to bug out all the others, to claim the win.
public class SmashAttemptByEquality implements Player {
    static private int elections;

    public SmashAttemptByEquality(int e) {
        this.elections = e;
    }

    public String getName() {
        return "SmashAttemptByEquality (on " + String.valueOf(this.elections) + " elections)";
    }

    public int getVote(int[] voteCounts, int votersRemaining, int[] payoffs, int[] totalPayoffs) {

        //if there are no votes or it is a tie
        if(voteCounts.length == 0 || (voteCounts[0] == voteCounts[1] && voteCounts[1] == voteCounts[2]))
        {
            //let the system handle the (distributed?) randomness
            return 3;
        }

        //we want to win, so, lets not mess when there are no voters left
        if( votersRemaining > 0 )
        {
            //lets bring some equality!
            if( voteCounts[0] >= voteCounts[1] )
            {
                if(voteCounts[0] > voteCounts[2])
                {
                    return 2;
                }
                else
                {
                    return 0;
                }
            }
            else if( voteCounts[1] >= voteCounts[2] )
            {
                if(voteCounts[1] > voteCounts[0])
                {
                    return 0;
                }
                else
                {
                    return 1;
                }
            }
            else
            {
                return 0;
            }
        }
        else
        {
            //just play for the winner!
            if( voteCounts[0] >= voteCounts[1] )
            {
                if(voteCounts[0] > voteCounts[2])
                {
                    return 0;
                }
                else
                {
                    return 2;
                }
            }
            else if( voteCounts[1] >= voteCounts[2] )
            {
                if(voteCounts[1] > voteCounts[0])
                {
                    return 1;
                }
                else
                {
                    return 0;
                }
            }
            else
            {
                return 0;
            }
        }
    }

    public void receiveResults(int[] voteCounts, double result) { }
}

Notice that this is untested!

Basic Bot
Basic Bot just votes for the candidates that isn't eliminated and has the largest maximum payoff from those candidates.
public class BasicBot implements Player {
    public BasicBot(int e) { }
    public String getName()
    {
        return "BasicBot";
    }
    public static int getMax(int[] inputArray){
    int maxValue = inputArray[0];
    for(int i=1;i < inputArray.length;i++){
      if(inputArray[i] > maxValue){
         maxValue = inputArray[i];
      }
    }
    return maxValue;
   }
    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        // Check for Eliminated Candidates
        int eliminated0 = 0;
        int eliminated1 = 0;
        int eliminated2 = 0;
        if( ((voteCounts[0] + votersRemaining) < voteCounts[1]) || ((voteCounts[0] + votersRemaining) < voteCounts[2]))
        {
            eliminated0 = 1;
        }
        if( ((voteCounts[1] + votersRemaining) < voteCounts[0]) || ((voteCounts[1] + votersRemaining) < voteCounts[2]))
        {
            eliminated1 = 1;
        }
        if( ((voteCounts[2] + votersRemaining) < voteCounts[0]) || ((voteCounts[2] + votersRemaining) < voteCounts[1]))
        {
            eliminated2 = 1;
        }
        // Choose the Candidates that is not elimated with the largest payoff
        if ((payoffs[0] == getMax(payoffs)) && eliminated0 == 0)
            return 0
        else if ((payoffs[1] == getMax(payoffs)) && eliminated1 == 0)
            return 1
        else
            return 2

    }

    public void receiveResults(int[] voteCounts, double result)
    {
    }

}

CommunismBot
CommunismBot thinks we should all just get along and pick the candidate who is best for everyone.
public class CommunismBot implements Player
{
    Random rnd;
    String name;
    public CommunismBot(int e) {
        rnd = new Random();
        name = "CommunismBot" + rnd.nextInt(1000);
    }

    public String getName()
    {
        return name;
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        int maxloc = 0;
        for(int i = 1; i< 3; i++)
        {
            if(totalPayoffs[i] > totalPayoffs[maxloc])
            {
                maxloc = i;
            }
        }
        return maxloc;
    }

    public void receiveResults(int[] voteCounts, double result) { }
}

Hatebot
Hatebot always picks the best candidate. Unless they're a dirty-stinking-party 1. Those guys are awful.
import java.util.Random;

public class HateBot implements Player
{
    Random rnd;
    String name;
    public HateBot(int e) {
        rnd = new Random();
        name = "HateBot" + rnd.nextInt(1000); }

    public String getName()
    {
        return name;
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        if(payoffs[0]>payoffs[2])
            return 0;
        else
            return 2;
    }

    public void receiveResults(int[] voteCounts, double result) { }
}

StrategicBot
StrategicBot votes for the best candidate provided that they're within one standard deviation of the next best candidate, given the number of voters remaining.
import java.util.Random;

public class StrategicBot implements Player
{
    Random rnd;
    String name;
    public StrategicBot(int e) {
        rnd = new Random();
        name = "StrategicBot" + rnd.nextInt(1000);

    }

    public String getName()
    {
        return name;
    }

    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        double margin = 9.0*votersRemaining/9;
        int maxloc = 0;
        boolean noLead=false;
        for(int i = 1; i< 3; i++)
        {
            for(int j = 1; j < 3; j++)
            {
                if(payoffs[j] + margin > payoffs[i])
                    noLead=true;
            }
            if(payoffs[i] > payoffs[maxloc] && noLead)
            {
                maxloc = i;
            }
            noLead=false;
        }
        return maxloc;
    }

    public void receiveResults(int[] voteCounts, double result) { }
}

Kelly's Favorite
I started with CircumspectBot, but not much is left. Makes a sort of boring guess at the probability distribution of the remaining votes, and then makes the choice that maximizes its own log-utility (Kelly Criterion). Not the speediest, but within the ball park of some of the others. Also, it's fairly competitive with the field (as it stood when I started working on this, and downloaded the other bots).
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.HashMap;

public class KellysFavorite implements Player {
    private ArrayList<Double> cache = new ArrayList<Double>();

    public KellysFavorite(int elections) {
        cache.add(0.0);
        double v = 0.0;
        for(int i=1; i<1000; i++) {
            v += Math.log(i);
            cache.add(v);
        }
    }

    @Override
    public String getName() {
        return "Kelly's Favorite";
    }

    private double factln(int n) {
        return cache.get(n);
    }

    private  double binll(int x, int n, double p)
    {
        double ll = 0.0;
        ll += ((double)x)*Math.log(p);
        ll += ((double)(n - x))*Math.log(1.0 - p);
        ll += factln(n) - factln(x) - factln(n-x);
        return ll;
    }

    public  double logAdd(double logX, double logY) {
        // 1. make X the max
        if (logY > logX) {
            double temp = logX;
            logX = logY;
            logY = temp;
        }
        // 2. now X is bigger
        if (logX == Double.NEGATIVE_INFINITY) {
            return logX;
        }
        // 3. how far "down" (think decibels) is logY from logX?
        //    if it's really small (20 orders of magnitude smaller), then ignore
        double negDiff = logY - logX;
        if (negDiff < -20) {
            return logX;
        }
        // 4. otherwise use some nice algebra to stay in the log domain
        //    (except for negDiff)
        return logX + java.lang.Math.log(1.0 + java.lang.Math.exp(negDiff));
    }

    @Override
    public int getVote(int[] voteCounts,
                       int votersRemaining,
                       int[] payoffs,
                       int[] totalPayoffs) {
        int totalviable = 0;
        boolean[] viable = { false, false, false };
        int topVote = Arrays.stream(voteCounts).max().getAsInt();
        for (int index = 0; index < 3; index++) {
            if (voteCounts[index] + votersRemaining + 1 >= topVote) {
                viable[index] = true;
                totalviable += 1;
            }
        }

        // if only one candidate remains viable, vote for them
        if(totalviable == 1) {
            for(int index = 0; index < 3; index++)
                if(viable[index])
                    return index;
        } else {
            double votelikelihoods[] = { 0.0, 0.0, 0.0 };
            double totalweight = 0.0;
            for(int index=0; index<3; index++) {
                if(!viable[index])
                    votelikelihoods[index] -= 10.0;
                else if(voteCounts[index] < topVote)
                    votelikelihoods[index] -= 0.1;

                totalweight += Math.exp(votelikelihoods[index]);
            }

            double probs[] = new double[3];
            for(int index=0; index<3; index++) {
                probs[index] = Math.exp(votelikelihoods[index]) / totalweight;
            }

            double[] utilities = {0,0,0};
            for(int mychoice=0; mychoice<3; mychoice++) {
                boolean seen[] = { false, false, false };
                double likelihoods[] = { Double.NEGATIVE_INFINITY,
                                         Double.NEGATIVE_INFINITY,
                                         Double.NEGATIVE_INFINITY };
                int[] localVoteCounts = { voteCounts[0] + (mychoice==0?1:0),
                                          voteCounts[1] + (mychoice==1?1:0),
                                          voteCounts[2] + (mychoice==2?1:0) };
                for(int iVotes=0; iVotes<=votersRemaining; iVotes++)
                    for(int jVotes=0; jVotes<=(votersRemaining-iVotes); jVotes++) {
                        int kVotes = votersRemaining - iVotes - jVotes;

                        int a = localVoteCounts[0] + iVotes;
                        int b = localVoteCounts[1] + jVotes;
                        int c = localVoteCounts[2] + kVotes;
                        int wincount = Math.max(a, Math.max(b, c));
                        int winners = 0;
                        if(a>=wincount) { winners += 1; }
                        if(b>=wincount) { winners += 1; }
                        if(c>=wincount) { winners += 1; }

                        double likelihood =
                            binll(iVotes, votersRemaining, probs[0])
                            + binll(jVotes, votersRemaining-iVotes, probs[1] / (probs[1] + probs[2]));

                        likelihood += Math.log(1.0/winners);

                        if(a>=wincount) {
                            if(seen[0])
                                likelihoods[0] = logAdd(likelihoods[0],
                                                        likelihood);
                            else
                                likelihoods[0] = likelihood;
                            seen[0] = true;
                        }
                        if(b>=wincount) {
                            if(seen[1])
                                likelihoods[1] = logAdd(likelihoods[1],
                                                        likelihood);
                            else
                                likelihoods[1] = likelihood;
                            seen[1] = true;
                        }
                        if(c>=wincount) {
                            if(seen[2])
                                likelihoods[2] = logAdd(likelihoods[2],
                                                        likelihood);
                            else
                                likelihoods[2] = likelihood;
                            seen[2] = true;
                        }

                    }

                for(int index=0; index<3; index++)
                    utilities[mychoice] += Math.exp(likelihoods[index]) * Math.log((double)payoffs[index]);
            }

            double maxutility = Math.max(utilities[0], Math.max(utilities[1], utilities[2]));
            int choice = 0;
            for(int index=0; index<3; index++)
                if(utilities[index]>=maxutility)
                    choice = index;
            return choice;
        }

        throw new InternalError();
    }

    @Override
    public void receiveResults(int[] voteCounts, double result) {

    }

}

Also available at https://gist.github.com/jkominek/dae0b3158dcd253e09e5 in case that's simpler.

ExpectorBot
Tries to predict how all other Bots will vote by calculating average Payout for the others. Default votes for best payoff, but will vote for second best, if it has more expected votes than the best, a better than average payout for me and the worst-payout has a chance of winning this thing.
import java.util.Arrays;

public class ExpectorBot implements Player
{
    class Votee
    {
        int index;
        int payoff;
        float avgPayoff;
        float expectedVotes;
    }

    public ExpectorBot( final int e )
    {

    }

    @Override
    public String getName()
    {
        return "ExpectorBot";
    }

    @Override
    public int getVote( final int[] voteCounts, final int votersRemaining, final int[] payoffs, final int[] totalPayoffs )
    {
        final int otherVoters = Arrays.stream( voteCounts ).sum() + votersRemaining;
        final Votee[] v = createVotees( voteCounts, otherVoters, votersRemaining, payoffs, totalPayoffs );

        final Votee best = v[ 0 ]; // Most Payoff
        final Votee second = v[ 1 ];
        final Votee worst = v[ 2 ];

        int voteFor = best.index;

        if( ( second.expectedVotes >= best.expectedVotes + 1 ) // Second has more votes than Best even after I vote
                && ( second.payoff >= second.avgPayoff ) // Second payoff better than average for the others
                && ( worst.expectedVotes >= best.expectedVotes + 0.5f ) ) // Worst has a chance to win
        {
            voteFor = second.index;
        }

        return voteFor;
    }

    private Votee[] createVotees( final int[] voteCounts, final int otherVoters, final int votersRemaining, final int[] payoffs, final int[] totalPayoffs )
    {
        final Votee[] v = new Votee[ 3 ];

        for( int i = 0; i < 3; ++i )
        {
            v[ i ] = new Votee();
            v[ i ].index = i;
            v[ i ].payoff = payoffs[ i ];

            // This is the average payoff for other Players from this Votee
            v[ i ].avgPayoff = (float)( totalPayoffs[ i ] - payoffs[ i ] ) / otherVoters;

            // The expected number of Votes he will get if everyone votes for biggest payoff
            v[ i ].expectedVotes = voteCounts[ i ] + ( votersRemaining * v[ i ].avgPayoff / 100.0f );
        }

        Arrays.sort( v, ( o1, o2 ) -> o2.payoff - o1.payoff );

        return v;
    }

    @Override
    public void receiveResults( final int[] voteCounts, final double result )
    {

    }
}

LockBot
Just a lonely philosopher, looking for his "e"...
//He thinks he's the father of democracy, but something's missing....
public class LockBot implements Player {

public LockBot(int i) {
    //One election, 10000000, what's the difference?
}

@Override
public String getName() {
    return "LockBot";
}

@Override
public int getVote(int[] voteCounts, int votersRemaining, int[] payoffs,
        int[] totalPayoffs) {

    double totalPlayers = voteCounts.length + votersRemaining;
    double totalPayoff = totalPlayers * 100;

    //adjust total payoffs to ignore my own
    for( int i = 0; i < totalPayoffs.length; i++){
        totalPayoffs[i] -= payoffs[i];
    }

    //Votes are probably proportional to payoffs
    //So lets just find the highest weight
    double[] expectedOutcome = new double[3];
    for(int i = 0; i< expectedOutcome.length; i++){
        expectedOutcome[i] = (totalPayoffs[i] / totalPayoff) * payoffs[i];
    }

    //Find the highest
    int choice = 0;
    if(expectedOutcome[1] > expectedOutcome[choice]){
        choice = 1;
    }
    if(expectedOutcome[2] > expectedOutcome[choice]){
        choice = 2;
    }

    return choice;
}

@Override
public void receiveResults(int[] voteCounts, double result) {
    // TODO Auto-generated method stub

}

}

WinLose
If you win, I lose! That simple. So this bot votes for the one that he likes and everyone else dislikes.
public class WinLose implements Player
{
    public WinLose(int e) { }

    public String getName()
    {
        return "WinLose";
    }
    public int getVote(int [] voteCounts, int votersRemaining, int [] payoffs, int[] totalPayoffs)
    {
        int max = 0;
        for(int i = 1; i< 3; i++)
        {
            if(10*payoffs[i]-totalPayoffs[i] > 10*payoffs[max]-totalPayoffs[max])
            {
                max = i;
            }
        }
        return max;
    }

    public void receiveResults(int[] voteCounts, double result)
    {

    }
}


text:
Settlers of Catan - Longest Road!
This is an endgame board of Settlers of Catan:

Background:
The roads (the long stick pieces) and the settlements (and cities) are rendered by the little huts. We encode the placement of these pieces by using the following scheme: From the top, we have a row horizontal vertices and edges where a road can be placed. Then we have a column of only roads, and so forth. Using R for Red, O for Orange, and B for Blue, and _ for nothing, the pictured board would be encoded as:
________RR_R_
__R_
__RR_R_RRR_____R_
B___R
_B_________B__OO_OOR_
B__B_R
BB_BBB_____B____RR_R_
OBB_O
OO__BB_BB__OOO_OO
O_O_
_O_OOO_O_____

A board like this will be your input string. Any letter [A-Z] may indicate a player color, but there will at most four colors (including empty). Boards are otherwise guaranteed to be valid according to the rules of Settlers, which means:

Each color will have at most two contiguous road networks, which may or may not be broken apart by other players settlements / cities (vertex buildings). See the orange settlement breaking apart the red road on the right side of the sample image.

Each road network is guaranteed to have at least one settlement.

All settlements and cities are guaranteed to be at least two edges from the nearest other settlement / city (yours or otherwise)
One player may only have 15 roads on the game board.
For Catan enthusiasts: there is no distinction between settlements and cities for the purpose of this problem, so I don't distinguish in the input string.

All this is for the specification of the "input" string.
Longest Road:
In Settlers, players get two victory points for having the "longest road". This is defined to be: The longest contiguous single path (measured in roads) from start point to end point, that is not broken up by an opponents settlement or city. Cycles are okay, as long as you can trace the path from one particular start point to one particular end point. So, a loop of 6 roads plus one road branching off is length 7, but one with two branching off the 6 road loop on opposite sides is still only worth 7.
In the example map, the Red road on the right side is only worth 4, because he is cut off by an Orange settlement on the right side of the board (that's why settlements are included at all). Blue has a road of length 13, and Orange has a road of length 12. Red's top road is only worth 7, because it doesn't connect to the two single roads next to it.
Output:
All players that have a road of the longest length (it could be more than one if there are ties), followed by a whitespace and/or underscore delimited count in base 10 of how long that road is.
So the output for the example board would be:
B 13

The Problem statement:
You may write a program or function, receives the input board via STDIN or as a string argument to your function, which returns the output described above as a string or prints it to STDOUT (or closest alternative). You may optionally include a single trailing newline in the output.
This is code-golf, shortest program wins. Standard loopholes are banned, of course.

The real problem statement: Orange player is a jerk.

From the top, we have a row horizontal vertices and edges where a road can be placed. Then we have a column of only roads, and so forth.  It took me several minutes to figure out what this meant.  You should explain more clearly that the horizontal rows also include the settlements and settlement locations.

@corsiKa I have had someone do that to me before!

The orange and red in the image are really similar. You should've picked another color.

Python 2, 445 400 bytes
I'm a fan of Settlers, so this challenge was fun.
T="^"
Z=26
A=T*52
for i in range(11):A+=(T*(i%2)*3).join(x for x in raw_input()).center(Z,T)
A+=T*52
def f(c,p=0,l=0,B=A):
 b=l;C=B[0:p]+T+B[p+1:];n=(Z,1)[p%2]
 for i in(p<1)*range(390):
    if(i/Z%2<1&i%2>0)|(i/Z%2>0&i%2<1):b=max(b,f(c,i))
 for i in(p-n,p+n)*(B[p]==c):
    for j in(i-Z,i-1,i+1,i+Z)*(B[i]in c+"_"):b=max(b,f(c,j,l+1,C))
 return b
i=l=0
for x in A:
 if x<T:i=f(x)
 if i>l:c=x;l=i
print c,l

Score reflects replacing each occurrence of 4 spaces with a tab.
Explanation
The lines before the function definition read the input, and build a normalized board into a single string variable.  The process inserts "^" characters into the short lines representing the vertical road segments.  It also pads the board with "^" characters.
^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^________RR_R_^^^^^^^
^^^^^^_^^^_^^^R^^^_^^^^^^^
^^^^__RR_R_RRR_____R_^^^^^
^^^^B^^^_^^^_^^^_^^^R^^^^^
^^_B_________B__OO_OOR_^^^
^^B^^^_^^^_^^^B^^^_^^^R^^^
^^BB_BBB_____B____RR_R_^^^
^^^^O^^^B^^^B^^^_^^^O^^^^^
^^^^OO__BB_BB__OOO_OO^^^^^
^^^^^^O^^^_^^^O^^^_^^^^^^^
^^^^^^_O_OOO_O_____^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^

When called with the default parameters, the function returns the length of a road of a given color.  The first loop is active only when the position (p) parameter was supplied.  It recursively finds the length of the road at each valid road position, and keeps track of the longest one.  When there is a road at the position parameter, the function recursively adds the length of adjacent roads of the same color.  The road is replaced with a "~" in the working copy of the board to ensure it doesn't recount segments that have already been counted.
The code following the function definition calls the function for each color in the board, and prints the highest scoring color and length.
Demo it here

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Recursive Prime Factorization
Your job is to take the prime factors of a number taken from input (omitting any exponents equal to 1) then take the prime factors of all of the exponents, and so on, until no composite numbers remain; and then output the result.
To make what I'm asking slightly clearer, here's a javascript program that does it, but, at 782 bytes, it's not very well golfed yet:
var primes=[2,3];
function nextPrime(){
    var n=2;
    while(isAMultipleOfAKnownPrime(n)){n++}
    primes.push(n);
}
function isAKnownPrime(n){return primes.indexOf(n)!=-1};
function isAMultipleOfAKnownPrime(n){
    for(var i=0;i<primes.length;i++)if(n%primes[i]==0)return true;
    return false;
}
function primeFactorize(n){
    while(primes[primes.length-1]<n)nextPrime();
    if(isAKnownPrime(n)||n==1)return n;
    var q=[];while(q.length<=n)q.push(0);
    while(n!=1){
        for(var i=0;i<primes.length;i++){
            var x=primes[i];
            if(n%x==0){q[x]++;n/=x}
        }
    }
    var o="";
    for(var i=2;i<q.length;i++){
        if(q[i]){if(o)o+="x";o+=i;if(q[i]>1){o+="^("+primeFactorize(q[i])+")"}}
    }
    return o;
}
alert(primeFactorize(+prompt()));

You are required to make order of operations as clear as possible, and sort the prime factors in ascending order on each level.
You get a -50 byte bonus if you produce the output as formatted mathprint or valid latex code.

It would help to provide examples of input and output.

Could you give some example inputs and outputs? I'm having trouble understanding your spec, and the example solution is quite terse.

@Zgarb He means to factor the integer, factor the primes' exponents, factor their exponents, etc., until you are left with all prime numbers.

What exactly do you understand as "formatted mathprint". Is it for instance  allowed to print latex code?

@LegionMammal978 The output format is still unclear to me, unless it's required to match that of the javascript example.

@Zgarb Any format that works (ex. 2^(5^11*11^(2^7))*541).

How about "You get a -50 byte bonus if you produce the output as formatted LaTeX", e.g. a string that correctly renders in http://www.sciweavers.org/free-online-latex-equation-editor

Would my answer count as formatted mathprint?

It looks like it does from the example outputs you gave. I'm still trying to figure out how to test it.

Okay, I figured it out. However, WolframProgrammingCloud is running a bit slow. Any suggestions?

And now it's suddenly improved a bit. Also, your answer is YES.

Can our output contain extraneous ^1?

@MartinBüttner No.

Should bonuses be allowed for code-golf questions?

CJam, 32 31 29 27 25 - 50 = -25 bytes
7 bytes saved by Dennis.
Woooo, Dennis reduced this by an amazing seven bytes and managed to beat Pyth!
q~S2*{mF{~'^'{@j'}'*}/;}j

Test it here.
Explanation
q~                           e# Read and eval input.
  S2*                        e# Push the string "  ". The second space will be our
                             e# memoised result for input 1. This way, 1-exponents become
                             e# ^{ } later which do not affect the rendered output of the
                             e# generated LaTeX.
     {                 }j    e# Initialise a recursion with the above base case.
      mF                     e# Compute prime factorisation as list of pairs.
        {           }/       e# For each pair...
         ~'^'{@              e# Unwrap the pair and put a '^' and a '{' in the middle.
               j             e# Recursively run the outer block on the exponent.
                '}'*         e# Push a '}' and a '*' character.
                      ;      e# Discard the last '*'.

All those stack contents will be printed automatically back-to-back at the end of the program.

"{}" -> {}s Looks like you've figured out how j works.

@Dennis I think I've been using j for a while. user23013 posted a nice explanation on Mixed Base Conversion, and aditsu a few clarifying remarks for advanced usage somewhere on SourceForge.

aditsu actually answered a forum post of mine, but SF didn't notify me and I stopped checking after a couple of month... While j is pretty cool, a named function would be shorter here: {mF{)_({Fa+'^}&*}%'**{}s\*}:F

@Dennis Oh right, I didn't consider that I could actually make it a function-only submission if I used the named function approach. Will change the answer later.

Same byte count, but keeping memoization: q~S{}+{mF{~ja+'^*}%'**{}s\*}j

@Dennis that's really clever. I'm gonna go with the function version for now though, because it gives the neater output (will switch though if the other approach can actually beat 29 bytes).

27 bytes: q~S{}+{'{\mF{~'^\j'*}/;'}}j

@Dennis Ah nice, I was looking for something like this earlier, that didn't require a+ but couldn't figure it out.

25 bytes: q~S2*{mF{~'^'{@j'}'*}/;}j

@Dennis Amazing! :D At this point this is more your answer than mine :P

Pyth, 27 - 50 = -23 bytes
Lj\*m+ed?+\^jyhd`HthdkrPb8

This defines a recursive function y. Try it online: Demonstration
The output is valid LaTeX code, so I claim the bonus. The call y66430125 returns the string 3^{2^{2}*3}*5^{3}, which renders to

Quite proud for finding a way to print the curly brackets without using curly brackets in my code.
Explanation:
L                            define a function y(b): return ...
                       Pb       prime factorization of b
                      r  8      run-length-encoded, gives pairs of (exponent, prime)
    m                           map each pair d (exponent, prime) to:
      ed                          prime
     +                            +
             yhd                    recursive call
            j   `H                  join repr(H) by ^
                                      H is preinitialized with an empty dictionary
                                      so the repr(H) gives the string "{}"
                                      and join inserts the prime-factorization
                                      of the exponent between the chars of "{}"

         +\^                        add "^" at the beginning
        ?         thd               if exponent - 1 != 0 else
                     k              "" (empty string)
 j\*                            join by "*"

@SuperJedi224 Yes, your right. Using an old approach this one was shorter. But now, that I found the repr(H) trick, it doesn't matter. So I edited it right now.

By the way {} is the empty dictionary in Python, not the empty set.

Pyth - 39 34 32 28 bytes
Thanks Jakube
Defines a function y which takes an integer:
L?j\xm+ed+"^("+yhd\)rPb8tPbb

Explanation:
L                              define y(b): return
  j\x                              "x".join(
     m                                 map(lambda d:
      +ed+"^("+yhd\)                       d[1] + "^(" + y(d[0]) + ")",
                    rPb8                   tally(prime_factors(b))))
 ?                      tPb        if len(prime_factors(b)) != 1 else
                           b           b

If ^(1) isn't allowed I have to use 33 bytes:
L?j\xm+ed?+"^("+yhd\)thdkrPb8tPbb

Mathematica, 106 102 101 - 50 = 51 bytes
If[PrimeQ@#,#,(a=CenterDot)@@{b,c}~Function~If[c<2,b,b~Superscript~#0@c]@@@FactorInteger@#/.a@b_:>b]&

Formats as nested exponents with dot multiplication. Unicode representations of example input and output:

10 → 2 · 5
120 → 2³ · 3 · 5
16384 → 2²˙⁷

Nice use of CenterDot to avoid Times.  I'm still trying to figure out where the recursion takes place.

@DavidCarraher #0 refers to the innermost pure function without argument names.

Thanks. First time I have heard about this use of #

Bash + coreutils + bsdgames, 117 - 50 = 67
f()(factor $1|tr \  \\n|sed 1d|uniq -c|while read e m;do
((e>1))&&m+=^{`f $e`}
printf {$m}
done)
f $1|sed s/}{/}\*{/g

Output
$ ./recprimefac.sh 2985984
{2^{{2^{{2}}}*{3}}}*{3^{{2}*{3}}} $
$

I'm claiming the -50 bonus, because this output is LaTeX formatted and with a tool like http://www.sciweavers.org/free-online-latex-equation-editor renders to:

Let me know if this is not acceptable.

That works fine.

Clip, 36 33
jm[z.y(z?()z{'^'(M)z')`]L]}qfnx"*

Explanation
                            qfnx   .- Prime factors of the input, with exponents -.
  m[z                      }       .- For each factor z...               -.
     .y(z                          .- The prime number                   -.
         ?()z            L]        .- If the exponent is 1, nothing      -.
             {         `]          .- Otherwise, the following:          -.
                  M)z              .- Apply the main function to the exponent... -.
              '^'(   ')            .- ...inside ^(..)                    -.
 j                              "* .- Join the factors with "*"          -.

Javascript, 388-50=338
l="length";function g(n){for(;m(++n););p.push(n)}function m(n){for(i=0;i<p[l];i++)if(n%p[i]==0)return 1;return 0}function f(n,x,q,o){while(p[p[l]-1]<n)g(2);if(p.indexOf(n)>=0||n==1)return n;q=[];while(q[l]<=n)q.push(0);for(i=0;i<p[l];i++){x=p[i];while(n%x==0){q[x]++;n/=x}}o="";for(i=2;i<q[l];i++)if(q[i]){if(o)o+="*";o+=i;if(q[i]>1){o+="^{"+f(q[i])+"}"}}return o}alert(f(+prompt(p=[2])))

Since LaTeX code is now eligible for the bonus, I decided to include the requisite modifications as part of the golfing for this. It can probably still be golfed further though.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Write A Program That Outputs Its Mirror Level
There are 95 printable ASCII characters:
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

In the Consolas font (the Stack Exchange code block default), some of the characters have mirrors around a vertical axis of symmetry:

These pairs of characters are mirrors of each other: () [] {} <> /\
These characters are mirrors of themselves: ! "'*+-.8:=AHIMOTUVWXY^_ovwx| (Note that space is one.)
These do not have mirrors: #$%&,012345679;?@BCDEFGJKLNPQRSZ`abcdefghijklmnpqrstuyz~

(i, l, 0, #, and probably other characters are their own mirrors in some fonts but we'll stick to the Consolas shapes.)
A string is said to be a mirror of itself if it is made with only the 39 mirror characters, arranged such that the string has a central vertical line of symmetry. So ](A--A)[ is a mirror of itself but ](A--A(] is not.
Write a one-line even-length program that is a mirror of itself. When N copies of its left half have been prepended to it and N copies of its right half have been appended to it, it should output N+1. N is a non-negative integer.
For example, if the program was ](A--A)[ (left half: ](A-, right half: -A)[), then:

Running ](A--A)[ should output 1. (N = 0)
Running ](A-](A--A)[-A)[ should output 2. (N = 1)
Running ](A-](A-](A--A)[-A)[-A)[ should output 3. (N = 2)
Running ](A-](A-](A-](A--A)[-A)[-A)[-A)[ should output 4. (N = 3)
. . .
Running ](A-](A-](A-](A-](A-](A-](A-](A-](A-](A--A)[-A)[-A)[-A)[-A)[-A)[-A)[-A)[-A)[-A)[ should output 10. (N = 9)
etc.

Rules

Output to stdout or your language's closest alternative. There may be an optional trailing newline. No input should be taken.
The process should theoretically work for N up to 215-1 or beyond, given enough memory and computing power.
A full program is required, not just a REPL command.

The shortest initial program (N = 0 case) in bytes wins.

In some fonts, # is its own relection as well, but, you're right, not in consolas.

Using repls is allowed? In other words: should we write a complete valid program or an expression is enough? I'm thinking about the Haskell entry which would work when running in ghci but isn't a valid complete program.

@Bakuriu A full program is required. The Haskell answer is invalid.

Why aren't 'b' and 'd' mirrors of eachother? It makes my plan impossible :P

@ThijsterHaar I actually didn't consider that but it looks like their Consolas shapes are just slightly different, sorry :P

Would var rav;;var rav qualify for this? It would output nothing. In Javascript, null, undefined, false, 0 and '' all are 'the same'. So, technically, this would be outputting it's mirror level. If that qualified, would ;; qualify as well?

@Calvin'sHobbies What do you mean?

But 0 is positive AND negative...

Let us continue this discussion in chat.

Pip, 12 8 4 bytes
Now with 66% fewer bytes!
x++x

x is a variable, preinitialized to "". In numeric context, this becomes 0.
The first half, sans the final +, makes an expression of the form x+x+...+x. This is a valid statement that does nothing.
The second half, including the final + from the first half, makes an expression of the form ++x+x+...+x. ++x increments x to 1, and the rest adds it to itself N times. Because expressions are evaluated left-to-right in Pip, the increment is guaranteed to happen first, and the result is equal to the number of mirror levels.
At the end, the value of this expression is auto-printed.

Unfortunately, Pip doesn't do well processing huge expressions: this solution causes a maximum recursion depth exceeded error for N above 500 or so. Here's a previous solution that doesn't, for 8 bytes:
x++oo++x

More on Pip

OK, unless somebody posts a 2 byte answer, looks like you got this one in the bag. By the way, I don't know if you've run it with N = 32767, but the actual output is Fatal error: maximum recursion depth exceeded while calling a Python object.

@Dennis Yeah, I ran into that actually--it starts quite early, around 600 if not before.  The reason is that expressions are evaluated by recursively evaluating all subexpressions first, so x+x+...+x generates O(N) depth of recursion.  Maybe that invalidates this answer.  I'll add a note.

The recursion limit is easily adjustable in Python, isn't it?

@Dennis Yes, although there are dire warnings about what it'll do to your system if you set it too high, so I've never tried it. ;) Besides, configuring it isn't possible from within Pip, so it seems kinda like cheating to me.  If you want to try it, though, I'd be interested in hearing the results.

I've tried. On my machine, increasing the recursion limit to 20000 already segfaults. But since the answer has to work only given enough memory and computing power, that shouldn't be a problem.

Ah, that's helpful.  I hadn't noticed theoretically in the problem description.

@DLosc About those dire warnings - Pyth's recursion limit is purposefully set high enough that it regularly segfaults. I've never noticed any other issue.

@isaacg Good to know.  ("Dire" was a bit of hyperbole on my part.  I just didn't know if it would cause system instability or not.)

Fun fact: trying to evaluate an expression that long even crashes Python.

GolfScript, 10 bytes
!:{)::(}:!

Try it online with Web Golfscript: N = 0, N = 1, N = 2, N = 3, N = 41
Web GolfScript has a 1024 character limit, but the Ruby interpreter handles N = 32767 perfectly:
$ curl -Ss http://www.golfscript.com/golfscript/golfscript.rb > golfscript.rb
$ echo '"!:{):"32768*":(}:!"32768*' | ruby golfscript.rb > mirror-level-32767.gs
$ ruby golfscript.rb mirror-level-32767.gs
32768

How it works
Without any input, GolfScript initially has an empty string on the stack.
In the first left half, the following happens:

! applies logical NOT to the empty string. This pushes 1.
:{ saves the integer on the stack in the variable {.
Yes, that is a valid identifier, although there's no way to retrieve the stored value.
) increments the integer on the stack.
: is an incomplete instruction.

The the subsequent left halves, the following happens:

:! (where : is a leftover from before) saves the integer on the stack in the variable !.
Yes, that is also a valid identifier. This breaks the ! command, but we don't use it anymore.
:{, ) and : work as before.

In the first right half, the following happens:

:: (where : is a leftover from before) saves the integer on the stack in the variable :.
Yes, even that is valid identifier. As with {, there's no way to retrieve the stored value.
( decrements the integer on the stack, yielding the number of left halves.
}, since it is unmatched and terminates execution immediately.
This is an undocumented feature. I call them supercomments.

The remaining code is simply ignored.

It seems really weird to have an unmatched } in the 2nd half of your code in a mirror competition.

It's a common trick in palindrome variants. In "\""/", the fourth double quote would be unmatched as well since the second one has been escaped.

Z80 Machine Code, 8 6 bytes*
<8ww8> * Assumes certain conditions by entering from Amstrad BASIC
<   INC A         // A=A+1
8w  JR C, #77     ## C is unset unless A has overflowed, does nothing

w   LD (HL), A    // Saves A to memory location in HL (randomly initialised)
8>  JR C, #3E     ## C is still unset, does nothing

A is initially 0 when entered from BASIC. It increments A n times, then writes it n times to the same memory location (which is set to a slightly random location by BASIC)! The JR Jump Relative operation never does anything since the C flag is always unset, so is used to "comment out" the following byte! This version is slightly cheating by assuming certain entry conditions, namely entering from BASIC guarantees that A is always 0. The location of (HL) is not guaranteed to be safe, and in fact, is probably a dangerous location. The below code is much more robust which is why it's so much longer.
Z80 Machine Code, 30 bytes
As ASCII:
o!.ww.!>A=o>{))((}<o=A<!.ww.!o
Basically, the first half guarantees creation of a zero value and the second half increments it and writes it to memory. In the expanded version below ## denotes code that serves no purpose in its half of the mirror.
o   LD L, A       ##
!.w LD HL, #772E  // Load specific address to not corrupt random memory!
w   LD (HL), A    ## Save random contents of A to memory
.!  LD L, #21     ##
>A  LD A, #41     // A=#41
=   DEC A         // A=#40
o   LD L, A       // L=#40
>{  LD A, #7B     ##
)   ADD HL, HL    // HL=#EE80
)   ADD HL, HL    // HL=#DD00. L=#00 at this point

((  JR Z, #28     ##
}   LD A, L       // A=L
<   INC A         // A=L+1
o   LD L, A       // L=L+1
=   DEC A         // A=L
A   LD B, C       ##
<   INC A         // A=L+1
!.w LD HL, #772E  // Load address back into HL
w   LD (HL), A    // Save contents of A to memory
.!  LD L, #21     ##
o   LD L, A       // L=A

Breakdown of allowed instructions:
n   op    description
--  ----  -----------
28  LD    LoaD 8-bit or 16-bit register
3   DEC   DECrement 8-bit or 16-bit register
1   INC   INCrement 8-bit or 16-bit register
1   ADD   ADD 8-bit or 16-bit register

Available but useless instructions:
3   JR    Jump Relative to signed 8-bit offset
1   DAA   Decimal Adjust Accumulator (treats the A register as two decimal digits
          instead of two hexadecimal digits and adjusts it if necessary)
1   CPL   1s ComPLement A
1   HALT  HALT the CPU until an interrupt is received

Out of the 39 instructions allowed, 28 are load operations (the block from 0x40 to 0x7F are all single byte LD instructions), most of which are of no help here! The only load to memory instruction still allowed is LD (HL), A which means I have to store the value in A. Since A is the only register left with an allowed INC instruction this is actually quite handy!
I can't load A with 0x00 to start with because ASCII 0x00 is not an allowed character! All the available values are far from 0 and all mathematical and logical instructions have been disallowed! Except... I can still do ADD HL, HL, add 16-bit HL to itself! Apart from directly loading values (no use here!), INCrementing A and DECrementing A, L or HL this is the only way I have of changing the value of a register! There is actually one specialised instruction that could be helpful in the first half but a pain to work around in the second half, and a ones-complement instruction that is almost useless here and would just take up space.
So, I found the closest value to 0 I could: 0x41. How is that close to 0? In binary it is 0x01000001. So I decrement it, load it into L and do ADD HL, HL twice! L is now zero, which I load back into A! Unfortunately, the ASCII code for ADD HL, HL is ) so I now need to use ( twice. Fortunately, ( is JR Z, e, where e is the next byte. So it gobbles up the second byte and I just need to make sure it doesn't do anything by being careful with the Z flag! The last instruction to affect the Z flag was DEC A (counter-intuitively, ADD HL, HL doesn't change it) and since I know that A was 0x40 at that point it's guaranteed that Z is not set.
The first instruction in the second half JR Z, #28 will do nothing the first 255 times because the Z flag can only be set if A has overflowed from 255 to 0. After that the output will be wrong, however since it's only saving 8-bits values anyway that shouldn't matter. The code shouldn't be expanded more than 255 times.
The code has to be executed as a snippet since all available ways of returning cleanly have been disallowed. All the RETurn instructions are above 0x80 and the few Jump operations allowed can only jump to a positive offset, because all 8-bit negative values have been disallowed too!

WHAT.  WHAT IS THIS.

Now I've seen this answer, using GolfScript/J/etc. just seems like cheating. :p

Are there Z80-compatible processors with a 16-bit A register? I'm asking since the question requires the code has to work for N = 32767.

@Dennis For a program to work for N = 32767 it must be at least 2 x 32767 or 65534 bytes long. The Z80 can only address 65536 bytes of memory, making this an impossible task since I don't believe I can make the program smaller than 6 bytes! The A register is always 8 bits, otherwise the processor would not be compatible with the Z80. I would say that given enough memory and computing power has been covered off here!

16-bit version using forbidden instruction # (INC HL): o#8"}88{"8#o (12 bytes). Can fit into memory 5461 times but due to safe memory restrictions can actually only go 2800 times.

It was more of a curiosity. I'm not the one to judge this answer's validity and it's certainly ingenious, but you'll have to admit that using machine code that, by definition, cannot work for a processor that understands it is a little bold. Then again, this is code golf, where rules are meant to be bent.

@Dennis What do you mean by code that doesn't work for the processor? All the code I've posted runs just fine on a Z80. If you're referring to "a 16-bit A register" then that is the register pair HL. The only solutions I've found using HL (for a 16-bit version) either use instructions forbidden by this contest or output more than just the number required, which I believe would make it invalid. I believe my answer fully complies with the spirit of this question, even if not entirely the letter.

I meant that, while your code works for small values of N and could in theory work for larger ones, the compatible processors are incapable of handling the largest test case. I fully agree wirh your last sentence.

@Dennis You understand why no Z80 compatible processor will have an A register of anything other than 8 bits? Changing it to 16-bits would break code relying on 255+1=0 for example. You would have to invent a CPU, lets call it the Z160, that uses a default 16-bit register but still uses the same 8-bit instruction set from the Z80. Weird!

J, 16 14 bytes
(_=_)]++[(_=_)

Usages:
   (_=_)]++[(_=_)
1
   (_=_)]+(_=_)]++[(_=_)+[(_=_)
2
   (_=_)]+(_=_)]+(_=_)]++[(_=_)+[(_=_)+[(_=_)
3

Explanation:

J evaluates from right to left.
(_=_) is inf equals inf which is true, has a value of 1, so the expression becomes 1+]...[+1. ((8=8) would also work but this looks cooler. :))
[ and ] return their the left and right arguments respectively if they have 2 arguments. If they get only 1 they return that.
+ adds the 2 arguments. If it gets only 1 it returns that.

Now let's evaluate a level 3 expression (going from right to left):
(_=_)]+(_=_)]++[(_=_)+[(_=_)  NB. (_=_) is 1

1]+1]+1]++[1+[1+[1  NB. unary [, binary +

1]+1]+1]++[1+[2  NB. unary [, binary +

1]+1]+1]++[3  NB. unary [, unary +

1]+1]+1]+3  NB. unary +, binary ]

1]+1]+3  NB. unary +, binary ]

1]+3  NB. unary +, binary ]

3

As we see the right half of the 1's gets added and the left side of the 1's gets omitted resulting in the desired integer N, the mirror level.
Try it online here.

CJam, 14 bytes
]X+:+OooO+:+X[

Try it online in the CJam interpreter: N = 0, N = 1, N = 2, N = 3, N = 41
Note that this code finishes with an error message. Using the Java interpreter, that error message can be suppressed by closing or redirecting STDERR.1
How it works
In the left halves, the following happens:

] wraps the entire stack in an array.
X appends 1 to that array.
:+ computes the sum of all array elements.
Oo prints the contents of empty array (i.e., nothing).

In the first right half, the following happens:

o prints the integer on the stack, which is the desired output.
O+ attempts to append an empty array to the topmost item of the stack.
However, the stack was empty before pushing O. This fails and terminates the execution of the program.

The remaining code is simply ignored.
1According to the meta poll Should submissions be allowed to exit with an error?, this is allowed.

I'd be skeptical on accepting this due to the error thing, but since its not winning I'm not too concerned.

Tasks like this one are suprisingly hard in CJam, considering that it is a golfing language. Even a syntax error (e.g., an undefined operator) in a unexecuted block will prevent the entire program from executing. I'm still trying to get rid of the error.

Haskell, 42 bytes
(8-8)-(-(8-8)^(8-8))--((8-8)^(8-8)-)-(8-8)

Luckily a line comment in Haskell (-> --) is mirrorable and half of it (-> -) is a valid function. The rest is some math to get the numbers 0 and 1. Basically we have (0)-(-1) with a comment for N=0 and prepend (0)-(-1)- in each step.
If floating point numbers are allowed for output, we can build 1 from 8/8 and get by with 26 bytes:
Haskell, 26 bytes
(8-8)-(-8/8)--(8\8-)-(8-8)

Outputs 1.0, 2.0, etc.

This is technically invalid since it must be a full program.

@Calvin'sHobbies: I see. Do we have consensus on the minimum requirements for a full program? I've searched meta, but only found a discussion about functions, not programs. Depending on the definition of a full program I might be able to fix my solution.

I'd call it a full program if you can save it in a file program.hs and then run $ runhaskell program.hs from the command line and see the output. I don't know Haskell so I can't say exactly what needs to change.

@Calvin'sHobbies: runhaskell is a shell script that sets up some environment and finally calls ghc, the Haskell compiler. You can run my code directly with ghc: ghc -e "(8-8)-(-8/8)--(8\8-)-(8-8)". This launches ghc which evaluates the code provided as an argument, prints the result and exits. No REPL, no interaction. Of course this would add +1 to the byte count for -e.

@nimi: -e doesn't contribute to the score in this case. We don't count bytes for perl -E or gcc -std=c99 either.