RANDOM PARTITION
Name:
Type:
Purpose:
Generate a random partition of a positive integer.
Description:
Given a positive integer n, a partition of n is
defined as
n = r_{1} + r_{2} + ... +
r_{k}
(r_{1} ≥ r_{2} ≥
... ≥ r_{k})
where r_{1}, r_{2}, ....,
r_{k} are positive integers.
For example, if n = 6, then there are 3 partitions:
6

=

4 + 1 + 1


=

3 + 2 + 1


=

2 + 2 + 2

Syntax:
Examples:
LET N = 5
LET Y = RANDOM PARTITION
Note:
Dataplot implements this command using the RANPAR algorithm
described in Nijenhuis and Wilf (see Reference section
below).
Note:
Default:
Synonyms:
Related Commands:
Reference:
Nijenhuis and Wilf (1978), "Combinatorial Algorithms",
Second Edition, Academic Press, Chapter 10.
Applications:
Implementation Date:
Program:
LET N = 8
LET Y = RANDOM PARTITION
PRINT Y
Date created: 1/12/2009
Last updated: 1/12/2009
Please email comments on this WWW page to
alan.heckert@nist.gov.
