Numerical Computing with MATLAB

Chapter 9: Random Numbers

This chapter describes algorithms for the generation of pseudorandom numbers with both uniform and normal distributions.

9.1 Pseudorandom Numbers

Here is an interesting number:

      0. 95012928514718

This is the first number produced by the MATLAB random number generator with its default settings. Start up a fresh MATLAB, set format long, type rand, and it's the number you get.

If all MATLAB users, all around the world, all on different computers, keep getting this same number, is it really "random"? No, it isn't. Computers are (in principle) deterministic machines and should not exhibit random behavior. If your computer doesn't access some external device, like a gamma ray counter or a clock, then it must really be computing pseudorandom numbers. Our favorite definition was given in 1951 by Berkeley professor D. H. Lehmer, a pioneer in computing and, especially, computational number theory:

A random sequence is a vague notion in which each term is unpredictable to the uninitiated and whose digits pass a certain number of tests traditional with statisticians

9.2 Uniform Distribution

Lehmer also invented the multiplicative congruential algorithm, which is the basis for many of the random number generators in use today. Lehmer's generators involve three integer parameters, a, c, and m, and an initial value, x 0, called the seed. A sequence of integers is defined by

The operation "mod m" means take the remainder after division by m. For...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Packet Generators
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.