Okay, so I was playing with a random number generator one day. And then I thought about a unit I was learning in math that same day, which was about probability. So I'm thinking: Just how random can randomly picked numbers be?
By this I mean "What is the probability that a randomly picked number isn't random?" So let's do it!
Alright, I opened up the Snap! editor to play with the random number block. Then I put a number from 1 to 2, then 1 to 5, and then 1 to 10. Each number would randomly be chosen for 5 rounds.
Here's the data I got:
1 to 2:
- First attempt: 1
- Second attempt: 1
- Third attempt: 2
- Fourth attempt: 1
- Fifth attempt: 1
You can see that out of 5 attempts, 4 of these attempts were the same number, which was 1.
1 to 5:
- First attempt: 3
- Second attempt: 2
- Third attempt: 3
- Fourth attempt: 5
- Fifth attempt: 5
You can see that out of 5 attempts, 2 attempts were of the same number, which was 3, and another 2 attempts were of the same number, which was 5. However, the RNG didn't choose numbers like 1 or 4, mainly prime numbers like 2, 3, and 5.
1 to 10:
- First attempt: 2
- Second attempt: 9
- Third attempt: 1
- Fourth attempt: 5
- Fifth attempt: 3
This time, the random number generator DIDN'T choose a number that is the same as a number it chose before.
Now I will use another random number generator and see what its results would be, and then I can see whether the results would be the same or not. Then I could use these results to determine if random number generators REALLY are randomly generated.
1 to 2:
- First attempt: 1
- Second attempt: 2
- Third attempt: 2
- Fourth attempt: 1
- Fifth attempt: 1
Surprisingly, the results were almost identical!
1 to 5:
- First attempt: 3
- Second attempt: 4
- Third attempt: 1
- Fourth attempt: 5
- Fifth attempt: 2
Welp, the results were different this time. The random number generator decided to choose all the numbers, which was either a coincidence, or on purpose.
1 to 10:
- First attempt: 2
- Second attempt: 9
- Third attempt: 9
- Fourth attempt: 8
- Fifth attempt: 6
You can see that out of 5 attempts, 2 of these attempts were the same number, which was 9. The first two attempts had the same number, which is weird.
So using 2 random number generators, I was able to depict if random number generators were really random or not, and here's the answer.
For the 1 to 2 tests, the tests were almost identical, and so let's just say that they likely didn't choose a random number. But they were given choices to choose numbers between 1 and 2, and so didn't really have options.
For the 1 to 5 tests, the test results were much different. The first number generator, which used Snap!, chose to choose the numbers 2, 3, and 5. It never chose the number 1 or 4. The second one, which used Google's RNG, decided to choose all the numbers, which deemed it useless. So let's just say that they likely did not choose random numbers. I mean, the first random number generator chose 2 two times in a row, which would most likely conclude that it wasn't random at all. Also the second one (Google) chose numbers 1 to 5 in different orders, which makes it basically make 5 number combinations.
For the 1 to 10 tests, the first one (Snap) chose numbers that were different every time, so no repetition or anything for us. Google's RNG choose the number 9 twice in a row, which doesn't tell me that it was randomly choosing numbers. I'd say that Snap! did a better job in choosing numbers 1 to 10 randomly.