to find minimum no. of coins why did we use the change which is maximum possible.how ,do we assure that by doing this it will give minimum no. of coins
Doubt in logic,please help!
@varu,
Because if let’s say you have to carry with yourself a sum of 150 Rs(in Indian Currency Denominations), so by common sense, if you need to carry as few notes as possible, you will try to have the largest possible denominations first, for eg here 100 + 50, you won’t choose the first note to be 10 right…??
but let say indian currency contains :10,20,50,70,100,200… and i need to carry 140rs then should i carry 100,20,20 or 70,70
i can not get logic behind to take maximum change first
@varu,
Denominations usually follow the fact that Lower_Denomination*2<=Higher_Denomination. Thus, allows us to have minimum number of notes.
So, your denominations are wrong, as far as this problem is considered.
what about this example:1,2,10,48,100 and required money is rs 106 100+2+2+2 or,48+48+10 also this example follows Lower_Denomination*2<=Higher_Denomination
@varu,
I think there may be an upper bound to Higher_Denomination as well, something like (just a guess)
Lower_Bound * k1 <= Higher_Denomination <= Lower_bound * k2
Anyway, the problem here only considers the actual Indian Denominations, {1,2,5,10,20,50…}