Group Abstract Group Abstract

Message Boards Message Boards

IntegerPartitions computation can't be stop?

Posted 10 years ago
POSTED BY: Werner Geiger
9 Replies
Anonymous User
Anonymous User
Posted 10 years ago
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 10 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
POSTED BY: Sander Huisman
Posted 10 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
POSTED BY: Sander Huisman
Posted 10 years ago
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