| For many types of scientific simulations, randomness 
              is a key feature. In the microscopic world, quantum mechanics works 
              with probabilistic analysis rather than strict determinism. For 
              example, in the simulation of elastic collisions (that is, the particle 
              types don't change) in a high energy particle experiment, the scattering 
              angle of a particle off another should differ from collision to 
              collision just as they do in an experiment. The theory gives us 
              the distributions over many events of angles, energies, and momenta 
              for the scattered particles.  Similarly, in the macroscopic world we deal with many 
              random processes. A simulation of the lifetime of a low earth orbiting 
              satellite must deal with the fluctuations in atmospheric density 
              due to solar flares and other solar heating variations. A simulation 
              of a mechanical system, such as a pump, might allow for random variations 
              in material strengths and dimensions to see how performance and 
              lifespan will vary among many such devices produced from an assembly 
              line. Not Your Usual Random Distribution The random parameters in such cases don't always follow 
              a nice flat uniform distribution or a Guassian. For example, in 
              the the particle collision case, the scattering angle would typically 
              peak in the forward direction and drop to low, but not necessarily 
              zero values (as Rutherford discovered) for scatteing of 180 degrees 
              backwards. Furthermore, real world details can bias the distributions 
              in unique ways. Our particle scattering simulation might also simulate 
              a detector surrounding the collisions. The detector will typically 
              cover less than the full solid angle and might have inefficiencies 
              and dead areas at the seams between detector components.  Running our scattering simulator will result in most 
              scattered particles going down the beampipe and not into the detector. 
              If we are studying the efficiencies of our detector we might want 
              to skip the simulation of the collisions and just "artificially" 
              produce particles going through our detector. We could use a random 
              "angle generator" that only produces particles at angles 
              that enter active areas of the detector. Generating Custom Random 
              Distributions  In Chapter 4: 
              Tech we discussed the uniform random number generators available 
              in the core language packages. In Chapter 
              7: Tech we discussed generating non-uniform distributions with 
              the transformation and rejection techniques. In the next section 
              - Generating Custom Random Distributions 
              - we use the rejection method to generate a random distribution 
              that follows a sloped line. In the Histogram 
              Distribution page we will use a given histogram distribution 
              to guide the generation of random values via the rejection technique. Last Update: Feb.1.04 |