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
The probability that a person will get an electric contract is 2/5 and the contract that he will not get plumbing  contract is 4/7.If the probability of getting at least one contra

The following graph shows the growth of the median home value in a particular region of the United States starting in 1996.  The graphs starts in 1996 and shows the trend through t

in a class of 55 students, 35 take english, 40 take french, and 5 take other languages.present this information in a venn diagam and determine how many students take both languages

Change of base: The final topic that we have to look at in this section is the change of base formula for logarithms. The change of base formula is,

In the given figure, ∠AEF=∠AFE and E is the mid-point of CA. Prove that BD/CD = BF/CE Ans:    Draw CG ¦DF In ΔBDF CG ¦ DF ∴ BD/CD = BF/GF     .............(1)

can you help me with math

how much congruent sides does a trapezoid have

The perimeter of a rectangular swimming pool is 60m. The length of the pool is 4 m more than the width. What is the width of the pool?

Determine an actual explicit solution to y′ = t/y; y(2) = -1. Solution : We already identify by the previous illustration that an implicit solution to this IVP is y 2 = t 2 -

A 10 m ladder of 150N is placed at an angle 30degrees to a smooth wall at point A and the other end (point B) on the ground. Assume that the weight of the ladder acts at its mid po