Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Macroeconomics Expert

This problem involves the question of computing change for a given coin system. A coin system is defined to be a sequence of coin values v1 < v2 < . . . < vn, such that v1 = 1. For example, in the U.S. coin system we have six coins with values h1, 5, 10, 25, 50, 100i. The question is what is the best way to make change for a given integer amount A.

(a) Let c ≥ 2 be an integer constant. Suppose that you have a coin system where there are n types of coins of integer values v1 < v2 < . . . < vn, such that v1 = 1 and, for 1 < i ≤ n, vi = c · vi-1. (For example, for c = 3 and n = 4, an example would be h1, 3, 9, 27i.) Describe an algorithm which given n, c, and an initial amount A, outputs an n-element vector that indicates the minimum number of coins in this system that sums up to this amount. (Hint: Use a greedy approach.)

(b) Given an initial amount A ≥ 0, let hm1, . . . ,mni be the number of coins output by your algorithm. Prove that the algorithm is correct. In particular, prove the following:

(i) For 1 ≤ i ≤ n, mi ≥ 0

(ii) Pn

i=1mi · vi = A

(iii) The number of coins used is as small as possible

Prove that your algorithm is optimal (in the sense that of generating the minimum number of coins) for any such currency system.

(c) Give an example of a coin system (either occurring in history, or one of your own invention) for which the greedy algorithm may fail to produce the minimum number of coins for some amount.

Your coin system must have a 1-cent coin.

Hint on problem 3: Suppose that the input is n=4, c=2, A=53 (meaning four coins, growing exponentially in 2, that is, {1, 2, 4, 8}, and 53 cents as the amount). The output would be (1,0,1,6), meaning:

The input consists of n, c, and the amount A. The output is a list of the numbers of coins of each denomination that sums to A.

Macroeconomics, Economics

  • Category:- Macroeconomics
  • Reference No.:- M9532800

Have any Question?


Related Questions in Macroeconomics

Question franchise arrangements involve a number of highly

Question: Franchise arrangements involve a number of highly specific investments on the parts of both the parent company (e.g., McDonald's or Hilton Hotels) and the franchisee (the owner of a particular McDonald's or Hil ...

Question - suppose that a consumer can earn a higher wage

Question - Suppose that a consumer can earn a higher wage rate for working overtime. That is, for the first q hours the consumer works, he or she receives a real wage rate of w1, and for hours worked more than q he or sh ...

Question one of the big differences between the national

Question: One of the big differences between the National Football League and Power Five conference college football is that professional athletes receive payment for their services while collegiate athletics is strictly ...

Assignment 2 global economy national economies and

Assignment 2: Global Economy, National Economies, and Competition In the first part of the twenty-first century a great recession struck most of the countries in the world. The next decade has been severally impacted wit ...

Question at the farmers market in irvine california the

Question: At the farmer's market in Irvine, California, the price of avocados is set at $3 each. At that price, 120 avocados are supplied but only 100 are purchased. Represent this on a supply and demand graph and answer ...

Question - in a small town there is an extremely talented

Question - In a small town, there is an extremely talented baker. In a competitive market with other bakers, he faces a private marginal benefit (demand) curve of 200-Q. The marginal cost curve for producing the bread is ...

Question - find a current example of a linear optimization

Question - Find a current example of a linear optimization model used in your industry. Describe the industry's needs, including any unique factors, how the linear optimization model was used, and the problem or challeng ...

Question - suppose that die number of garden benches

Question - Suppose that die number of garden benches produced by 0, 1, 2, 3, and 4 workers is 0, 39, 78, 99, and 108. Calculate the marginal and average products of labor that would have resulted. Check that the relation ...

Economics and finance for business assignment -research

Economics and Finance for Business Assignment - Research report on Australian businesses - An industry or market analysis The objective: To conduct a market or industry analysis of rival businesses in an industry of your ...

Question jones is one of 100000 corn farmers in a perfectly

Question: Jones is one of 100,000 corn farmers in a perfectly competitive market. What will happen to the price she can charge if: a. The rental price on all farmland increases as urbanization turns increasing amounts of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As