As the cited solution suggests, we approach via stars and bars... that is, we describe every way of selecting coins as a sequence of stars and bars (or as they suggest, checkmarks and dividers, I will continue calling them stars and bars for the remainder of this post.)
One can (and should) prove that the set of possible selections of 4 coins of 3 categories is in direct bijection with (and therefore has the same number of elements as) the set of sequences of 4 stars and 2 bars.
We can describe the bijection with words as:
$$\underbrace{~~~~~~~~~~~~~~~~~~~~~~~}_{\text{stars here represent loonies}}\mid \underbrace{~~~~~~~~~~~~~~~~~~~~~~~}_{\text{stars here represent quarters}}\mid\underbrace{~~~~~~~~~~~~~~~~~~~~~~}_{\text{stars here represent toonies}}$$
For example, the sequence $\star\star\mid\star\mid\star$ represents the selection being two loonies, one quarter, and one toonie.
The sequence $\mid\mid\star\star\star\star$ on the other hand will represent our selection being just four toonies and none of the other coins.
Note: This method treats all ways of selecting a particular arrangement of coins as the same so long as the number of each type of coin is the same between the two arrangements, that is to say we treat TQQQ to be the same arrangement as QQQT.
If you did want to treat those two as being different arrangements, approach instead directly via multiplication principle getting instead an answer of $3^4=81$, not $15$.
So, we have the number of arrangements will be the number of sequences of four stars and two bars, which we should know by earlier example can be counted via binomial coefficients as $\binom{6}{2}=\frac{6!}{4!2!}=15$
A large pile of coins consists of pennies, nickels, dimes, and quarters. How many different collections of coins can be formed if there are at least $30$ of each type of coin?
If we let $p$, $n$, $d$, and $q$ denote, respectively, the number of pennies, nickels, dimes, and quarters contained in the collection, then
$$p + n + d + q = 30 \tag{1}$$
A particular solution equation 1 corresponds to the placement of three addition signs in a row of $30$ ones. For instance,
$$+ 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1$$
corresponds to the solution $p = 0$, $n = 5$, $d = 10$, and $q = 15$. The number of such solutions is the number of ways we can place three addition signs in a row of thirty ones, which is
$$\binom{30 + 4 - 1}{4 - 1} = \binom{33}{3} = \binom{33}{30} = \frac{33!}{30!3!}$$
since we must choose which three of the thirty-three positions required for thirty ones and three addition signs will be filled with addition signs or, equivalently, which thirty of the thirty-three positions positions required for thirty ones and three addition signs will be filled with ones.
This appears to be what you had in mind. However, you did not use parentheses correctly in your answer.
$$\binom{30 + 4 - 1}{30} = \frac{(30 + 4 - 1)!}{30!(4 - 1)!} = \frac{33!}{30!3!}$$
If the pile contains only $15$ quarters but at least $30$ of each of the other types of coins, how many collections of $30$ coins can be chosen?
We must subtract those collections which include at least $16$ quarters from the total. Suppose $q \geq 16$. Then $q' = q - 16$ is a nonnegative integer. Substituting $q' + 16$ for $q$ in equation 1 yields
\begin{align*}
p + n + d + q' + 16 & = 30\\
p + n + d + q' & = 14 \tag{2}
\end{align*}
Equation 2 is an equation in the nonnegative integers with
$$\binom{14 + 4 - 1}{4 - 1} = \binom{17}{3}$$
solutions.
Hence, the number of collections of $30$ coins that can be formed with at most $15$ quarters is
$$\binom{33}{3} - \binom{17}{3}$$
Best Answer
There are $41$ combinations in all. The following solution is essentially a twist on the usual approach using generating functions.
Start by noticing that if we want to make a total of 20 dollars, we can use any combination of the 2, 5, 10, and 20 dollar coins and make up the rest with 1 dollar coins. So we can solve the problem without 1 dollar coins for $r$ dollars for $0 \le r \le 20$ and add up the 21 solutions to get the total number of combinations. Let's say $a_r$ is the number of solutions (not using 1 dollar coins) for $r$ dollars. If you think about it a bit, I think you can see that $a_r$ is the coefficient of $x^r$ in a polynomial which we will denote by $f(x)$, defined by $$f(x) = P_2(x) P_5(x) P_{10}(x) P_{20}(x)$$ where $$\begin{align} P_2(x) &= 1 + x^2 + x^4 + x^6 + \dots + x^{20} \\ P_5(x) &= 1 + x^5 + x^{10} + x^{15} + x^{20} \\ P_{10}(x) &= 1 + x^{10} + x^{20} \\ P_{20}(x) &= 1 + x^{20} \\ \end{align}$$ To see this, think about the way multiplication of polynomials works. It may help to start by computing a smaller example, say $P_{10}(x) P_{20}(x)$, and see how the result relates to the problem of making change with only 10 and 20 dollar coins.
Expanding $f(x)$ is a straightforward computation. We start by computing $P_{20}(x)P_{10}(x)$, then compute $P_{20}(x)P_{10}(x)P_5(x)$, and then finish with $P_{20}(x)P_{10}(x)P_5(x)P_2(x)$. And since we are only interested in $a_r$ for $r \le 20$, we can discard any powers of $x$ higher than $x^{20}$. So here goes:
$$P_{20}(x) P_{10}(x) = 1+x^{10}+2 x^{20}+ O(x^{30})$$ $$P_{20}(x) P_{10}(x) P_5(x) = 1+x^5+2 x^{10}+2 x^{15}+4 x^{20} + O(x^{25})$$ $$P_{20}(x) P_{10}(x) P_5(x) P_2(x) = 1+x^2+x^4+x^5 + \\ x^6+x^7+x^8+x^9+3 x^{10} + \\ x^{11}+3 x^{12}+x^{13}+3 x^{14}+3 x^{15} + \\3 x^{16}+3 x^{17}+3 x^{18}+3 x^{19}+7 x^{20}+O(x^{21})$$
This last polynomial is $f(x)$, and if we sum its coefficients up to the coefficient of $x^{20}$ we find the answer to the problem is $41$.