change_greedy


change_greedy, an Octave code which uses the greedy method to seek a solution to the change making problem, which tries to match a given amount by selecting coins of various denominations.

If there is a coin of value 1, then there is always at least one solution to the change making problem.

If the coin denominations are ``canonical'', then the greedy method is always guaranteed to come up with a solution, and this solution will involve the fewest possible number of coins.

If the coin denominations are not canonical, then the greedy method may return a solution which does not use the minimum number of coins, or it may fail to find a correct solution at all.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

change_greedy is available in a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

change_greedy_test

octave_combinatorics, an Octave code which considers a variety of problems in combinatorics involving counting, combinations, permutations, and so on.

Source Code:


Last revised on 19 October 2022.