Understanding "randomness"
I can't get my head around this, which is more random?rand()OR:rand() * rand()I´m finding it a real brain teaser, could you help me out?EDIT:Intuitively I know that the mathematical answer will be that...
View ArticleAnswer by abelenky for Understanding "randomness"
"random" vs. "more random" is a little bit like asking which Zero is more zero'y.In this case, rand is a PRNG, so not totally random. (in fact, quite predictable if the seed is known). Multiplying it...
View ArticleAnswer by Matthew Scharley for Understanding "randomness"
Neither is 'more random'.rand() generates a predictable set of numbers based on a psuedo-random seed (usually based on the current time, which is always changing). Multiplying two consecutive numbers...
View ArticleAnswer by Dr. belisarius for Understanding "randomness"
Just a clarificationAlthough the previous answers are right whenever you try to spot the randomness of a pseudo-random variable or its multiplication, you should be aware that while Random() is usually...
View ArticleAnswer by staticsan for Understanding "randomness"
Some things about "randomness" are counter-intuitive. Assuming flat distribution of rand(), the following will get you non-flat distributions:high bias: sqrt(rand(range^2))bias peaking in the middle:...
View ArticleAnswer by Eric Towers for Understanding "randomness"
Most rand() implementations have some period. I.e. after some enormous number of calls the sequence repeats. The sequence of outputs of rand() * rand() repeats in half the time, so it is "less random"...
View ArticleAnswer by Fordi for Understanding "randomness"
Floating randoms are based, in general, on an algorithm that produces an integer between zero and a certain range. As such, by using rand()*rand(), you are essentially saying...
View ArticleAnswer by dvhh for Understanding "randomness"
The answer would be it depends, hopefully the rand()*rand() would be more random than rand(), but as:both answers depends on the bit size of your valuethat in most of the cases you generate depending...
View ArticleAnswer by Wil for Understanding "randomness"
When in doubt about what will happen to the combinations of your random numbers, you can use the lessons you learned in statistical theory.In OP's situation he wants to know what's the outcome of X*X =...
View ArticleAnswer by valadil for Understanding "randomness"
Here's a simple answer. Consider Monopoly. You roll two six sided dice (or 2d6 for those of you who prefer gaming notation) and take their sum. The most common result is 7 because there are 6 possible...
View ArticleAnswer by user479538 for Understanding "randomness"
Most of these distributions happen because you have to limit or normalize the random number. We normalize it to be all positive, fit within a range, and even to fit within the constraints of the memory...
View ArticleAnswer by PachydermPuncher for Understanding "randomness"
The concept you're looking for is "entropy," the "degree" of disorder of a stringof bits. The idea is easiest to understand in terms of the concept of "maximum entropy".An approximate definition of a...
View ArticleAnswer by Juliet for Understanding "randomness"
It might help to think of this in more discrete numbers. Consider want to generate random numbers between 1 and 36, so you decide the easiest way is throwing two fair, 6-sided dice. You get this: 1 2 3...
View ArticleAnswer by Janco for Understanding "randomness"
I guess both methods are as random although my gutfeel would say that rand() * rand() is less random because it would seed more zeroes. As soon as one rand() is 0, the total becomes 0
View ArticleAnswer by Jay for Understanding "randomness"
As others have said, the easy short answer is: No, it is not more random, but it does change the distribution.Suppose you were playing a dice game. You have some completely fair, random dice. Would the...
View ArticleAnswer by user479885 for Understanding "randomness"
Consider you have a simple coin flip problem where even is considered heads and odd is considered tails. The logical implementation is:rand() mod 2Over a large enough distribution, the number of even...
View ArticleAnswer by Huub for Understanding "randomness"
Multiplying numbers would end up in a smaller solution range depending on your computer architecture.If the display of your computer shows 16 digits rand() would be say 0.1234567890123multiplied by a...
View ArticleAnswer by Donal Fellows for Understanding "randomness"
It's not exactly obvious, but rand() is typically more random than rand()*rand(). What's important is that this isn't actually very important for most uses.But firstly, they produce different...
View ArticleAnswer by Daniel Earwicker for Understanding "randomness"
The accepted answer is quite lovely, but there's another way to answer your question. PachydermPuncher's answer already takes this alternative approach, and I'm just going to expand it out a little.The...
View Article