in reply to Randomly biased, random numbers.

Sounds like you want to a number of distributions, from "one big clump" to "almost uniform", at random.

What about generating several "poles" as clump attractors, each with a random weight for attractiveness. Then let each point "roll" down hill according to the attractor weights and distances. So generate 3D coordinates, and use the extra value as the weight. Something like this:

for my $trial (1..$max_trials) { my @attractors; for my $attractors (1..int(rand($max_attractor))+1) { my @attractor = get_random_tuple(3,\@attractor_limits); push @attractors, \@attractor; } my @grid_points; for my $points ($min_points..$max_points) { my @point = get_random_tuple(2,@grid_point_limits); # $alpha limits the distance moved downhill, and could be rand +om @point = roll_down_hill(\@point, \@attractors, $alpha); push @grid_points, \@point; } my $result = analyze_data(\@grid_points); } sub get_random_tuple { my $size_of_tuple = shift; my $limits_ref = shift; my @tuple; for my $limit (@$limits_ref) { push @tuple, rand($limit); } return @tuple; } sub roll_down_hill { # left as an exercise for OMAR! }

You can also play with variations of roll_down_hill to try different distributions, going from sub-linear to exponential (or maybe some of each), trying a host of different functions for transformations. And don't forget you can play with the distributions wherever you take a random number, including the number of attractors and their weights. For instance, you might find that fewer attractors are more likely to cause worst case behavior, and bias the number of attractors in the small direction.

-QM
--
Quantum Mechanics: The dreams stuff is made of