|
|
| File Information |
| Description |
The money changing problem is a simple one to state. For example, how many different ways can one form change of a dollar (100 cents) by using only coins of denomination [1 5 10 25 50] ? (The answer is 292.)
Its an example of a general problem, i.e., in how many unique ways can an integer be partitioned as a sum of smaller positive integers?
http://en.wikipedia.org/wiki/Integer_partition
I wrote partitions to solve the fully general problem, but it can be used with restrictions too. You can constrain the set of elements in the sum, and the maximum number of times any one elements can appear, as well as fixing the total number of terms that will appear in the final sum.
See the demo for a few examples of use. |
| Acknowledgements |
The author wishes to acknowledge the following in the creation of this submission:
partitiontable.m
This submission has inspired the following:
nsumk
|
| MATLAB release |
MATLAB 7.0.1 (R14SP1)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (11) |
| 21 Aug 2006 |
urs (us) schwarz
|
|
|
| 07 Nov 2006 |
xiaole bai
|
|
|
| 13 Nov 2006 |
Alexander Statnikov
|
|
|
| 20 Jul 2008 |
Rakib Ahmed
|
|
|
| 10 Aug 2008 |
Senol Korkmaz
|
|
|
| 13 Feb 2009 |
Sergei Koulayev
|
|
|
| 21 Mar 2011 |
Arindra Guha
|
|
|
| 21 Mar 2011 |
John D'Errico
|
|
|
| 20 Sep 2011 |
Kammoun
|
|
|
| 21 Sep 2011 |
Omar
|
|
|
| 28 Sep 2011 |
Marcin
|
|
|
| Updates |
| 13 Nov 2006 |
Version 1.1: Allow the candidate set to be non-decreasing rather than strictly increasing |
| 16 Jul 2008 |
Added a new option: a user defined number of terms in the sum. |
|
Contact us at files@mathworks.com