# SICP Solutions

### Section - 2.2 - Hierarchical Data and the Closure Property

#### Exercise 2.19

Order of coins does not matter. If order of coin had any role then they should have also effected to the original solution which does not use list because there also first-denomination returns value of coin corresponding to a number.

To understand why it does not depend on order, we shall outline the approach to find total ways for change for amount $amt$ using given denominations: $D$

Lets take any random denomination, say $d_r$ from $D$. Now total number of ways is the sum of:

• number of ways for coin-change for amount, $amt$, without using denomination $d$. Thus we are using denominations: $D \setminus \{ d \}$.
• number of ways for coin-change for amount, $amt - d$, using denominations $D$.

Thus we choose any random denomination and proceed recursively. Since we are free to choose any denomination, we proceed choosing the first from the list as it helps in simplifying our procedure.