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.
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.
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 Partition Function P -- from Wolfram MathWorld. There is also a simple generating function for fixed k, see formula (2) here.
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
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]].
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…
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.