Wednesday 18 September 2013

REVERSE COINCHANGE:if one has 2 bills and the other has 6 bills, and the value is equal, of which values bills are these?

REVERSE COINCHANGE:if one has 2 bills and the other has 6 bills, and the
value is equal, of which values bills are these?

i am looking for an approach how to solve the following problem:
Player A has an amount of, say coins like {0,0,10,10,10,10,50,200}
Player B another amount, say {0,0,50,50,100,200}
I see how much Coins they exchange, say A gives 2 and B gives 4
The game ends even,
so both stacks have the same value
from this i can derive:
A gave | B gave
0,100 | 0,0,50,50
0,50 <--- no way !
50,50 | 0,0,50,50
100,200 | 0,50,50,200
100,200 | 0,0,100,200
and so on and so on
what are this class of algorithm is called which gives me all possible
sets for Value(A)=Value(B) or ab
my sets will contain up to 20-30 elements, so i am looking for a good
approach but my only ideas so far where brute force permutations
Thanks for any discussion/help
dj

No comments:

Post a Comment