Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Let A,-{ al, a2, , an } be a finite set of distinct coin types (e.g., ?,-50 cents, a2-25 cents, a,- 10 cents etc.). We

image text in transcribed

Let A,-{ al, a2, , an } be a finite set of distinct coin types (e.g., ?,-50 cents, a2-25 cents, a,- 10 cents etc.). We assume each ai is an integer and that ai > a>> an. Each type is available in unlimited quantity. The coin changing problem is to make up an exact amount C using a minimum total number of coins. C is an integer0. (a) When an a greedy solution to the problem will make change by using the coin types in ., a. When coin type a is being considered, as many coins of this type as the order a, az, possible will be given. Write an algorithm based on this strategy. solutions that use the minimum total number of coins. with a minimum number of coins. (b) Give a counterexample to show that the algorithm in (a) doesn't necessarily generate (c) Show that if Ank1, k"^, k then the greedy method in (a) always yields solutions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions