A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
I have collected a huge pile of ballots for an election for class president. There are three
candidates for the oce. Each ballot has a box for each candidate. The voter should write a
1 in the box for his top choice and a 2 for the second. A ballot is invalid if it does not follow
that rule. The winner of the election is the candidate who gets a majority (more than 50%)
of number1 votes on valid ballots. If no candidate receives a majority, then the votes for
the candidate in third place are given to the candidates who were marked 2 on the respective
valid ballots. The candidate with the mos
anonymous
 5 years ago
I have collected a huge pile of ballots for an election for class president. There are three candidates for the oce. Each ballot has a box for each candidate. The voter should write a 1 in the box for his top choice and a 2 for the second. A ballot is invalid if it does not follow that rule. The winner of the election is the candidate who gets a majority (more than 50%) of number1 votes on valid ballots. If no candidate receives a majority, then the votes for the candidate in third place are given to the candidates who were marked 2 on the respective valid ballots. The candidate with the mos

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0now is the winner. If there is a tie at any point in the process, there is no winner. For example, suppose the candidates were Alice, Bob, and Chris. There are seven ballots: Alice: 1 Bob: Chris: 2 Alice: 2 Bob: 1 Chris: Alice: 3 Bob: 2 Chris: 1 Alice: 2 Bob: 1 Chris: Alice: 1 Bob: 2 Chris: Alice: Bob: 1 Chris: 2 Alice: Bob: 2 Chris: 1 The third ballot is invalid thanks to the unnecessary thirdplace vote for Alice, so it doesn't count. Otherwise, Alice has two rstplace votes, Bob has three, and Chris has one. While Bob has the most votes, he does not have a majority. The (valid) ballot marking Chris in rst place had Bob in second, so its vote goes to Bob. Now Alice has two votes, and Bob has four, so Bob wins. Write an algorithm (in English) to determine the winner (if any) of the election. Be as specic as possible. In particular, each step of the algorithm can consider at most one ballot at a time. (So \count all the ballots" or \nd the person with the most rstplace votes" is not a valid single step; you'll have to further break that down into other individual steps.)

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0THIS IS A ALGORITHM PROBLEM FOR ANOTHER PYTHON CLASS. PLEASE HELP.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.