[Mathematics] The Weirdness of Randomness 08-21-2015, 03:48 PM
#1
Randomness is weird. The very nature of randomness should mean that the results of a hundred coin toss shouldn't be 50-50. It doesn't make sense. But that's just what happens.
To demonstrate, I wrote the following program in Python2:
(Note: I understand the nature of the randint module and why you might be concerned with the example, but it makes no difference for this explanation. It serves to prove a point.)
The above code tosses a 'coin' 10 times. Then it counts how many heads and how many tails were generated.
If you look at the results, you can see a vague pattern. The number of heads is generally near the number of tails, and the value is around half of 10.
We can amplify this effect by repeating the same thing but with more tosses. Here it is with 100:
This shows us that the correlation strengthens with the more tosses there are. Why? Why isn't it that we get 90 heads and 10 tails? It's certainly possible, and randomness shouldn't logically follow the laws of probability. We shouldn't be able to predict randomness.
Let's do it again with something ridiculous, say a million:
This proves that you can predict randomness. At least to an extent. And that with the more random values, the higher the accuracy of the prediction.
Why? Is it a paradox? Is there a name for this phenomenon? Why is randomness defying entropy?
To demonstrate, I wrote the following program in Python2:
Code:
from __future__ import division
from random import randint
for n in range(5):
values = []
tosses = 1000000
for x in range(tosses):
values.append(randint(0,1))
n0 = values.count(0)
n1 = values.count(1)
n0percent = n0 / tosses * 100
n1percent = n1 / tosses * 100
print 'There were ' + str(n0) + ' heads. (' + str(n0percent) + ' percent)'
print 'There were ' + str(n1) + ' tails. (' + str(n1percent) + ' percent)'
print ''
(Note: I understand the nature of the randint module and why you might be concerned with the example, but it makes no difference for this explanation. It serves to prove a point.)
The above code tosses a 'coin' 10 times. Then it counts how many heads and how many tails were generated.
Code:
There were 5 heads. (50.0 percent)
There were 5 tails. (50.0 percent)
There were 4 heads. (40.0 percent)
There were 6 tails. (60.0 percent)
There were 6 heads. (60.0 percent)
There were 4 tails. (40.0 percent)
There were 8 heads. (80.0 percent)
There were 2 tails. (20.0 percent)
There were 6 heads. (60.0 percent)
There were 4 tails. (40.0 percent)
If you look at the results, you can see a vague pattern. The number of heads is generally near the number of tails, and the value is around half of 10.
We can amplify this effect by repeating the same thing but with more tosses. Here it is with 100:
Code:
There were 55 heads. (55.0 percent)
There were 45 tails. (45.0 percent)
There were 50 heads. (50.0 percent)
There were 50 tails. (50.0 percent)
There were 53 heads. (53.0 percent)
There were 47 tails. (47.0 percent)
There were 52 heads. (52.0 percent)
There were 48 tails. (48.0 percent)
There were 49 heads. (49.0 percent)
There were 51 tails. (51.0 percent)
This shows us that the correlation strengthens with the more tosses there are. Why? Why isn't it that we get 90 heads and 10 tails? It's certainly possible, and randomness shouldn't logically follow the laws of probability. We shouldn't be able to predict randomness.
Let's do it again with something ridiculous, say a million:
Code:
There were 499458 heads. (49.9458 percent)
There were 500542 tails. (50.0542 percent)
There were 499673 heads. (49.9673 percent)
There were 500327 tails. (50.0327 percent)
There were 499708 heads. (49.9708 percent)
There were 500292 tails. (50.0292 percent)
There were 500360 heads. (50.036 percent)
There were 499640 tails. (49.964 percent)
There were 499498 heads. (49.9498 percent)
There were 500502 tails. (50.0502 percent)
This proves that you can predict randomness. At least to an extent. And that with the more random values, the higher the accuracy of the prediction.
Why? Is it a paradox? Is there a name for this phenomenon? Why is randomness defying entropy?