Read a number x. Initialize a counter to zero. While x is greater than zero, perform the following steps: Increase the counter by one. If x is odd, replace x by (x+1)/2; otherwise (if x is even) replace x by x-2. Once the loop terminates (if it does), output the value of the counter and halt.
(a) What coins should you use to make change for the following amounts of money? (In each case answer with the smallest possible set of coins that adds up to the correct value.)
(b) Why might it be useful for Binarian cash registers to display amounts of money using binary notation?