Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Making Change

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15160] Making Change
  • From: flip at aznet.net (Wilson Figueroa)
  • Date: Wed, 16 Dec 1998 03:11:30 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Group,

I have a question pertaining to making change.

I was reading The Bathroom Trivia Book and came across the following
statement:

  There are 293 ways to make change for a dollar.

In the book Introduction to Programming with Mathematica by Gaylord,
Kamin and Wellin there is the following routine:

makeChange[x_]:=Quotient[Drop[FoldList[Mod,x,{25,10,
5,1}],-1],{25,10,5,1}]

that will use he fewest of each coin to make change.

is there a way to modify this so that it will enumerate the 293 ways of
making change for a dollar or any number of bills?

For example, for $1.00 the output would show

100, pennies
95 pennies, 1 nickel
90 pennies, 1 dime
90 pennies, 2 nickels

..
..
..

and then tell me there are 293 such enumerations.

Thank you for any help.

Wilson


*** Posted from RemarQ - http://www.remarq.com - Discussions Start Here
(tm) ***


  • Prev by Date: Re: rician random number
  • Next by Date: Help making a Palette
  • Previous by thread: Laplace's Equation
  • Next by thread: Re: Making Change