I have the following question: In a store I want to pay with exactly 50 coins. There are 2€, 1€, 0,5€ 0,2€ and 0,1€ coins. So I'd have 2a + 1b + 0,5c + 0,2d + 0,1*e = amount I have to pay And a+b+c+d+e=50 (number of coins) Since there are no half Euros, a,b,c,d, and e are natural numbers (0-50)
Is there any way to solve this? Thanks in advance
It depends on the amount you want to pay. For example, if the amount is $0.01$, you do not have a coin with that "resolution". Moreover, if the amount you want to pay is $0.1$, you can only pay with your $0.1$ coin, because you don't have any coins with lower value to combine. Finally, there are amounts you do not have the money for: if something costs $\$1000000$, you don't have a coin with a high enough value such that fifty of it will give you a million dollars. In summary, with the information you have given us, it seems that the problem is underspecified.