Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: How to generate restricted partitions of an integer

by borisz (Canon)
on Nov 11, 2004 at 13:31 UTC ( #407030=note: print w/replies, xml ) Need Help??

in reply to Re: How to generate restricted partitions of an integer
in thread How to generate restricted partitions of an integer

No, I search for distinct combinations only. So I can exchange 100e only one into another 100e.
  • Comment on Re^2: How to generate restricted partitions of an integer

Replies are listed 'Best First'.
Re^3: How to generate restricted partitions of an integer
by jdporter (Canon) on Nov 11, 2004 at 14:29 UTC
    Well, you did say "how often", which is probably a pretty stupid way of phrasing the problem. It certainly led me to think that the problem involved repeated changings, e.g. once I've broken it into two 50s, what can I do with the two 50s. It now seems that you meant to say "How many ways", rather than "How often". I mean, how often? Once per day? Twice per second?

      And how would you phrase the question in Russian?

      Sorry, I can not express it any better. Look at the example please. The answer, 50 is correct. I think 'How many ways' is good. Just search for any combination of 100, 50, 20 , 10 and 5 euro notes where the sum is 100 without repeating a combination. I hope it is clearer to you now.
      Boris I understand the problem. If I dust of my math degree...I think this could be solved with generating functions. Basically, calculate (x+ x**5+ x**10 + x**20 + x**50 + x**100)**100 and find the coeffieient of x**100 in the resulting polynomial. Easy...;)


        Feel the white light, the light within
        Be your own disciple, fan the sparks of will
        For all of us waiting, your kingdom will come

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://407030]
[marioroy]: ... including MCE 1.830. Finally, reached the finish line. All is well.
[marioroy]: The issue on the Windows platform is many workers loading "required" modules simultaneously, more so with XS modules.
[marioroy]: ... at runtime.
[marioroy]: The other problem is if a module isn't thread or multi-process safe, there's no posix_exit equivalent on the Windows platform without exiting the entire script.
[Discipulus]: and the workaround you proposed works better? ie load them once and then copy them for threads?
[Discipulus]: ah this is another interesting point: how to know if a module is or is not thread safe?
[Discipulus]: .. sorry mario if i'm bothering you at 5:46

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2017-09-22 09:47 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (260 votes). Check out past polls.