Probability test

In the three doors of A, B, and C, there is a hidden prize. When a player selects 1, the judge will choose and open 1 empty door from the 2 remaining gates, then ask the player if he will change his answer to another door. At this time, what choice should the player make to locate the prize more easily?

Solution:

A B C D
1 1000000 [A,B,C]  
2 0 0  
3 for A1 =int(rand(3))+1 =int(rand(3))+1
4   =B1(B3) =B1(C3)
5   =B1\C4 =B5\B4
6   =int(rand(C5.len()))+1 =C5(B6)
7   =(B5\C6)(1)  
8   if B4==C4 >A2+=1
9   else if B4==B7 >B2+=1
10 =A2/A1 =B2/A1  

In A10, the probability of locating the prize with the answer changed is shown below:

In B10, the probability of locating the prize with the answer unchanged is shown below. As can be seen, changing the answer in this game will almost double the probability of locating prize: