[FRIAM] random vs pseudo-random

Roger Critchlow rec at elf.org
Thu Apr 23 03:37:13 EDT 2009


On Thu, Apr 23, 2009 at 1:05 AM, Nicholas Thompson <
nickthompson at earthlink.net> wrote:

>
> Can anybody help me understand this.  (Please try to say something more
> helpful than the well-deserved, "Well, why do you THINK they call it
> pseudo-random, you dummy?")What DOES a pseudo randomizing program look like?
>
>
>

This one is called a linear congruential generator:

x[i+1] = (a * x[i] + b) modulo m

x[i] is the current random number, x[i+1] is the next random number, for
appropriate choice of a, b and m the sequence of numbers produced will go
through all the numbers from 0 to m-1 in some order over and over again.

The choice of a = 1, b = 1 enumerates in increasing order, and the choice of
a = 1, b = -1 enumerates in decreasing order.  Neither is a very good
choice, but they aren't the only bad choices.  For instance, a = 0 is
probably the worst choice of linear congruential multiplier.

You might try out different values for a and b in a spreadsheet with m =
17.  Or just do it on paper.

-- rec --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://redfish.com/pipermail/friam_redfish.com/attachments/20090423/fe7ef45d/attachment.html>


More information about the Friam mailing list