THE ENVELOPES PROBLEM

Рубрика конференции: Секция 14. Технические науки
DOI статьи: 10.32743/NetherlandsConf.2022.4.18.335682
Библиографическое описание
Пиккио П.Ф., Железняков И.Э. THE ENVELOPES PROBLEM// Proceedings of the XVIII International Multidisciplinary Conference «Innovations and Tendencies of State-of-Art Science». Mijnbestseller Nederland, Rotterdam, Nederland. 2022. DOI:10.32743/NetherlandsConf.2022.4.18.335682

THE ENVELOPES PROBLEM

Polina Pikkio

student, st. Petersburg State University,

Russia, st. Petersburg

Ivan Zheleznyakov

baccalaureate, st. Petersburg State University,

Russia, st. Petersburg

 

The paradox of the two envelopes is a well-known mathematical paradox in probability theory. There are two players, there are two envelopes, each containing a certain amount of money, and in one of the envelopes the amount is twice as much or half as much as the amount in the other envelope. Each player takes one envelope and counts the amount of money in it. Everyone is then asked to choose whether to keep their envelope or take another envelope, hoping to get a larger amount.

The first player reasons as follows: suppose he has x roubles. Then the other envelope may contain 0.5x or 2x roubles. Assuming that the other envelope contains either 0.5x or 2x, the average winnings in case he takes the other envelope: (0.5x + 2x) / 2 = 1.25x roubles. Accordingly, it is more reasonable to choose the swap option, although the player doesn't know whether there is more or less money in the other envelope. Also, after this reasoning it becomes clear that it doesn't matter how much money is in the envelope.

Obviously, the second player will reason in the same way. We get that the exchange of envelopes is beneficial for both players, which cannot be the case. This is the paradox of the two envelopes.

What is the trick? The player thinks that the amount he has in the envelope doesn't matter and can change right away, because the average winnings are always greater than the amount in his envelope. That means that the probability that the sum in one envelope is greater than in the other is 1/2 regardless of the amount seen. Such a statement is only true if every value of the sums from zero to infinity is equally probable. But if all infinities are equally likely, the chance of each value has zero probability. Then every outcome has zero chance. Simply put, no one can put an infinite amount in an envelope.

Let us describe the solution to the paradox in mathematical terms. Denote by f(x) the probability that the first player has sum x in his envelope, the second player has sum X in his envelope. The conditional probability that the first player has 2X in his envelope is P(A = 2X | B = X) = f(2X) / f(X/2) + f(2X).

The formulation of the two envelope problem assumes that this conditional probability is 1/2 regardless of the amount X the player sees in his envelope. Therefore, f(X/2) = f(2X) for all X > 0. Accordingly, f(x) must be constant on the interval from 0 to infinity. However, this assumption is invalid: if the probability is positive and constant on the positive semi-axis, then its integral is infinite, which is impossible. Thus, the initial assumption of the paradox (equal probability X/2 and 2X) is unrealizable.

In order to make the problem correct, it is possible to limit the possible amounts that may appear in the envelopes. Then we obtain that the amounts in both envelopes are independent random variables with the same distribution.

Consider the case when this distribution is uniform. Let us take the example when the sum in the envelope is limited from 0 to 50 rubles. The mathematical expectation in this case is 25. Then our strategy is to exchange envelopes if the sum in our envelope is less than 25 roubles, and not to do it if it is more. Let's try to calculate the average amount using integrals. If the envelope contains less than 25 roubles, we expect that after the exchange we will get:

 

If the sum is more than 25, we will not exchange it and we expect that we will get:

 

Then the average sum is (25 + 37.5) / 2 = 31.25 rubles. In order to make sure that our assumption is correct, let's simulate the above situation using the Python language.

No exchange: 24.414666597265132

Exchange based on situation: 31.004286348637237

As a result of the simulation, you can see that the strategy really works. A situation based exchange is much more favourable than simply keeping the envelope for yourself every time.

Now let us try to distribute the money in the envelopes by an exponential distribution. E[X] = 1/λ.

Let us simulate the situation with the help of Python.

Just keep it: 9.998935869149703

Change always: 9.991695732989532

Amount if we change based on the situation: 13.677832928185612

Just keep: 1.000862151677552

Change always: 0.9979346062119588

Amount if we change based on the situation: 1.3680925087632667

It is clearly seen that even if the intensity of the exponential distribution is different, it is much more profitable to exchange based on the mathematical expectation than to simply keep the envelope each time or to swap each time.

We obtain a theoretical form for the exponential distribution and for the intensity of the distribution λ = 1 let us calculate the sum that we obtain if we vary, based on the mathematical expectation. L is the expectation, p(x) is the density of the distribution.

Consider for L = 1 / λ = 1, the exponential distribution density p(x) = e^(-x) :

The results of the simulation coincide with the theoretical calculations.

 

References:

  1. Turner and Tom Quilter. The Two Envelopes Problem. URL: http://www.gatsby.ucl.ac.uk/~turner/Notes/TwoEnvelopes/2envlps.pdf. (Date of the application: 18.02.2022).
  2. Joel Grus. Data Science from Scratch: First Principles with Python. O'Reilly Media. 2019. 406p.