Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

LittleChildPaclet

Guides

  • Assumptions and Domains
  • Linguistic Data
  • Number Digits
  • Prime Numbers
  • Start Here Wolfram Challenge Functions
  • String Patterns
  • Wolfram Challenges Algorithms
  • Wolfram Challenges Computational Knowledge
  • Wolfram Challenges Geography
  • Wolfram Challenges Mathematics
  • Wolfram Challenges Words and Linguistics
  • Working with Sequences

Symbols

  • AliquotSequence
  • AlmostPalindrome
  • Anagrams
  • AntipodalCity
  • AntipodeAboveSeaLevelQ
  • BabbageSquares
  • BalancedParentheses
  • BalancedTernary
  • ButterflyString
  • CaesarDecrypt
  • CatalanUnrank
  • Coins
  • CompleteDictionary
  • DigitalRoot
  • FizzBuzz
  • IntegerPalindromeQ
  • MaxRomanLength
  • MaxRomanNumeralValue
  • NonNegativeIntegerQ
  • NumberTriangle
  • OddBeforeEven
  • PairsAddToHundred
  • PositiveIntegerQ
  • RepeatandEndingPrimes
  • SameStartEndWords
  • SayHello
  • SquareSum
  • StringPatternQ
  • ThreeFive
  • ToMorseCode
  • TwoAndThreePointers
  • WordListLookup
PeterBurbery`LittleChildPaclet`
Coins
​
Coins
[values,target]
finds the fewest number of coins from the list
values
needed to add up to a certain value
target
.
​
Details and Options

Examples  
(2)
Basic Examples  
(1)
The function Coins that takes a list called values of positive integers and a positive integer target. The function should return all lists of the number of coins to make the target with the fewest number of coins possible, all of whose denominations are in values. The function returns the list of ways in
Sort
order.
In the following example, the fewest number of coins to make 35 is 4. There is only one such case:
In[1]:=
Coins
[{1,2,4,8,16},35]
Out[1]=
{{1,1,0,0,2}}
Verify these sum to 35:
In[2]:=
11+12+04+08+216
Out[2]=
35
Alternatively, verify with a dot product:
In[3]:=
Coins
[{1,2,4,8,16},35].{1,2,4,8,16}
Out[3]=
{35}
Scope  
(1)

SeeAlso
"XXXX"
RelatedGuides
▪
Wolfram Challenges Algorithms
RelatedLinks
▪
Fewest Number of Coins »
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com