Question: Problem 2 (electoral colleges) In this problem, we want to determine the set of states with the smallest total population that can provide the votes

Problem 2 (electoral colleges) In this problem, we want to determine the set of states with the smallest total population that can provide the votes to win the electoral college. Formally, the problem is the following: You are given a list of n states along with their population p;, and the number of electoral votes v;, for 1 sign. Also, you are given Z, the number of electoral votes needed to win. All electoral votes of a state go to a single candidate. Our goal is to find a set of states S with the smallest total population that has at least Z electoral votes in total. You only have to output the total population of the set S, you do not need to output the set itself. Example: if n = 5, populations are P = [200, 100, 30, 700, 250], electoral votes are V = [5, 1, 2, 7, 6] and Z = 12, then the solution is 480 since 480 = 200 + 30 + 250 and states 1, 3, 5 have 5 + 2+6 = 13 electoral votes. Note in this example: p2 > pa but v2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
