How do I generate a uniform random integer partition?

前端 未结 7 579
天命终不由人
天命终不由人 2020-12-14 08:31

A Google search reveals plenty about generating all possible partitions of an integer n into m parts, but I haven\'t found anything about sampling a uniformly distributed ra

7条回答
  •  离开以前
    2020-12-14 09:22

    After some googling I found an algorithm for this in the "Handbook of Applied Algorithms," which Google Books has indexed. The algorithm is given in section 1.12.2, on page 31.

提交回复
热议问题