Minimum number of coins to get -closest- to target value?

2

There's the old, well hashed version of the question that uses Dynamic Programming to calculate the minimum number of coins to reach a target value, but what if the coins you're given can't reach the target (such as {4, 8, 12} trying to total 33)? What if you're satisfied with "close enough" totals?

It seems to me that there's two considerations with this:

1) Getting as close to the target value as possible, and

2) Using as few coins as possible.

For example, given a target value of X, if you an reach X-1 with 5 coins, but X-2 with only 2 coins, (where X is sufficiently large that 1 and 2 are almost equal in relative value [such as 500, as opposed to 5]), then it seems that X-2 with 2 coins could be the "better" answer, even though it's not the closest total to the target value.

How would one go about setting up this problem? It's too ambiguous for me to wrap my head around.

S. J.

Posted 2014-12-24T21:26:40.240

Reputation: 121

Question was closed 2014-12-24T22:05:55.963

3This question is not yet ready to be released as a challenge and should be moved to the sandbox. – DavidC – 2014-12-24T21:41:19.413

2Your definition of "How close is enough" and "close vs less coins" is very vague. – Optimizer – 2014-12-24T21:53:57.700

No answers