Posted: Sat Feb 25, 2006 12:42 am
The problem states..
Suppose there are three candidates numbered from 1 to 3 and the ballots are described as
After counting the ballots you will find that..
Now there are only two candidates. As the problem states "Ballot papers on which an eliminated candidate is mentioned are effectively modified by deleting that candidate, thereby ``promoting" any lower-preference non-eliminated candidates.". Now updating the ballots, we get...
This is the 'effectively deleting' part. So, we have deleted the eliminated candidate and listed the ballots so that the preference of the candidates is same (before deleting).
Now look at the 5th ballot. Its empty. As the problem states (A valid ballot from which all candidates have been eliminated remains a valid ballot.), so the 5th ballot is also valid. But it is empty so, it will not be counted.
And for the input
After counting ballots you get..
None gets majority so, 2 and 3 will be eliminated and the ballot configuration becomes..
Empty votes are valid but not counted. So the winner is 1.
Remember that...
1. In a valid ballot the occurrance of any number is at most 1. If more than 1 then the ballot is not valid. So a ballot like 1 2 1 1 is invalid.
2. Suppose there are 3 candidates numbered from 1 to 3. Then a ballot like 1 2 4 is invalid.
Hope it helps.
This part is really confusing. As I understood..Ballot papers on which an eliminated candidate is mentioned are effectively modified by deleting that candidate, thereby ``promoting" any lower-preference non-eliminated candidates. (A valid ballot from which all candidates have been eliminated remains a valid ballot.)
Suppose there are three candidates numbered from 1 to 3 and the ballots are described as
Code: Select all
1 3 2
2
1 2
2 3
3
Code: Select all
1. got 2 votes
2. got 2 votes
3. got 1 vote and thus eliminated
Code: Select all
1 2
2
1 2
2
// There is no candidate
Now look at the 5th ballot. Its empty. As the problem states (A valid ballot from which all candidates have been eliminated remains a valid ballot.), so the 5th ballot is also valid. But it is empty so, it will not be counted.
And for the input
Code: Select all
1. Chubby Checker
2. Kid Creole
3. Rest of the coconuts
1
1
2
3
Code: Select all
1. got 2 votes
2. got 1 vote
3. got 1 vote
Code: Select all
1
1
empty
empty
Remember that...
1. In a valid ballot the occurrance of any number is at most 1. If more than 1 then the ballot is not valid. So a ballot like 1 2 1 1 is invalid.
2. Suppose there are 3 candidates numbered from 1 to 3. Then a ballot like 1 2 4 is invalid.
Hope it helps.