Computing change for a given coin system, Mathematics

Assignment Help:

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.


Related Discussions:- Computing change for a given coin system

Financial Math, can you help me with financial math??

can you help me with financial math??

Calculate the slope of the line, Calculate the slope of the line: Exa...

Calculate the slope of the line: Example: calculate  the  slope  of  the  line  whose  equation  is  y  =  2x  +  3  and  whose y-intercept is (0,3). Solution:    y =

Ratio, 2qt :6qt::x :48? help me solve x

2qt :6qt::x :48? help me solve x

Chanllenge, apzza driver delivered 27 pizzas in one night he delivered more...

apzza driver delivered 27 pizzas in one night he delivered more then one pizza to only one house . every other hhouse he only delivered pizza to 18 houses . how many pizzas did he

Word problem, A jet flew at an average speed of 480mph from Point X to Poin...

A jet flew at an average speed of 480mph from Point X to Point Y. Because of head winds, the jet averaged only 440mph on the return trip, and the return trip took 25 minutes longer

Trigonmetry, How do I find a bearring using trig?

How do I find a bearring using trig?

Shortcuts, pls told the maths shortcuts

pls told the maths shortcuts

#algebra, what is the answer of 6_5x9_4x3(1_2)

what is the answer of 6_5x9_4x3(1_2)

Estimate the last month sales increased through only 1/2%, Sales increased ...

Sales increased through only 1/2% last month. If the sales from the previous month were $152,850, what were last month's sales? Multiply through the decimal equivalent of 1/2 %

matlab, how to solve simplex method using matlab

how to solve simplex method using matlab?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd