View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default How to distribute coins to achieve minimum difference?

I get 2 bags and 5 coins with different values, such as
The values for each coin are 14, 21, 23, 30, and 37.
I need to put coins into 2 bags to achieve minimum difference for both.

For example, I can put 14, 21, 23 into bag 1 and 30, 37 into bag 2.
The difference for both bags is
14+21+23 = 58
30+37 = 67
The difference is 67 - 58 = 9.
How do I know whether I achieve the minimum difference between 2 bags?

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric