subject

Consider the problem of making change for n cents using the fewest number of coins. assume that each coins value is an integer. a. you have available coin denominations of 1 cent, 5 cents, 10 cents, 25 cents, as in the us coins of penny, nickel, dime, quarter. assume there is infinite availability of each of these four coin denomination types. describe a greedy algorithm to make change using the fewest number of coins. b. consider your greedy algorithm and making change for n=30 cents. show that the optimal solution for making change includes your greedy choice. to do so, assume that your greedy choice is not in the optimal solution. then use the "cut and paste" argument to show that you can replace other coins by your greedy choice, therefore finding a better solution than what was assumed to be optimal. this is in contradiction to the assumption, so your greedy choice is in the optimal solution. c. although the greedy algorithm is optimal for the us coins, it is not necessarily optimal for any set of coins. give an example of a different set of made up coin denominations with different values, for which the greedy algorithm does not yield an optimal solution. your set should include a penny so that there is a solution for every value of n. as before, assume there is infinite availability of each of the coin denomination types. show specifically a counter example in which the greedy algorithm yields a change solution that is not optimal, that is, does not include the fewest number of coins. d. name another algorithmic approach that will find an optimal solution to your example in (c).

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:50
Iam a bacterium. i cause stomach cramps and diarrhea. i am caused by eating rotten foodssuch as chicken, fish, or eggs. sometimes turtles carry my bacteria.what am i?
Answers: 2
question
Computers and Technology, 23.06.2019 04:10
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
question
Computers and Technology, 24.06.2019 00:40
Use a software program or a graphing utility with matrix capabilities to solve the system of linear equations using an inverse matrix. x1 + 2x2 − x3 + 3x4 − x5 = 6 x1 − 3x2 + x3 + 2x4 − x5 = −6 2x1 + x2 + x3 − 3x4 + x5 = 3 x1 − x2 + 2x3 + x4 − x5 = −3 2x1 + x2 − x3 + 2x4 + x5 = 5
Answers: 3
question
Computers and Technology, 24.06.2019 08:30
@josethesolis i need can anyone text me and follow me
Answers: 1
You know the right answer?
Consider the problem of making change for n cents using the fewest number of coins. assume that each...
Questions