Al momento, stai seguendo questo contributo
- Vedrai gli aggiornamenti nel tuo feed del contenuto seguito
- Potresti ricevere delle email a seconda delle tue preferenze per le comunicazioni
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.
Cita come
John D'Errico (2026). Partitions of an integer (https://it.mathworks.com/matlabcentral/fileexchange/12009-partitions-of-an-integer), MATLAB Central File Exchange. Recuperato .
Categorie
Scopri di più su Functions Supported for Code Acceleration in Help Center e MATLAB Answers
Informazioni generali
- Versione 1.21.0.0 (5,61 KB)
Compatibilità della release di MATLAB
- Compatibile con qualsiasi release
Compatibilità della piattaforma
- Windows
- macOS
- Linux
