**From New Scientist #1502, 3rd April 1986** [link]

When electing a mayor, our town councillors each vote for one of the candidates, and if a candidate obtains over half the votes in this first count he is elected. If this fails to happen, then the candidate with the least votes “donates” his votes entirely to one of the remaining candidates and takes no further part of the procedure.

The new totals are then calculated and if one candidate has over half the votes, or if a candidate has been first in the two counts, then he is elected. If both those fail to happen, then again the candidate with fewest votes in the second count donates his votes to one of the remaining candidates and retires. This continues until someone has over half the votes or has been top in any two counts.

When the current mayor was elected the 31 counsellors each voted for their choice of one of the five candidates, and each candidate received a different number (but less than half) of the votes. So the candidate with fewest votes donated his and retired. The second count gave a new clear leader, but it was still indecisive. The third account gave a new clear leader, but it too was still indecisive. At last, on the fourth count, the mayor was elected, and in none of the counts had he been placed second.

How many votes did that mayor get in the very first vote?

[enigma353]

### Like this:

Like Loading...

This Python 3 program runs in 180ms.

Solution:The winner received 7 votes in the first round.The result of the first round is: C=9, B=8, A=7, D=5, E=2. C wins, B is second, E is eliminated and donates his votes to B.

The result of the second round is: B=10, C=9, A=7, D=5. B wins, C is second, D is eliminated and donates his votes to A.

The result of the third round is: A=12, B=10, C=9. A wins, B is second, C is eliminated and donates his votes to A.

The result of the fourth round is: A=21, B=10. A wins with more than half the votes (and with wins in two rounds) and is elected.