ScratchData LogoScratchData
Back to grandpasp's profile

test random 1 to 10

GRgrandpasp•Created February 19, 2024
test random 1 to 10
0
0
17 views
View on Scratch

Instructions

This project was triggered by a question on the studio Dads & Moms on Scratch by @gaming22meti-_-alt about random numbers. The question involved infinity but this project tests the chance of getting a 1 when picking a random number between 1 and 10 vs between 1.0 and 10.0. Completely different result!

Description

After the flag, a repeat loop generates random numbers 1,000,000 times and counts the number of times that random number = 1. (for the floating-point numbers I just test to see whether the number is within .0000001 of 1.0). To test the resolution of the Pick Random module, I ran a test, trying to count how many non-duplicate numbers it could find between 1.0 and 0.0000000001. I needed a list to keep track of the numbers. A million generated random numbers easily fills the list (to 200,000) so the number is larger!

Project Details

Project ID968115941
CreatedFebruary 19, 2024
Last ModifiedFebruary 21, 2024
SharedFebruary 20, 2024
Visibilityvisible
CommentsAllowed