Ways to produce specific value out of limited set

  • Context: Undergrad 
  • Thread starter Thread starter martix
  • Start date Start date
  • Tags Tags
    Set Specific Value
Click For Summary

Discussion Overview

The discussion revolves around the problem of determining the number of ways to produce a specific monetary value (2 dollars) using a limited set of coin denominations (1, 2, 5, 10, 20, 50, 100 cents). Participants explore various mathematical approaches to tackle this combinatorial problem, including generating functions and multisets.

Discussion Character

  • Exploratory
  • Mathematical reasoning

Main Points Raised

  • One participant presents the problem of producing 2 dollars using various coin denominations and mentions counting multisets as a potential approach, though it proves insufficient.
  • Another participant suggests using generating functions to solve a simpler related problem of making change for 50 cents, detailing the mathematical formulation and steps involved in deriving the number of combinations.
  • A third participant expresses agreement with the use of generating functions and references a classic problem of making change for a dollar, indicating a broader context for the discussion.
  • Another participant emphasizes the power of generating functions for counting problems and encourages others to learn about them.

Areas of Agreement / Disagreement

There is no consensus on a single solution method, as participants propose different approaches, including generating functions and multisets. The discussion remains open-ended with multiple viewpoints on how to tackle the problem.

Contextual Notes

The discussion does not resolve the specific mathematical steps or assumptions involved in the various proposed methods, leaving some aspects of the problem open to interpretation.

martix
Messages
167
Reaction score
5
I have this infuriating little problem I'm trying to solve:
How many ways are there to produce 2 bucks out of any number of coins?

So this means - how many ways to get 200 by adding 1, 2, 5, 10, 20, 50, 100.

The best idea I could come up with so far in my research was counting multisets, but that didn't get me very far.
 
Physics news on Phys.org
It is for such a problems that generating functions are useful.

I would take a look in the great book "concrete mathematics" by Graham, Knuth and Patashnik.

I'll solve the following easier problem:
How many ways to get 50 out of 1 and 5.

Let's first assume that we have nothing but pennies (denotes by p). The sum of all ways to leave some number of pennies in change can be written as

[tex]X=1+p+p^2+p^3+...[/tex]

thus the 1 means that we leave no pennies, the p means we leave 1 penny, etc.

Now, if we're also allowed to use nickels (denotes by n), then the number of ways we can leave change is

[tex]Y=X+nX+n^2X+n^3X+...[/tex]

the X means we leave a number of pennies and no nickels, the nX means we leave one nickel, etc. Obviously

[tex]Y=(1+n+n^2+n^3+...)X=(1+n+n^2+n^3+...)(1+p+p^2+p^3+...)[/tex]

This product contains terms like nnnpppp, which means we leave 3 nickels and 4 pennies. Now, we use a little trick, we exchange p with z and n with [tex]z^5[/tex], we get

[tex]Y=(1+z+z^2+z^3+...)(1+z^5+z^{10}+z^{15}+...)[/tex]

We are actually interested in [tex]z^{50}[/tex] in this product, since the coefficient will tell us the number of ways we can pay 50.

Now the generating functions come into the play. These give us that

[tex]\frac{1}{1-z}=1+z+z^2+z^3+...~\text{and}~\frac{1}{1-z}=1+z^5+z^{10}+z^{15}+...[/tex]

Thus,

[tex]X=\frac{1}{1-z}~\text{and}~Y=\frac{X}{1-z^5}[/tex]

or equivalently

[tex](1-z)X=1~\text{and}~(1-z^5)Y=X[/tex]

Now, we can find the coefficient of [tex]z^n[/tex] by following recurrence relations: (denote the coefficient of zn in X (resp. Y) as Xn (resp. Yn). Then we get

[tex]X_n=X_{n-1}~\text{and}~Y_n=Y_{n-5}+X_n[/tex].

Thus, for n=50, we get

[tex]Y_{50}=Y_{45}+X_{50}=Y_{40}+X_{45}+X_{50}=...=Y_0+X_5+X_{10}+X_{15}+...+X_{50}[/tex].

Now, it is easy to see that [tex]X_n=1[/tex] and that [tex]Y_0=1[/tex], thus we get

[tex]Y_{50}=10[/tex]

So there are 10 ways of paying.Note, that there are ways to give clean closed-form formulas of [tex]Y_n[/tex]. But I won't give them here. For that, I should read the book Concrete mathematics...
 
Like micromass, I am a big fan of generating functions as discussed in "Concrete Mathematics".

The classic problem along these lines is "How many ways can you make change for a dollar?" If you would like to see an approach that doesn't use generating functions, see this link:

http://mathforum.org/library/drmath/view/57912.html
 
Generating functions are very powerful if you want to count things. If you can get the time to learn them, I would suggest it.
 

Similar threads

  • · Replies 76 ·
3
Replies
76
Views
7K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K