# Botting and Probability

## Recommended Posts

Posted (edited)

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)

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
• 2
• 1
• 1

Quick mafths

##### Share on other sites

So what's the probability of ban or no ban? Is it still 50/50?

##### Share on other sites

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

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.

• 2
• 1

##### 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

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.

##### Share on other sites
9 minutes ago, Runnwith said:

what if we use 420 as our limit.

Your bots will become too savage

##### Share on other sites
25 minutes ago, Token said:

Your bots will become too savage

What if we use 69, 420?

##### Share on other sites
3 minutes ago, Gunman said:

What if we use 69, 420?

Unpredictable behavior

##### Share on other sites
1 hour ago, Token said:

Unpredictable behavior

What i... what if we use 420, 69, 5318008?!

##### Share on other sites
22 minutes ago, YoHoJo said:

What i... what if we use 420, 69, 5318008?!

• 2
• 1
• 1

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.