dreameo Posted August 8, 2019 Posted August 8, 2019 (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) 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 August 8, 2019 by dreameo 2 1
IDontEB Posted August 8, 2019 Posted August 8, 2019 So what's the probability of ban or no ban? Is it still 50/50? 2
Token Posted August 8, 2019 Posted August 8, 2019 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
Runnwith Posted August 8, 2019 Posted August 8, 2019 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. 1
Token Posted August 8, 2019 Posted August 8, 2019 9 minutes ago, Runnwith said: what if we use 420 as our limit. Your bots will become too savage
Gunman Posted August 8, 2019 Posted August 8, 2019 25 minutes ago, Token said: Your bots will become too savage What if we use 69, 420?
Token Posted August 8, 2019 Posted August 8, 2019 3 minutes ago, Gunman said: What if we use 69, 420? Unpredictable behavior 1
YoHoJo Posted August 8, 2019 Posted August 8, 2019 1 hour ago, Token said: Unpredictable behavior What i... what if we use 420, 69, 5318008?!
Token Posted August 8, 2019 Posted August 8, 2019 22 minutes ago, YoHoJo said: What i... what if we use 420, 69, 5318008?! https://en.wikipedia.org/wiki/Brainfuck 2 1
ButNotaBot Posted December 18, 2019 Posted December 18, 2019 i know it's been a few months but have you explained more on gaussian randoms @dreameo?
dreameo Posted December 18, 2019 Author Posted December 18, 2019 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.