Message Boards Message Boards

IntegerPartitions computation can't be stop?

Posted 8 years ago

If I start a time-consuming calculus within Programming Lab, Desktop, Win10, i.e. "IntegerPartitions[n, {k}] with n=900, k=100", Wolfram takes over the whole computer and nothing can stop it anymore. No Ctrl-C or Ctrl-ALT-DEL. No chance to get to the task manager, to kill Wolfram. It needs a Power-Off, to stop it.

Crazy!

POSTED BY: Werner Geiger
9 Replies
Anonymous User
Anonymous User
Posted 8 years ago

i'm not a win10 user however "resource limits" can be set per application (and per user) on any modern OS. that means mathematica would not be able to hog (disk, cpu, maybe other) resources you need to keep your computer responsive.

as far as the mathematica notebook doing the calculation it would normal for it to appear not to respond

however, there are keys that "interrupt OR abort" the current calculation

the calculation may generate huge data quickly and be transferring the data to the front end (viewer window, which cannot take and view that much data quickly or at all). in the older mathematica (ie, version 4) the only remedy was to 'xkill' the front end and connect another (advanced usage) or quit and re-open mathematica

imho it should be easier than it was for mm 4.0

POSTED BY: Anonymous User

Yes, it is not a built-in function but they are easy to count, e.g. using the recurrence relation (59) for P(n, k) in http://mathworld.wolfram.com/PartitionFunctionP.html. There is also a simple generating function for fixed k, see formula (2) here.

POSTED BY: Ilian Gachevski

Thanks for sharing, could be a nice extension for the built-in PartitionsP...

POSTED BY: Sander Huisman
Posted 8 years ago

Yes. Unfortunately PartitionsP has just the one parameter n. The k- and s-Parameters of IntegerPartitions are not present.

BTW: The background of my problem ist: How to distribute n=900 people into k=100 busses with some constraints, e.g. no bus empty and m seats per bus. Plus some more constraints. To start from, I would use IntegerPartitions[n,{k},Range[m]].

POSTED BY: Werner Geiger

The k parameter is quite easy to program, I think however that the s parameter is way way way more tricky. I think IntegerPartitions uses some recursive dynamic programming when s is given basically iterating in some fancy way... This will not be possible large k...

This problem might be very hard to calculate and requires some mathematical insight to calculate it, simply using IntegerPartitions won;t work for the coming decades as Ilian explained...

POSTED BY: Sander Huisman
Posted 8 years ago

Yes, I know. I think I have the mathematical background. With the known recursions and generating functions, I should at least be able to calculate the numbers without knowing the partitions themselves.

The problem is just for fun, not a real problem. Hence I will just solve it with smaller numbers for n, k, m.

POSTED BY: Werner Geiger

"IntegerPartitions[n, {k}] with n=900, k=100

That is an interesting example, because the number of such partitions is 4575606410347783724917707119. Since each of them will occupy a modest amount of memory (2496 bytes), you would need a computer with at least 1.14207 10^22 gigabytes of RAM.

POSTED BY: Ilian Gachevski

Just out of curiosity: How did you get the number? PartitionsP counts all the sizes k. not only k=100...

POSTED BY: Sander Huisman
Posted 8 years ago

Nice! But I think, a program should realize if it is running out of memory and terminate the calculus with an error message.

POSTED BY: Werner Geiger
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract