The only means I could do that was by counting all possibilities and it take it forever.I began counting v this in psychic : "in how many ways have the right to only among coins include up to \$20" . Then went for combination of 2 coins ,after the of 3 coins . I got total of 40 combinations however it was very time consuming and illogical since if you have like \$50 to add up to you will never count the by hand .

Is there any other easier method maybe ,formula ?

You are watching: How many combinations are there of turning a dollar into change

combinatorics combinations
share
cite
follow
inquiry Apr 2 "20 in ~ 11:45 alexnat009alexnat009
7355 bronze title
\$endgroup\$
8

1

See more: Two Basic Characteristics Of The Scientific Attitude Are What?

\$egingroup\$
There space \$41\$ combinations in all. The following solution is basically a twist on the usual approach using generating functions.

Start through noticing that if we want to do a total of 20 dollars, we can use any combination of the 2, 5, 10, and 20 disagreement coins and make increase the remainder with 1 dissension coins. So we can solve the problem without 1 disagreement coins for \$r\$ dollars because that \$0 le r le 20\$ and add up the 21 options to acquire the total variety of combinations. Let"s speak \$a_r\$ is the variety of solutions (not making use of 1 dollar coins) for \$r\$ dollars. If friend think around it a bit, ns think you can see the \$a_r\$ is the coefficient of \$x^r\$ in a polynomial which us will represent by \$f(x)\$, characterized by\$\$f(x) = P_2(x) P_5(x) P_10(x) P_20(x)\$\$where\$\$eginalignP_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 \endalign\$\$To check out this, think around the means multiplication that polynomials works. That may assist to start by computer a smaller sized example, to speak \$P_10(x) P_20(x)\$, and also see exactly how the result relates to the difficulty of making change with only 10 and 20 dollar coins.

Expanding \$f(x)\$ is a simple computation. We begin by computing \$P_20(x)P_10(x)\$, climate 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 us are only interested in \$a_r\$ because that \$r le 20\$, we deserve to 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 also if we amount its coefficients as much as the coefficient of \$x^20\$ we discover the answer come the difficulty is \$41\$.