Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

The Wiki is wrong?

Asked by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

In this article, the wiki says:

for _ = 1, 10 do
    print(math.random(100))
    wait(1)
end

"Test the place, and look at the output window. Write down the numbers you get, and exit the test. Then do the test again, and again write down the numbers you get. Notice something weird? Those 10 very random numbers are similar everytime you run a test (or play online for that matter)."

But this isn't true. In my first test, I got the numbers 36, 48, 52, 88, 2, 78, 10, 100, 15, 17. In my second test, I got 15, 79, 43, 47, 24, 99, 21, 70, 85, 100.

I don't see the sameness the wiki is talking about.

0
So why was this downvoted??? All the guidelines are followed. Perci1 4988 — 9y
0
No idea, but i'll upvote it for you. Lacryma 548 — 9y
0
I upvoted to be fair. FearMeIAmLag 1161 — 9y

2 answers

Log in to vote
4
Answered by 9 years ago

The numbers that Random will give are not very similar but fall in a similar range. Notice how you have many numbers less than 25 and many numbers between 70 and 85? This is because Random gives back similar numbers. The numbers won't be exact and not all numbers will follow this pattern but it is noticeable that quite a few will.

0
100 isn't a very large sample size either. The trend is a lot more obvious as the sample size increases. adark 5487 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

The reason why some of the "random" numbers match is because roblox has a pseudo randomizer, nothing cannot be perfectly random according to this video. So there IS actually supposed to be some pattern, for example, if you had to choose a random number 1-10, 7 would be the most choosed. 1 and 10 would not likely be chosen since it is at the end, even numbers are probably not going to be chosen, same with 5 since it is in the middle, and people are most likely to chose a prime number. 3 is too small and so 7 is left. One time I did math.random is returned, 7 then 5 then 2. 7-5 is 2, or I got 1 then 10 after I did math.random(1,10). You might be thinking it's nonsense but pretty much everything has a pattern!

Answer this question