Module for random array distribution

T

Tomek

Hello!

First of all, it is very hard to search CPAN for that module, cause almost
all modules contain words array and distribution ;)

What am I going to achieve is to semi-randomly fill an array. There are 2
main goals: sum of elements, and min/max for each elem)

I have for example 2000 to split between 100 array elements. I don't want
to do this equally ( 100 x 20 ), but want to set a deviation, for example
50% so that minimum value for element is 5 and maximum is 15. All that
have to sum up to 2000 at the end.

I am sure somebody already written such module, I just can find it :(

Regards, T. Kraus
 
X

xhoster

Tomek said:
Hello!

First of all, it is very hard to search CPAN for that module, cause
almost all modules contain words array and distribution ;)

The word "array" is not going to be particularly useful, anyway. Most
modules are going to be named by what they do, not by what data structure
they will use to store the results of what they do.
What am I going to achieve is to semi-randomly fill an array. There are 2
main goals: sum of elements, and min/max for each elem)

I have for example 2000 to split between 100 array elements. I don't want
to do this equally ( 100 x 20 ), but want to set a deviation, for example
50% so that minimum value for element is 5 and maximum is 15. All that
have to sum up to 2000 at the end.

That isn't unambiguously described. How do you get the 5 and 15 out of
50%? What distribution must the numbers approximately follow (uniform,
gaussian, exponential, don't care)? Do the min and max and the sum need to
be achieved precisely or only asymptomatically?
I am sure somebody already written such module, I just can find it :(

I don't see why this would be particularly likely to have had a module
written for it. It seems like a pretty unusual request, at least as
stated.

Xho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top