SRL Archive - OSR Help

Randomization


xdarkshadowx

2013-01-05 02:39:27

I'm assuming the random() function has the same odds for each number, it's just as it goes, random. Now I'm wondering if we have any functions for bell curve randomness//normal random curves. As I believe those would be much more human like for clicking on buttons (you'll normally hit the center, and less and less often click the edges).

I found gaussRandom but I don't think this is the same thing as a normal curve.

Thanks


Edit: what would it look like if you did random(1) and just added it up however many times, basically using the normal-curve-ness of a coin flip to create a normal bell curve.

DannyRS

2013-01-05 02:42:04

You could put a mousebox for the center in a random case statement that will 70% of the time use that option and the rest use a larger mousebox

Something along these lines?


Case Of Random(10)
Begin
0..7 : Begin MouseBox(10, 10, 10, 10) End;
8..10 : Begin MouseBox(20, 20, 20, 20) End;
End;

xdarkshadowx

2013-01-05 02:44:05

From: DannyRS
You could put a mousebox for the center in a random case statement that will 70% of the time use that option and the rest use a larger mousebox


400 edited mouse boxes and if statements later…

:s gotta be a simpler way to do it.

DannyRS

2013-01-05 02:49:20

From: xdarkshadowx
400 edited mouse boxes and if statements later…

:s gotta be a simpler way to do it.


Sorry musta misunderstood what your trying to do ;), not sure then

Edited my first post to show what i meant, i think it would simulate what you want

riwu

2013-01-05 03:01:01

From: xdarkshadowx
I'm assuming the random() function has the same odds for each number, it's just as it goes, random. Now I'm wondering if we have any functions for bell curve randomness//normal random curves. As I believe those would be much more human like for clicking on buttons (you'll normally hit the center, and less and less often click the edges).

I found gaussRandom but I don't think this is the same thing as a normal curve.

Thanks


Edit: what would it look like if you did random(1) and just added it up however many times, basically using the normal-curve-ness of a coin flip to create a normal bell curve.

What do you mean by 'normal random curves'? If it means a normal distribution, that is exactly what the gauss functions does (and MouseBox uses it as well).

But you mentioned about 'normal-curve-ness of a coin flip'? Can you elaborate on that? :rolleyes:

xdarkshadowx

2013-01-05 03:06:31

From: riwu
What do you mean by 'normal random curves'? If it means a normal distribution, that is exactly what the gauss functions does (and MouseBox uses it as well).

But you mentioned about 'normal-curve-ness of a coin flip'? Can you elaborate on that? :rolleyes:


Yes the normal distribution, but the gauss function doesn't have any imputs for standard deviation ect, so I'm trying to figure out what kind of random curve it makes.


if you flip a coin, you'll either get heads or tails (1 or 0 in this case). now if you keep going you'll end up with pascals triangle, which mimicks a normal distribution if I recall correctly.

riwu

2013-01-05 03:33:47

From: xdarkshadowx
Yes the normal distribution, but the gauss function doesn't have any imputs for standard deviation ect, so I'm trying to figure out what kind of random curve it makes.


if you flip a coin, you'll either get heads or tails (1 or 0 in this case). now if you keep going you'll end up with pascals triangle, which mimicks a normal distribution if I recall correctly.

One of them generates a standard normal curve (mean 0 SD 1), you can use

function GaussRand(mean, dev: Extended): Extended;
for customized mean and dev.

Flipping a coin is a binomial distribution which can be approximate to a normal distribution, of which the accuracy increases as sample size increases.

xdarkshadowx

2013-01-05 03:46:14

From: riwu
One of them generates a standard normal curve (mean 0 SD 1), you can use

function GaussRand(mean, dev: Extended): Extended;
for customized mean and dev.

Flipping a coin is a binomial distribution which can be approximate to a normal distribution, of which the accuracy increases as sample size increases.


Yes Yes yes, you're right. now my only dillema is that the GaussRand function has no bounds (whereas I could easily give a binomial curve bounds). Now to decide how to randomize from now on..

Mostly just worried that the computer will decide to hate me and generate a number that +/- 5 or so SD and totally kill itself :p

riwu

2013-01-05 03:54:12

From: xdarkshadowx
Yes Yes yes, you're right. now my only dillema is that the GaussRand function has no bounds (whereas I could easily give a binomial curve bounds). Now to decide how to randomize from now on..

Mostly just worried that the computer will decide to hate me and generate a number that +/- 5 or so SD and totally kill itself :p

You can simply set up a simple loop to regenerate the numbers until it is within the intended bounds. Technically this won't be a normal distribution anymore (since an actual normal dist extends to +/- infinity), but that's the most accurate way to model a practical situation after the normal distribution.

xdarkshadowx

2013-01-05 03:59:20

From: riwu
You can simply set up a simple loop to regenerate the numbers until it is within the intended bounds. Technically this won't be a normal distribution anymore (since an actual normal dist extends to +/- infinity), but that's the most accurate way to model a practical situation after the normal distribution.


Perfect Idea, Thank you :)