Perl Monk, Perl Meditation | |
PerlMonks |
Re: Randomly biased, random numbers.by kcott (Archbishop) |
on Dec 06, 2013 at 10:09 UTC ( [id://1065949]=note: print w/replies, xml ) | Need Help?? |
G'day BrowserUk, "But the worse case scenarios for the algorithm are when you get a bunch of points grouped in one place and then a few outliers far away. Either in another bunch, or widespread." Perhaps the following might be suitable. The "bunch of points grouped in one place" tend towards the centre of the plane; the outliers are typically widespread rather than forming outlying clumps.
Here's a sample run showing an (ASCII) graphical representation of the generated data. Note that I've only used an 80x80 grid (rather than your posted 500x500) to get a reasonable display. <Reveal this spoiler or all in this thread>
Update: I removed two lines with $loops which I'd used for testing but aren't part of the solution. -- Ken
In Section
Seekers of Perl Wisdom
|
|