ScratchData LogoScratchData
Back to Layzej's profile

Normal distribution using Box–Muller transform

LALayzej•Created October 18, 2016
Normal distribution using Box–Muller transform
35
21
684 views
View on Scratch

Instructions

Uses the Box–Muller transform to generate <count> normally distributed random numbers and displays the frequency. Use the <standard deviation> slider to change the standard deviation and the <count> slider to change the number of numbers generated between displays.. The main function takes two parameters: mu: mean sigma: standard deviation

Description

https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform sqrt(-2*ln(rnd(0,1)))*cos(rnd(0,180))*sigma+mu I've added a random function (see inside) that takes min, max, and sigma as parameters. The <sigma> parameter let's you determine how many standard deviations you would like to include in your result. The higher you set it the less likely it is for the result to land anywhere near your min/max bounds.

Project Details

Project ID126302896
CreatedOctober 18, 2016
Last ModifiedOctober 27, 2016
SharedOctober 18, 2016
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root