Re: The randomfunction
From: Espen Amundsen (espen.amundsen_at_broadpark.no)
Date: 11/29/03
- Next message: Edward G. Nilges: "Re: Programmer's unpaid overtime."
- Previous message: Darrell Grainger: "Re: The randomfunction"
- In reply to: Darrell Grainger: "Re: The randomfunction"
- Next in thread: Espen Amundsen: "Re: The randomfunction"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 29 Nov 2003 03:55:02 +0100
Thank you for good answeres. Found some more info about randomness at
http://en2.wikipedia.org/wiki/Hardware_random_number_generator .
"Darrell Grainger" <darrell@NOMORESPAMcs.utoronto.ca.com> wrote in message
news:Pine.GSO.4.58.0311282034310.2614@drj.pf...
> On Fri, 28 Nov 2003, Espen Amundsen wrote:
>
> > Hi
> >
> > Ive ofte used the randomfunction in different languages but Ive never
> > understood how it works. As I see it, truly randomness should be
impossible;
> > so I just have to know how the randomfx works. Does anyone have the
> > sourcecode(any language) or can tell me how thats done?
>
> You are correct that truly random number generators would be impossible in
> a programming language. Most languages will use a mathematical formula to
> generate a sequence of numbers. Most will use a linear congruent method.
> For example:
>
> x' = (a*x + c) % m
>
> where x is the previous number in the sequence, x' is the next number in
> the sequence, a, c and m are set values. The idea is that if you choose a
> and c wisely, the sequence will be the maximum length before repeating.
> For example, if x is an 8 bit char then the sequence will repeat after all
> 256 numbers are use.
>
> --
> Send e-mail to: darrell at cs dot toronto dot edu
> Don't send e-mail to vice.president@whitehouse.gov
- Next message: Edward G. Nilges: "Re: Programmer's unpaid overtime."
- Previous message: Darrell Grainger: "Re: The randomfunction"
- In reply to: Darrell Grainger: "Re: The randomfunction"
- Next in thread: Espen Amundsen: "Re: The randomfunction"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|