
Brent K. answered 06/05/21
PhD in Applied Mathematics with 12+years experience with Matlab
Let x denote the number of $1 coins, and y denoted the number of $10 coins in the wallet.
Since the total amount is $45, we get the linear equation
1x+10y = 45.
Solving this equation for x, we see that
x = 45-10y.
Since only non-negative integer solutions make sense, solving this can quickly be done by choosing a value for y, and finding the corresponding value for x:
If y=0, then x=45.
If y=1, then x=35.
Etc.
Based on the tags you put on the question, you may want a more "Diophantine" sort of answer form:
The gcd of 1 and 10 is 1. Since 45 is clearly a multiple of 1, there is a solution.
Other solutions must have the form (x+kv,y-ku), where (x,y) is one solution of the equation, and u,v are the quotients of 1 and 10, respectively, when divided by 1 (the gcd of 1 and 45), and k is an integer (not arbitrary, since we must have a non-negative number of coins).
If we take (45,0) as the reference solution, and note that u=1 and v=10, we get that a general solution must take the form
(45+10k,-k), for k=0,-1, -2,-3, and -4, which also gives the solutions found above.