
OFFICIAL Topic: https://scratch.mit.edu/discuss/topic/546703/ _______ This is a project that you can use to conduct your own experiments with the random number generator, post your findings/patterns in the comments! ________ If the number is WAYY TOO large then it's going to be biased due to JavaScript's limitations - https://scratch.mit.edu/discuss/post/5653501/ ________ For ease of typing, we'll be referring to 'random number generator' as 'RNG', remember that! Variable Meanings - "Max RAND" - The maximum random number the RNG will generate. "ODD" - Number of times the RNG generated an ODD number from '1' to 'Max RAND'. "EVEN" - Number of times the RNG generated an EVEN number from '1' to 'Max RAND' "Tries" - How many random numbers were generated from '1' to 'Max RAND' (will be reset to 0 everytime you change the Max RAND var) "Biased Towards" - Shows which type of number (Odd or Even) was generated more by the RNG, and how many more than the other. "Random Number" the last number the RNG generated from '1' to 'Max RAND'. _____ The RNG starts of with generating random numbers from 0 to 1,000,000,000 (1 billion) and displays approximately 50% for both odd and even Weirdly, when the RNG generates a random number from 1 to 1,000,000,000,000,000,000,000 (1 with 21 zeros), it generates an even number 99.999% of the time, which is very, very biased! This is because it goes WAYY over the MAX_SAFE_INTEGER JavaScript limit of 9007199254740991, and most likely you wouldn't face this issue . . . A Max RAND equal to 10 is mostly close enough to 50.1% odd and 49.9% even, but it does favour ODD numbers, and increases the favour along with the number of tries! At around a million tries, odd is favoured by 1100+ values! A Max RAND equal to 100 is mostly close enough to 49.9% odd and 50.08% even, but it does favour EVEN numbers, and DOESN'T increases the favour along with the number of tries! And, at 1.5 Million tries, ODD is favoured?! Weird right? Or maybe just that it's quite random ;) ________ 100% code by @Chiroyce - The block in the thumbnail was taken from scratchblocks.