Jump to content

Botting and Probability


dreameo

Recommended Posts

There's a misconception regarding the use of randoms. Doing all these complicated randoms and nested randoms all boil down to a single probability.

For example:

(random(0,4) would generate numbers from 0-3 with 0 being inclusive and 4 being exclusive)

 

Example 1:

random(0,4) generates 4 numbers: 0,1,2,3. The odds of landing on any one number is 25%.

 

Example 2:

if(random(0,4) == 1) {

   if(random(0,10) == 1) {

      // I see this often

   }

}

 

Now the probability of this also boils down to a single probability. Lets do the math:

25% to get 1 on the first "if" statement, 10% chance to get 1 on the second "if" statement. This gives you a total probability of (.25 * .10) 2.5% chance.

So this means Example 2 is a tautology of: random(1,40). The probability of this occurring is also 2.5% but I don't need nested randoms.

 

Example 3:

random(random(0,2), random(2,4)

We have randoms within randoms, juicy:

Our lower bound generates numbers from 0-1 and upper bound generates numbers from 2-3.  What are the odds of any particular number? I've picked a particular small range to prove that any one number will have an exact probability of occurring.  Lets write out the cases:

Ranges of:

  • 0-2
  • 0-3
  • 1-2
  • 1-3

There's a 25% chance any one of these ranges will be generated:

0-2- 50% chance for 0 or 1 - (12.5% overall to pick 0 or 1)

0-3- 33.3% chance for 0,1,2 (8.325% overall to pick 0,1,2)

1-2- 100% of 1 (25% overall to pick 1)

1-3 - 50% of 1,2 (12.5% overall to pick 1 or 2)

 

Lets add the totals:

odds to pick 0: 12.5 + 8.325 = 20.825%

odds to pick 1: 12.5 + 8.325 + 25 + 12.5 = 58.325%

odds to pick 2: 8.325 + 12.5= 20.825%

Total = ~100

 

This means that: random(random(0,2), random(2,4) is a tautology of:

(a bit more difficult to produce these odds with using a simple random but this example below will do)

odds of 0 occurring: random(0,100) < 21

odds of 1 occurring: random(0,100) < 59

odds of 2 occurring: random(0,100) < 21

 

As you can see, all cases of these randoms will deduce to a single flat probability.

 

In life, most things follow a bell curve distribution. If you want to apply that randomness, then you will want to make use of Gaussian random. And if you want more information on that, I could possibly extend this. 

 

Edited by dreameo
  • Like 2
  • Boge 1
Link to comment
Share on other sites

Use 69 as upper bound, it will determine a sluttish behavior of the bots, best anti-ban :doge: 

tl;dr; Using a random range of 100 values requires (at least) 100 times the data and computational power to apply a regression algorithm. Using randoms in scripts is not completely pointless.

  • Like 2
  • Heart 1
Link to comment
Share on other sites

44 minutes ago, Token said:

Use 69 as upper bound, it will determine a sluttish behavior of the bots, best anti-ban :doge: 

tl;dr; Using a random range of 100 values requires (at least) 100 times the data and computational power to apply a regression algorithm. Using randoms in scripts is not completely pointless.

what if we use 420 as our limit. :xboge:

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
9 hours ago, ButNotaBot said:

i know it's been a few months but have you explained more on gaussian randoms @dreameo?

No I haven't

https://blogs.sas.com/content/iml/files/2019/07/rule6895.png

tldr:

Essentially linear distribution allows for all data points to be equally chosen. With a gaussian distribution, things are not linear and ranges of data points are more likely to occur than others. In doing so, it follows a more natural distribution since most things in life fall under a bell curve.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...