D
D
dso2016-10-27 13:06:58
Combinatorics
dso, 2016-10-27 13:06:58

Combinatorics questions: why does the 50% probability change?

There are two problems in combinatorics that I solve just out of curiosity. In the process of manipulation, I came across several interesting features that I can’t explain, because I don’t have enough knowledge. Maybe someone can spend their time and explain what exactly is the solution? Please don't get angry in advance if the questions and methods I use turn out to be completely stupid - I'm just doing something interesting, as if I were just throwing stones into the sea and watching them raise spray.
So, two tasks.
1) Classic. Throw a coin and guess: heads or tails. We are trying to improve the results of successful guessing.
2) A person is given two envelopes with money to choose from. The amount of money in the first envelope is chosen absolutely randomly, and the amount twice as much is always placed in the second. That is, if you decide to put $5 in the first envelope, then $10 will be in the second. A person, having chosen an envelope, can open it. Then he can refuse the first envelope and take the second one, or keep the first one and end the round. After the end of the round, the referee shows the amounts in both envelopes. The bottom line is to guess the envelope with more money more often.
The sample in each task was different, I tried up to 1,000,000,000 (billion).
Task number 1.
If I make a script with a simple random choice, I get 50% results with a little plus or minus. That is, 49.99999 or 50.00001 (the more samples, the more we strive for 50%). Everything is clear here. Another thing begins if I start counting the number of "tails" and "eagles". And when choosing, if more tails came up earlier, I choose heads. And if more heads came up earlier, I choose tails.
There's a thing that I can't understand: the number of successful guesses always goes above 50%. Let on a small "tail" (hereinafter I will call it +K (positive) or -K (negative)), but the 50%-K situation ceases to happen. In any case, for several days of testing, I have never been able to get 50% -K.
Question: is this natural, or is it all about the limitations of the pseudo-random number generator of the programming language?
Task number 2. . Sorry long explanation, tried to shorten it as best I could.
Envelope selection randomly.
I see $5. So the second envelope is either $10 or two dollars and 50 cents. Decided to keep $5 for myself. The referee agrees with my choice, opens the second envelope, and there is $10. I lost. The game goes on and on.
If I constantly choose a random envelope without any strategy, I again get 50%. With +K or with -K.
Envelope selection taking into account the arithmetic mean of the amounts in envelopes.
In order to improve the guessing results, I begin to write down two values: the number of attempts and the arithmetic mean of the amounts that are in the envelopes. Then I follow the rule: I leave the envelope if the amount contained in it is more than the arithmetic average of all amounts, or I change the envelope if there is less money in the envelope.
Simulation of three trials:
Envelopes:
- $5 and $10
- $20 and $40
- $20 and $40
After round 1. Average will be: (10+5) / 2 = 7.5.
After round 2. The arithmetic mean will be: (7.5 * 2 + 40 + 20) / 2 = 37.5.
The envelopes that I get first contain the amounts: 5, 20 and 20.
In the first case, I keep the first envelope $5 (because the average is still 0) and lose $10.
In the second case, I keep $20 (since the average is 7.5) and lose $40.
In the third case, I forfeit the first $20 envelope (since the average is 37.5) and win $40.
Depending on the width of the rand(0, X) range, the degree of guessing reaches up to 75%. That is, the arithmetic mean quickly determines the limits of the range of amounts in envelopes that are unknown, but are finite, and this means that all numbers greater than X / 2 are always larger, which is reflected in the statistics of guessed amounts.
Of course, if we take a very large segment with cosmic numbers, the degree of guessing again begins to tend to 50%. But we still always get 50%+K.
The question is absolutely the same as for the first task: is it natural, or is it all about the limitations of the pseudo-random number generator of the programming language?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-10-27
@alsopub

1) The problem is that computer (software) generators are pseudo-random number generators, not truly random ones.
2) The problem is that you can only verbally take "a very large segment with cosmic numbers." In fact, you are limiting yourself to just "a large number", which is where some K comes from.
IMHO
UPD. Try to pull out a sequence from here as a source of numbers - https://www.random.org/sequences/
According to https://habrahabr.ru/post/137864/ there should be a more or less high-quality generator.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question