From N V Fitton, ideas to share with my students at Northern Virginia Community College, Alexandria campus.
I teach mathematics and computer science.

Tuesday, May 06, 2008

random number generation

As you know, this is one of my favorite things. This short article <click> gives a concise overview of one of many methods for cooking up random numbers.

The basic idea for all RNG algorithms that I have seen is to pick a starting value, call it X0, then to let X1 be a function of X0, X2 a function of X1, ... Xn a function of X(n-1), ... And these X values provide a sequence of pseudo-random numbers, a sequence actually completely determined by its starting point.

In this case, one chooses a several X values and combines them for the new X. The constants in this algo look pretty silly, but still you get the flavor of the thing. You can choose much smaller numbers for the constants and program the algorithm in a TI calculator using sequence operations, which are described in the TI manuals, for which links are given on many a math teacher's home page.

0 Comments:

Post a Comment

<< Home