RandomInt

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Grin

RandomInt

Post by Grin »

Hello:) I'm interesting in RandomInt function. I need to know distribution of this function.
Example: Rand(100) < 10
Simple normal distribution gives 10%
RandomInt(100) < 10 is same but if i take range greater, the result willn't be same...
Example: RandomInt(41943)<714 chans isn't 1.7%

Thnx for answers.
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

About all I can say is that I treat a result of 0 as occuring about 2 times as often as I'd expect it to.

So RandomInt(10) == 0 does subjectively occur more than its fair share.
I am just careful of what I assign to a result of 0.

Years ago I saw the results of a small script that recorded the results of of hundreds of randomint throws and of course it tended to even out over time. Just how you can reconcile those two findings I have no idea. :)
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

Duplicate - cannot delete post
Last edited by OldnGrey on Sun Nov 26, 2006 12:57 pm, edited 1 time in total.
Grin

Post by Grin »

And what about RandomDiceRoll? Is situation same?
I can do normal distribution with RandomInt, but it will take more core time for result...
Post Reply