NAME

Math::Partition::Rand - Random floating point additive partitions

VERSION

version 0.0302

SYNOPSIS

use Math::Partition::Rand;
my $partition = Math::Partition::Rand->new( top => 1, n => 3 );
my $distribution = $partition->choose();
# [ 0.228102577310889, 0.0880906485615138, 0.683806774127597 ]

DESCRIPTION

A Math::Partition::Rand object does one thing: it partitions a number (top) into a given number of "random addition sequences" (n). That is, the sequences add up to the original number.

METHODS

new()

$partition = Math::Partition::Rand->new(%arguments);

Create a new Math::Partition::Rand object.

Arguments and defaults:

top => 1,
n   => 2,

choose()

$distribution = $partition->choose;
# [ 0.3161932258724, 0.683806774127597 ] for instance

Partition the given number top into n addition sequences.

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Gene Boggs.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.