Jump to content

llFrand. Randomness


rasterscan
 Share

You are about to reply to a thread that has been inactive for 1944 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I understood Estelle too.  As I said earlier, the expected value in a normal distribution is the mean of a large collection of random values.  That's how normal distributions are defined.  If you are unfamiliar with basic statistics, there's a fairly good discussion of the Central Limit theorem in Wikipedia.  The bottom line is that if you keep collecting more and more observations and if the mean value of your observations converges on a single number, then your observations fit a normal distribution and are random.

Link to comment
Share on other sites

2 minutes ago, Estelle Pienaar said:

I know, that's why I put law in quotation marks (which at least in my mother tongue marks that a word is not used it in the typical sense - I am not sure about English and other languages).  😉

Tends to increase its meaning in mine. But is not anything worth worrying about.

Link to comment
Share on other sites

8 hours ago, Estelle Pienaar said:

English is not my first language and it is a long time ago that I have dealt with all these matters. What I have tried to do is giving you a hint that your bold claim "that you can't really use statistics to prove how random som ething is" is wrong. Yes you can. Or do you think that anyone can come up with a black box function pretending it simulates randomness and no one could prove him/her wrong? Yes you can. You do not even know the law of large numbers but you continue to make bold statements about other peoples' posts.

This is becoming a little pedantic of me, but  what I meant with

On 2/26/2019 at 12:08 PM, Wulfie Reanimator said:

you can't really use statistics to prove how random something is

is that looking at the end-result of a big average doesn't tell you whether that average came about through randomness or design.

If you repeat a die-roll result of "1 2 3 4 5 6" to infinity and average it, you'll get 3.5.

You could also write any sort of "random pattern" that was fixed (repeating) or just flawed (easily predictable, evenly distributed but not random enough), but would average out in the end if you run it long enough.

That's the crux of "big numbers" that I was referring to. With large numbers you lose any nuance by just averaging it out. Similarly (and more related to the first post), if you have two numbers: 10'000'000 and 0, you can tell that these numbers are very different. But if you were to increment both of these numbers by 1 to infinity, they would become indistinguishably close to each other, as the difference of 10 million would become insignificant when both numbers become unfathomably large. The same applies if you have a tally of 10 different values and increase those by 1 whenever a random number picks them, they'll start off showing differences but those differences will fall within "margin of error" with time.

Edited by Wulfie Reanimator
Link to comment
Share on other sites

3 hours ago, Kyrah Abattoir said:

There are very good sources of entropy nowadays that don't require specific hardware (such as using thermal noise), it's surprising they haven't updated llFrand to use those.

 I think the reason why llFrand is being called "pseudo-random" is because the random result is shared for all scripts/regions on the same sim(aka server).

Even if llFrand was based on thermal noise, the fact that it's shared still makes it pseudo-random. (Though I'm not sure if this is true.)

Edited by Wulfie Reanimator
Link to comment
Share on other sites

2 hours ago, Wulfie Reanimator said:

 I think the reason why llFrand is being called "pseudo-random" is because the random result is shared for all scripts/regions on the same sim(aka server).

Even if llFrand was based on thermal noise, the fact that it's shared still makes it pseudo-random. (Though I'm not sure if this is true.)

It would be pseudorandom if the result is predictable in advance, but is it?

Edited by Kyrah Abattoir
Link to comment
Share on other sites

1 hour ago, Kyrah Abattoir said:
3 hours ago, Wulfie Reanimator said:

 I think the reason why llFrand is being called "pseudo-random" is because the random result is shared for all scripts/regions on the same sim(aka server).

Even if llFrand was based on thermal noise, the fact that it's shared still makes it pseudo-random. (Though I'm not sure if this is true.)

It would be pseudorandom if the result is predictable in advance, but is it?

Never mind, I retract what I said there. The more I think about it the deeper I sink into the unknowables.

But in short, I would say: "Yeah, is it?"

Link to comment
Share on other sites

It's not that easy to test a random number generator. I'm way too lazy to make a test script, that's for sure :)

If interested, have a look here: https://www.random.org/analysis/

In one of my scripts I wasn't satisfied with the output of llFrand so I added my own integer random generator. I don't know how good it really is but unlike llFrand it gives pretty random looking results and that's what I wanted.

string seed = "this text generates the start seed";
integer irnd(integer max) {
	++max;
	seed = llMD5String(seed,0);
	return (integer)("0x"+llGetSubString(seed,0,6))%max;
}

 

  • Like 1
Link to comment
Share on other sites

9 hours ago, Nova Convair said:

It's not that easy to test a random number generator. I'm way too lazy to make a test script, that's for sure :)

If interested, have a look here: https://www.random.org/analysis/

In one of my scripts I wasn't satisfied with the output of llFrand so I added my own integer random generator. I don't know how good it really is but unlike llFrand it gives pretty random looking results and that's what I wanted.


string seed = "this text generates the start seed";
integer irnd(integer max) {
	++max;
	seed = llMD5String(seed,0);
	return (integer)("0x"+llGetSubString(seed,0,6))%max;
}

 

Random is only if the code is sufficient for the task. LSL is not worth being stupidly randomish.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1944 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...