change_polynomial


change_polynomial, a Python code which uses a polynomial multiplication algorithm to count the ways of making various sums using a given number of coins.

In this version of the change making problem, the order of the coins is significant. In other words, if we are using exactly 3 coins to make 16 cents, then we count 6 separate solutions: (1,5,10), (1,10,5), (5,1,10), (5,10,1), (10,1,5) and (10,5,1). Similarly, we count three essentialy equivalent solutions to forming the sum of 7 cents.

If the user wishes to determine the number of ways of forming sums using anywhere from 0 up to COIN_NUM coins, inclusive, then it is only necessary to include a coin of value 0 in the denomination list.

Licensing:

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

Languages:

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

Related Data and Programs:

python_combinatorics, a Python code which considers a variety of problems in combinatorics involving counting, combinations, permutations, and so on.

Source Code:


Last revised on 26 October 2022.