A great way to solve this is to use the Double-Matrix Chart
------------Team A|Team B
prefer A|______|__________=.7 * 50 = 35
prefer B|______|__________=.3 * 50 = 15
________________________________
----------.4*50=20 + .6*50=30-----------= 50
Columns:
20 people should be assigned to A.
30 people should be assigned to B.
Rows:
35 prefer Team A.
15 prefer Team B.
All totaling to 50.
In order to get the lowest number who will not get what they want,
we give the assignment to those who wants it as much as we can.
For example:
If 35 wants Team A... assign as much as we can to Team A.
If 15 wants Team B... assign as much as we can to Team B.
(See table below)
------------Team A|Team B
prefer A|___20_|___?_______=.7 * 50 = 35
prefer B|___?__|__15_______=.3 * 50 = 15
________________________________
---------------20---+----30--------= 50
Now we calculate the balance of those who did not get the slot...
------------Team A|Team B
prefer A|___20_|___15_______=.7 * 50 = 35
prefer B|___0__|__15_______=.3 * 50 = 15
________________________________
---------------20---+----30--------= 50
Note that the row of "prefer A" should always tally to 35. That is why we know the balance is 15.
Note that the row of "prefer B" should always tally to 15. That is why we know the balance is 0.
Now we sum up those who did not get what they want:
15 on those who prefer A did not get it
0 on those who prefer B did not get it.
Answer: 15
This chart works on all overlapping set problems...