Random Creation of Probability Function Profiles This animation demonstrates how one can choose random numbers that will result in a needed probability profile like a gaussian or an exponential which are demonstrated here. For quantum mechanics animations such randomly selected positions are needed because there is no a priori way of deciding where on the particular profile the next particle will be added. A prime example is electron or photon diffraction by a screen with multiple slits. As one can see from the graph, the red fiducials separation is proportional to the abscissa of the required profile. An array kCprd[] contains the integer values represented by these fiducials. To use the array we select a random number (shown as a blue dot) between 0 and the value of the last element of kCprd[]. This random number is more likely to fall within one of the wider fiducial spacings and when it does, a bin associated with that fiducial is incremented. This results in a statistically valid representation of the required probability profile and after many iterations the resulting discrete histogram agrees well with the algebraic (smooth line) profile. To see how the statistical profile is built up the learner should select the Single Step check box and repeat pressing Start. Then you can see the blue dot that represents the random number selected and see how the bin associated with that random number if incremented. As in all of the physicsanimations.org/index applications, you can see the javascript source code by pressing F12 and selecting Sources and then pressing F5 to restart the program.
maxX
Single Step
Gaussian
Exponential