Question: Suppose youve been sent back in time and have arrived at the scene of an ancient Roman battle. Moreover, suppose you have just learned that
Suppose you’ve been sent back in time and have arrived at the scene of an ancient Roman battle. Moreover, suppose you have just learned that it is your job to assign n spears to n Roman soldiers, so that each man has a spear. You observe that the men and spears are of various heights, and you have been told (in Latin) that the army is at its best if you can minimize the total difference in heights between each man and his spear. That is, if the ith man has height mi and his spear has height si, then you want to minimize the sum,

Consider a greedy strategy of repeatedly matching the man and spear that minimizes the difference in heights between these two. Prove or disprove that this greedy strategy results in the optimal assignment of spears to men.
Si >Imi i=1
Step by Step Solution
3.37 Rating (169 Votes )
There are 3 Steps involved in it
This approach doesnt work which can be seen with a small example of ... View full answer
Get step-by-step solutions from verified subject matter experts
