Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Because of population growth, the state of Washington has been given an addition

ID: 3832554 • Letter: B

Question

Because of population growth, the state of Washington has been given an additional seat in the house of representatives, making a total of ten. The state legislature, which is currently controlled by the republicans, needs to develop a plan for redistricting the state. There are 18 major cities in the state of Washington that need to be assigned to 1 of the 10 congressional districts. The next table gives the numbers of registered democrats and registered republicans in each city. each district must contain between 150,000 and 350,000 of these registered voters. Use evolutionary solver to assign each city to 1 of the 10 congressional districts in order to maximize the number of districts that have more registered republicans than registered democrats. (hint: use the sumif function).

City Democrats Republican 29327 99225233828 658588646778859869 215428 4863628 532 36 3 7968872 1234567890 34 67 11 11 1

Explanation / Answer

$Ontext
Governor Blue of the state of Berry is attempting to get the state
legislator to gerrymander Berry's congressional districts. The state
consists of ten cities, and the numbers of registered Republicans and
Democrats (in thousands) in each city are shown below
<pre>
set party /republicans,democrats/;
set city /1*10/;
table voters(city,party)
republicans democrats
1 80 34
2 60 44
3 40 44
4 20 24
5 40 114
6 40 64
7 70 14
8 50 44
9 70 54
10 70 64;
</pre>
Berry has five congressional representatives. To form congressional
districts, cities must be grouped together according to the following
restrictions:
<ul>
<li> All voters in a city must be in the same district.
<li> Each district must contain between 150,000 and 250,000 voters
(there are no independent voters).
</ul>
Governor Blue is a Democrat.
Assume that each voter alwas votes a straight party ticket. Formulate
and solve
an IP to help Governor Blue maximize the number of Democrats who will
win congressional seats.

$Offtext

set party /republican,democrats/;
set city /1*10/;
table voters(city,party)
   republican   democrats
1   80       34
2   60       44
3   40       44
4   20       24
5   40       114
6   40       64
7   70       14
8   50       44
9   70       54
10   70       64;

parameter people(city);
people(city) = sum(party,voters(city,party));

scalar bigM,
minVotes 'Minimum voters for each district' /150/,
maxVotes 'Maximum voters for each district' /250/;

bigM = sum(city,voters(city,'republican'));

set district /d1*d5/;

variables assign(city,district), totDems, vDem(district);
binary variables assign, vDem;

equations loVotes(district), upVotes(district),
   goDem(district), objective, defAssign(city);

defAssign(city)..
sum(district,assign(city,district)) =e= 1;

loVotes(district)..
sum(city,people(city)*assign(city,district)) =g= minVotes;

upVotes(district)..
sum(city,people(city)*assign(city,district)) =l= maxVotes;

goDem(district)..
sum(city,
(voters(city,'republican')-voters(city,'democrats'))*assign(city,district))
=l= bigM * (1 - vDem(district));

objective..
totDems =e= sum(district, vDem(district));

model voting /all/;

* At least one of the district (say first) have democrats win if
* the total voters for democrats is greater than the total voters for repubs.
vDem.fx('d1') =
1$(sum(city,voters(city,'republican')) < sum(city,voters(city,'democrats')));
solve voting using mip maximizing totDems;