Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Curved Random Distribution

by Roy Johnson (Monsignor)
on Oct 18, 2005 at 17:45 UTC ( [id://501072]=note: print w/replies, xml ) Need Help??


in reply to Re: Curved Random Distribution
in thread Curved Random Distribution

Technically, that would be peak-shaped rather than bell-shaped. That is characteristic of probability curves generated with 2 random inputs. Consider the probability table for 2 6-sided dice, for example.

The higher the number of random inputs, the more the resulting distribution looks like a bell curve.

Update: Yep, I glossed right over the mention of "triangle"; all I saw was bell and curve.


Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^3: Curved Random Distribution
by BrowserUk (Patriarch) on Oct 18, 2005 at 20:01 UTC

    True, but the OP did mention a "triangular" distribution. For a better approximation of a bell curve he might use this:

    sub bRand { my( $target, $variance ) = @_; my $v = sum map rand() * $variance, 1 .. 4; return $target - $variance + ( $v / 2 ); }

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://501072]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2024-04-24 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found