# Application on systems of equations [closed]

Lauren has 20 coins in her piggy bank, all dimes and quarters. The total amount of money is $3.05. How many of each coin does she have? - ## closed as off-topic by Mike Honeychurch, m_goldberg, RunnyKine, Sjoerd C. de Vries, Pinguin DirkJan 27 '14 at 8:46 • The question does not concern the technical computing software Mathematica by Wolfram Research. Please see the help center to find out about the topics that can be asked here. If this question can be reworded to fit the rules in the help center, please edit the question. ## 2 Answers A perfect place to use FindInstance: FindInstance[n1*10 + n2*25 == 305 && n1 + n2 == 20, {n1, n2}] {{n1 -> 13, n2 -> 7}}  So Lauren has 7 quarters and 13 dimes. - This is a linear Diophantine equation in two variables:$10x+25y=305\$. Generating functions give the number of solutions for coin change problems like this. For example,

GFCoinPartitions[n_, d_List]:= Block[{z},
Coefficient[Series[Product[1/(1-z^d[[i]]), {i,1,Length[d]}], {z,0,n}], z, n]]


wherenis the total to find, 305 pennies in this case, anddis a list of coin denominations, 10 and 25 in this case. There are 6 solutions to this problem. The ever popularFrobeniusSolvefinds them by using:

FrobeniusSolve[{10, 25}, 305]
(* {{3, 11}, {8, 9}, {13, 7}, {18, 5}, {23, 3}, {28, 1}} *)

-