Graphs · Exercise 53 of 100
Counting coin combinations
To count combinations of unlimited coins with distinct positive values, start with one way to make zero and no ways to make any positive amount. For each coin value, go upward from that value to the target and add to each amount's count the number of ways to make that amount minus the coin value. Going upward allows reuse of that coin, and fixing the order of coin values counts each combination once.
Try it yourself
You have unlimited coins worth 1, 3 and 4. How many different combinations total 7 if rearranging the same coins counts as the same combination?
One-step hint
Group combinations by how many 4-coins they use. For each group, try every feasible number of 3-coins and fill the remainder with 1-coins.
Worked solution
- Without a 4, use zero, one or two coins worth 3 and fill the rest with ones. This gives three combinations.
- With one 4, the remaining 3 is either one 3 or three ones. Two 4s exceed 7, so the total is 3 + 2 = 5.