Let's say the number of ways to get m quarters and n loonies is . We want to find the 2-variable ordinary power series generating function (OPSGF) .

The OPSGF for Alex's coins is

For Kim's coins,

For Julie's coins,

So

In a sense we are done, but maybe we should go ahead and find the answer to the original problem, which is the coefficient of in f. We can factor f as

, where

and

.

so

Next we need to find , but it will simplify things if we first apply partial fractions to h:

so

So the number of ways to get 50 quarters and 20 loonies is