Question regarding a bit of a javascript mystery

Hi all,
I have a curiosity I wonder if someone can divine for me:

In RPG Maker MV, I have an event with a conditional set up using 2 variables.
In separate event I define Var 0001 = 20
Then I have Var 0002 = a random integer 0 - 100.
The conditional is set up so that if Var 0001 > Var 0002, the event fails.

I noticed the event was succeeding a lot more often than 20% of the time, so I tested the event with Var 0001 set as 1, and then again set as 99. (Var 0002 remains random).

It seems that when I had Var 0001 = 1, I had a 99% chance of success, and at 99 I had a 1% chance.
It's not a problem, because I just reversed the sign to get the probability I want, I'm just really curious why "If 20 > Random(0-100)" gives me an 80% chance rather than 20%.
For clarification, your best bet is to take a screenshot of the eventing in question, including the structure of your if statement, because that sounds more like you have something set up oddly.
Are you sure you are comparing "If 20 > Random(0-100)" instead of "If Random(0-100) > 20"?
Yeah, I'm sure. I was kind of just wondering if there was some quick of js that caused it that I didn't know about. I don't use those variables, but there must be something in the code somewhere. Thanks for the responses~ 🙂
Welcome to randomess and RNG... Unless you're doing an inifitissimal amount of trials, chances/random can work really randomly.

Unless of course its really a case of you actually using the reverse of what you intended to do. So yeah, a screenshot of the events would be good
In separate event I define Var 0001 = 20
Then I have Var 0002 = a random integer 0 - 100.
The conditional is set up so that if Var 0001 > Var 0002, the event fails.
As written, this means a 20/101 chance of failure, i.e. ~80% chance of success. 😅

I.e. when var 2 is 0~19 the condition is met and "the event fails".
When dealing with random numbers I find it helpful doing a bunch of test runs to see if the statistics were correctly setup:
upload_2019-5-5_14-16-52.png

Original thread: https://forums.rpgmakerweb.com/threads/question-regarding-a-bit-of-a-javascript-mystery.108672/