## Random Numbers

Moderator: Board moderators

Ming Han
Learning poster
Posts: 77
Joined: Thu Jun 06, 2002 7:10 pm
Location: Singapore
Contact:

### Random Numbers

I don't know if this is really connected with algorithm or not,
but as programmers, we should all know this...

The debate on Random Numbers

To start the ball rolling...

This was from a friend by the name of Mak:
I think, too, that any number generated from a system is quite impossible to be a totally random one. I also think, rather radically though, that nothing is totally random

This is from somewhere:
The idea behind random numbers is not to be completely random, but to mimic randomness.
Imagine if you were a scientist working on a program to measure the effects of an earthquake on a building.
Since earthquakes can be considered somewhat random, you might want to see what happens if you do use
random numbers in terms of the earthquake.
Then you see the results. Then you tweak a variable here and there (proximity of building to other buildings, weight of building, etc)
and run it again. You would prefer in cases like this
to have the same earthquake, so the "random" numbers are run through again.
This is from Alvin:
Anyway, to side-track a little, and though this may seem obvious to some, the concept of two calculations having the same results (in this case, F-f-f-f-f-f-f.... = F+f-f+f-f.... On both sides of the ball) emphasizes on the (erm...) fact that there are multiple ways of deriving the same result, further disproving the whole idea of
:: HanWorks ::

Shahab
New poster
Posts: 24
Joined: Sun Nov 10, 2002 2:17 pm
Hi,

Ofcourse the random numbers are very important (for example in making public keys in RSA method).
And also you are right about random numbers in programming languages. But I've heard about programs that generate random numbers not internally( for example , having the times of pressing keys for typing a sentence, and then giving it to a function, it can generate an absolutely random number) so, I think that we can have random numbers. What do you think about it?

Thank you.

Ming Han
Learning poster
Posts: 77
Joined: Thu Jun 06, 2002 7:10 pm
Location: Singapore
Contact:

### Hello

Thanks for the response.

According to MS Press COmputer Dictionary, random number generation is defined as,
Production of an unpredictable sequence of numbers in which no number is any more likely to occur at a given time or place in the sequence than any other. Truly random number generation is generally viewed as impossible.
Of couse, there might be ways to improve the randomess of the number, but exactly how random can that be. Since the number generated is by an algorithm, how can it be random at the same time??

Ming Han
:: HanWorks ::

suman
New poster
Posts: 45
Joined: Fri Oct 19, 2001 2:00 am
Contact:

### Try D.E.Knuth Volume 2

Hi,
Let me suggest you one thing. Why don't you try reading Volume 2 of The art of computer programming by D.E. Knuth? An entire chapter (chapter 3) is devoted on random numbers. Also see java source java.util.Random.java for its implementations. You can see some corrections as proposed in the correction page of "taocp". Goodlack.

- Suman