wu :: forums
« wu :: forums - coins and change »

Welcome, Guest. Please Login or Register.
Oct 12th, 2024, 5:09pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: Grimbal, Eigenray, Icarus, william wu, ThudnBlunder, SMQ, towr)
   coins and change
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: coins and change  (Read 6773 times)
birbal
Full Member
***





   


Gender: male
Posts: 250
coins and change  
« on: Feb 5th, 2012, 9:07am »
Quote Quote Modify Modify

You have coins with different denominations and you have limited number of each denominations (some maybe zero), how will you determine if you can supply the given change.
IP Logged

The only thing we have to fear is fear itself!
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: coins and change  
« Reply #1 on: Feb 5th, 2012, 11:23am »
Quote Quote Modify Modify

I think it depends on the denominations whether a greedy approach will work; but that'd be one thing to try.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
R
Senior Riddler
****



Addicted!!!

   


Gender: male
Posts: 502
Re: coins and change  
« Reply #2 on: Sep 22nd, 2012, 2:50am »
Quote Quote Modify Modify

Can we model it as DP?
IP Logged

The first experience seems like Magic, but the second tells you the Trick behind it.
MathsForFun
Full Member
***





   


Posts: 153
Re: coins and change  
« Reply #3 on: Jul 20th, 2013, 1:07am »
Quote Quote Modify Modify

on Sep 22nd, 2012, 2:50am, R wrote:
Can we model it as DP?

Dynamic programming would be awkward in this case, because there would be multiple ways of getting to each amount.
 
I would use an integer programming library: unless the problem was extraordinarily large, it would answer this question in a snap.
 
http://en.wikipedia.org/wiki/Change-making_problem
IP Logged

Everything is interesting if you look at it closely enough
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board