Computing change for a given coin system, Mathematics

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.

Posted Date: 3/23/2013 1:41:28 AM | Location : United States







Related Discussions:- Computing change for a given coin system, Assignment Help, Ask Question on Computing change for a given coin system, Get Answer, Expert's Help, Computing change for a given coin system Discussions

Write discussion on Computing change for a given coin system
Your posts are moderated
Related Questions
Solve the following Linear Programming Problem using Simple method. Maximize Z= 3x 1 + 2X 2 Subject to the constraints:                  X 1 + X 2 ≤ 4

HOW TO FIND 2SQUARE *7 CUBE

could you help me get bater at math

Division of complex number Now, we gave this formula a long with the comment that it will be convenient while it came to dividing complex numbers so let's look at a couple of e

A firm is manufacturing 45,000 units of nuts. The probability of having a defective nut is 0.15 Compute the given i. The expected no. of defective nuts ii. The standard an

The Shape of a Graph, Part I : In the earlier section we saw how to employ the derivative to finds out the absolute minimum & maximum values of a function.  Though, there is many

A man invests rs.10400 in 6%shares at rs.104 and rs.11440 in 10.4% shares at rs.143.How much income would he get in all??


What is Angle Pairs? Two angles are adjacent angles if they have the same vertex and share one side. Vertical angles are a pair of nonadjacent angles formed by two intersecting