Page 2 of 2

Re: Please put a good PRNG in 0.8.1

Posted: Fri Feb 22, 2013 5:00 pm
by kikito
I knew I had seen it somewhere. Of course, xkcd.

Re: Please put a good PRNG in 0.8.1

Posted: Fri Feb 22, 2013 6:05 pm
by vrld
Hexenhammer wrote:
vrld wrote:And by "truly random" sequence you probably mean "high entropy", which is what I wrote in the part you kindly mitted... ;)
No, I thought I made it clear that I wasn't talking about distribution issues at all.
Entropy is a different notion than (but connected to) distributions of random variables, so...
Hexenhammer wrote:randomB(1, 10)
May return: 3,6,7,1,1,3,4,8,9.. and if we call it often enough and measure we find that it returns as many 3s as it return 4s etc. (...) However, this "RNG" actually has the characteristic that a 7 is followed by a 1 much more often than by any other number.
Entropy measures how much new information we get by observing stuff. In this example, the entropy of '7, then 1' (formally: H(7|1)) is less than '7, then 2', because we know that '7, then 1' happens more often than other patterns. In other words, it is more interesting to see '7, then 2'. The ideal RNG has entropy H(x) = 1 for any number in the range. `randomB()` does not have this property.

Looking at it from another angle, randomB() does not produce uniformly distributed numbers, just because '7, then 1' is more likely than '7, then 2'. Formally, we can say that P(1|7) > P(2|7), which translates to: the probability of 1 given that we know 7 came before is bigger than probability of 2 given that 7 came before. This violates the 'uniform' characteristic: If `randomB()` returned uniformly distributed numbers, then the probabilities should be equal. Even stronger, the probability of producing a number must not depend on what number(s) have been drawn before: P(1|7) = P(1) = P(2) = P(2|7) (statistical independence).

I think we are talking apples and oranges here. Or we have different definitions/names for basically the same thing.
Anyway, this discussion is getting slightly out of hand. Should we be writing PMslove letters instead?

Edit:PMs -> Love Letters

Re: Please put a good PRNG in 0.8.1

Posted: Fri Feb 22, 2013 6:09 pm
by bartbes
vrld wrote:Should we be writing PMs instead?
That reminds me, why are they not named "love letters"?

Re: Please put a good PRNG in 0.8.1

Posted: Fri Feb 22, 2013 6:11 pm
by Lafolie
bartbes wrote:
vrld wrote:Should we be writing PMs instead?
That reminds me, why are they not named "love letters"?
That would necessitate a pink envelope icon, yay.

Re: Please put a good PRNG in 0.8.1

Posted: Fri Feb 22, 2013 6:32 pm
by slime
bartbes wrote:
vrld wrote:Should we be writing PMs instead?
That reminds me, why are they not named "love letters"?
"I consider, that you commit an error. Write to me in love letter"

hmm...

Re: Please put a good PRNG in 0.8.1

Posted: Fri Feb 22, 2013 6:54 pm
by Hexenhammer
vrld wrote: Anyway, this discussion is getting slightly out of hand.
Agreed. I could continue it by arguing against your definition of "uniform distribution" for starters but I have other things to do too - like continuing to develop my first LÖVE game :ultraglee:

The original point of this thread - me petitioning for a different PRNG implementation - was already addressed so I will just let this issue rest here :cool: