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
i love math..but i am afraid to study it... i mean i ma afraid that it may leave me in clay...what can you suggest me?

theory about solving sequencing problem using graphical method

(a) Find an example of groups G, H, K with K  H and H G but K G. (b) A subgroup H of G is characteristic if σ(H) ⊆ H for every group automorphism σ of G. Show that eve

The Mean Value Theorem for Integrals If  f (x ) is a continuous function on [a,b] then there is a number c in [a,b] such as,                                    ∫ b a f ( x

High temperatures in certain city in the month of August follow uniform distribution over the interval 60-85 F. What is probability that a randomly selected August day has a Temper

dora and her family are driving to visit relatives for the holidays they travel 174 miles in 3 hours if they travel at a constant speed how many miles do they travel in one hourest

1. A survey line on campus is measured to be 1000.00 ft long on horizontal ground. The elevation of the line is 700.00 feet and the geoid separation from ellipsoid to geoid is -110

Simplify following. Suppose that x, y, & z are positive.                      √ y 7 Solution In this case the exponent (7) is larger than the index (2) and thus the fir