1. ## real random numbers

Hi,

is there an existing function in C like rand(), but which creates real
random numbers?

newatC

2. Well, since computers cannot think like any human being, "random numbers" are always depend on something (like clock cycles for example!)

You can use srand() for better results.

3. http://faq.cprogramming.com/cgi-bin/...&id=1043284385

By real - you mean really random, cannot be predicted in advance using any known algorithmic technique?

Or real as in a floating point number between 0.0 and 1.0 say?

4. Originally Posted by fnoyan
Well, since computers cannot think like any human being, "random numbers" are always depend on something (like clock cycles for example!)

You can use srand() for better results.
hint: humans are far worse random number generators than computers have the potential to be...

5. >> Or real as in a floating point number between 0.0 and 1.0 say?

I think he means that. You could make a random function which multiplies a few random numbers together and returns the result. You could even use rand() to get the number of times things are multiplied! Oh, the possibilities!

6. hmm... wouldnt multiplication of (pseudo-)random numbers change the distribution? For example, there is a probability of 1/6 to get a given number from rolling a 6 sided die, but rolling the die twice (or using two dice) would not lead to a probability of 1/36 for each possible number.

7. no it doesn't, it creates a weighted randomness... that's why 7 is a 'lucky' number.

Code:
``` 2  3  4  5  6  7
3  4  5  6  7  8
4  5  6  7  8  9
5  6  7  8  9 10
6  7  8  9 10 11
7  8  9 10 11 12

Ocurrances:
1 has 0 possibilities
2 has 1 possibilities
3 has 2 possibilities
4 has 3 possibilities
5 has 4 possibilities
6 has 5 possibilities
7 has 6 possibilities```

"no it doesn't" was said in agreement to you laser
[/edit]

8. Hi,