Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


[Mathematics] The Weirdness of Randomness filter_list
Author
Message
[Mathematics] The Weirdness of Randomness #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:

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?

Reply

RE: [Mathematics] The Weirdness of Randomness #2
Python 2... [Eye twitch]
For some reason, the Collatz sequence comes to my mind. No matter what number you use, it will always end up with 1 at the end.

Furthermore, nothing can really be random due to cause leading to effect, in terms of a real-world coin toss, the result of the coin toss is relative to the amount of kinetic energy passed to the coin, air resistance, humidity, inertia and everything else in the way of its trajectory. Odds like 50/50 in real-word actions are more ideological and theoretically it would be possible to calculate the result of a single action by a 100% accuracy by inserting the enviormental data into a simulation model but considering the sheer massive amount of parameters it is practically impossible to do it.

Disclaimer note: Python 3-x Master-race.


[Image: tumblr_noac9s6rgw1tvnnaxo1_500.gif]
Tik Tak~! Time is up~!

Reply

RE: [Mathematics] The Weirdness of Randomness #3
(08-21-2015, 03:58 PM)Jolly Wrote: Python 2... [Eye twitch]
For some reason, the Collatz sequence comes to my mind. No matter what number you use, it will always end up with 1 at the end.

Hmm, I haven't heard of it before. I'm researching it now. It's a nice read, and it's given me an idea...

Reply

RE: [Mathematics] The Weirdness of Randomness #4
(08-21-2015, 04:03 PM)eclipse Wrote: Hmm, I haven't heard of it before. I'm researching it now. It's a nice read, and it's given me an idea...

I once did a Python 3 program demonstrating the Collatz Sequence, if you want I can send it to you.


[Image: tumblr_noac9s6rgw1tvnnaxo1_500.gif]
Tik Tak~! Time is up~!

Reply

RE: [Mathematics] The Weirdness of Randomness #5
(08-21-2015, 04:09 PM)Jolly Wrote: I once did a Python 3 program demonstrating the Collatz Sequence, if you want I can send it to you.

(Euw, Python3)

Thanks, but I've posted a golfing challenge and will be attempting it myself later in Python2.

Reply

RE: [Mathematics] The Weirdness of Randomness #6
Randomness in this instance is only somewhat "predictable" because the random module only produces pseudorandom numbers. In most real-world instances of requiring random numbers, atmospheric noise is generally used for obtaining random numbers.
[Image: CDUAq9d.png]

Reply

RE: [Mathematics] The Weirdness of Randomness #7
(08-21-2015, 04:30 PM)Shebang Wrote: Randomness in this instance is only somewhat "predictable" because the random module only produces pseudorandom numbers. In most real-world instances of requiring random numbers, atmospheric noise is generally used for obtaining random numbers.

I know and included an explanation as to why I used python's pseudo-random generator in the OP. A simple flipping of a coin would yield the same results.

Reply







Users browsing this thread: 1 Guest(s)