usainboltz.examples.expnums¶
A Boltzmann sampler for Set partitions (Bell numbers).
>>> from usainboltz.examples.expnums import *
>>> from usainboltz.generator import rng_seed
>>> rng_seed(0xDEADBEEF)
>>> res = generator.sample((10, 20))
>>> res.obj
[[9], [2, 0], [11, 6, 1], [5], [12], [4], [13, 10], [3], [7, 8]]
Functions
build (partition) |
-
usainboltz.examples.expnums.
build
(partition)¶