Optimal Coins for Exact Change Below $1?

In summary: This is not too different from the approach I mentioned earlier, but it's a bit more algebraic and you don't need to use the theorem, although it's not that hard to prove it. And once you've made change for 1-19, you can make change for 20-99, although you'll need some trial and error to do that.
  • #1
WannabeFeynman
55
0

Homework Statement


What is the smallest number of coins needed to pay in exact change an change less then a dollar (coins are 1, 5, 10, 25 and 50 cents)?

Homework Equations


No relevant equations apart from a theorem:
Numbers between n and k inclusive, k>n, if k - n + 1

The Attempt at a Solution


I tried a variety of solutions such as going backwards. I looked that to make up to 4 cents, we needed 4 1cent coins. Then, for 9 cents we need either 1 5cent coin and 4 1cent or 9 1cent, and obviously it should be the former option. I tried going this way and messed up, so if anyone can clarify if this is the correct method or there is some other way. Thanks

Other info:
This is from a combinatorics textbook, by Niven. However, at this point, apart from the theorem above, we are assumed not to have learned any theory (i.e. permutations, combinations etc).

Thanks.
 
Physics news on Phys.org
  • #2
WannabeFeynman said:

Homework Statement


What is the smallest number of coins needed to pay in exact change an change less then a dollar (coins are 1, 5, 10, 25 and 50 cents)?


Homework Equations


No relevant equations apart from a theorem:
Numbers between n and k inclusive, k>n, if k - n + 1

The Attempt at a Solution


I tried a variety of solutions such as going backwards. I looked that to make up to 4 cents, we needed 4 1cent coins. Then, for 9 cents we need either 1 5cent coin and 4 1cent or 9 1cent, and obviously it should be the former option. I tried going this way and messed up, so if anyone can clarify if this is the correct method or there is some other way. Thanks

Other info:
This is from a combinatorics textbook, by Niven. However, at this point, apart from the theorem above, we are assumed not to have learned any theory (i.e. permutations, combinations etc).

Thanks.

I won't present any kind of solution, but just point out to you that the well-studied "coin-changing problem" has some interesting and sometimes counterintuitive properties. A common way to make change is to use a so-called greedy algorithm; that is, to make change, start with as many as possible of the largest denomination, then as many as possible of the next largest, etc. (So, in your case, to make change for X cents the greedy algorithm would use as many 50-cent pieces as possible, then as many quarters as possible, then as many dimes, then as many nickels, then as many pennies until they all add up to X).

The interesting fact is that for some denomination sets the greedy algorithm produces provably optimal solutions (minimum number of coins), but for other denomination sets it does not---there are counterexamples. I won't spoil your fun by revealing whether or not greedy is optimal for the denomination set {50, 25,10,5,1} that you are using.

See, eg., http://en.wikipedia.org/wiki/Change-making_problem for a Knapsack formulation.
 
Last edited:
  • #3
Googling the problem led to some results which demonstrated that algorithm. Not really the solution, but thanks!
 
  • #4
WannabeFeynman said:
a theorem:
Numbers between n and k inclusive, k>n, if k - n + 1
Something missing?
I looked that to make up to 4 cents, we needed 4 1cent coins. Then, for 9 cents we need either 1 5cent coin and 4 1cent or 9 1cent, and obviously it should be the former option. I tried going this way and messed up,
Seems like a good start. please post how far you got, and what makes you think you messed up.
 
  • #5
Sorry, I meant:
Numbers between n and k inclusive, where n and k are integers and k>n, is k - n + 1.

So, is the right approach? Is there a more algebraic solution to the problem? And then, how can I tell if I am getting the least amount of coins?

Thanks
 
  • #6
WannabeFeynman said:
Sorry, I meant:
Numbers between n and k inclusive, where n and k are integers and k>n, is k - n + 1.

So, is the right approach? Is there a more algebraic solution to the problem? And then, how can I tell if I am getting the least amount of coins?

Thanks
I doubt there's a purely algebraic approach, but you can certainly deal with some of the simpler aspects quickly. If the smallest so many denominations are such that consecutive pairs are in whole number ratios then it's clear what to do there. What if this applies for some consecutive sequence somewhere, but not all the way from 1? Can you put upper limits on the number of each denomination (as you already did for the 1c coins) so that you get it down to a relatively small number of cases to check?
 
  • #7
So after using a maximum of 4 1 cent coins, the change needed and all the values of the coins are divisible by 5, so you can reduce it to making 1-19 cents change, using 1,2,5,10 cent coins.
 

FAQ: Optimal Coins for Exact Change Below $1?

1. What is the "Coins combinatorics problem"?

The Coins combinatorics problem is a mathematical problem that involves determining the number of possible combinations of coins that can be used to make a certain amount of money. It is also known as the "coin change problem".

2. What makes the Coins combinatorics problem challenging?

The Coins combinatorics problem is challenging because it requires finding all possible combinations of coins that add up to a given amount, without using too many coins or repeating the same combination. It also involves using recursive algorithms to solve the problem.

3. Can the Coins combinatorics problem be applied in real life?

Yes, the Coins combinatorics problem has several real-life applications, such as calculating the minimum number of coins needed to make change, optimizing vending machine coin dispensers, and designing efficient currency exchange systems.

4. How do you solve the Coins combinatorics problem?

The Coins combinatorics problem can be solved using a dynamic programming approach, which involves breaking the problem down into smaller subproblems and using the solutions to those subproblems to find the solution to the larger problem. It can also be solved using a recursive backtracking algorithm.

5. What is the time complexity of solving the Coins combinatorics problem?

The time complexity of solving the Coins combinatorics problem depends on the approach used. The dynamic programming approach has a time complexity of O(n*m), where n is the amount of money and m is the number of different coin denominations. The recursive backtracking approach has a time complexity of O(2^n), which grows exponentially with the input size.

Similar threads

Replies
3
Views
2K
Replies
6
Views
1K
Replies
2
Views
2K
Replies
2
Views
1K
Replies
4
Views
1K
Back
Top