recherch_xiii.mws


Recherches sur l'intégration des équations différentielles aux différences finies, et sur leur usage dans la théorie des hasards.

P.S. Laplace

PROBLEM XIII .

I suppose a number of players (1), (2), (3),..( n ) play in this way: (1) plays with (2), and if he wins he wins the game; if he neither loses nor wins, he continues to play with (2), until one of the two wins. But if (1) loses, (2) plays with (3); if he wins it, he wins the game; if he neither loses nor wins, he continues to play with (3); but if he loses, (3) plays with (4), and thus in sequence until one of the players has defeated the one who he follows; that is to say (1) must be winner over (2), or (2) over (3), or (3) over (4), ... , or ( n-1 ) over ( n ), ( n ) or (1) over . Moreover, the probability of anyone of the players to win over the other equals 1/3 , and that of neither winning nor losing equals 1/3 . This put, it is necessary to determine the probability that one of these players will win the game at trial x .

One should approach the problem as a Markov chain and seek the probability of absortion from state i at time x.

Let's suppose 3 players. The 6 states are A: (1) plays with (2); B: (2) plays with (3); C: (3) plays with (1) and the absorbing states 1W, 2W and 3W in which (1), (2) and (3) win respectively. The transition matrix has a nice symmetry in that it is composed of 4 square matrices. The upper right and lower right are both diagonal matrices and the lower left is a zero matrix.

> restart:

> with(linalg):

Warning, the protected names norm and trace have been redefined and unprotected

> p:=1/3:

> T3:=array(1..6,1..6,[[p,p,0,p,0,0],[0,p,p,0,p,0],[p,0,p,0,0,p],[0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]]);

T3 := matrix([[1/3, 1/3, 0, 1/3, 0, 0], [0, 1/3, 1/...

Player (1) begins the game. We want the state at time x which will be given by the function f3(x) .

> ini3:=matrix(1,6,[1,0,0,0,0,0]);

ini3 := matrix([[1, 0, 0, 0, 0, 0]])

> f3:=x->evalm(ini3&*(T3&^x));

f3 := proc (x) options operator, arrow; evalm(`&*`(...

Now the function f2(x) will produce, in the fourth component, the probability that Player (1) wins at or before time x . In the fifth component is the probability that Player (2) wins at or before time x and in the sixth component is the probability that Player (3) wins at or before time x . Therefore, to obtain the probability that each Player win at time x it is necessary to compute f2(x)-f2(x-1) . It should be noted as well that Laplace's solutions are exhibited only for x <= n , n being the number of players. The pattern does not continue beyond this point.

> evalm(f3(3)-f3(2));

matrix([[-1/27, -1/9, 0, 1/27, 2/27, 1/27]])

> evalm(f3(4)-f3(3));

matrix([[-1/81, -4/81, -1/27, 2/81, 1/27, 1/27]])

Suppose 5 players. The process has 10 states analoguous to the previous example. In order to simplify matters, let's make use of some basic matrix operations in order to more efficiently create the transition matrix, T6.

> UL:=matrix(5,5,[[p,p,0,0,0],[0,p,p,0,0],[0,0,p,p,0],[0,0,0,p,p],[p,0,0,0,p]]):

> LL:=diag(0,0,0,0,0):UR:=diag(p,p,p,p,p):LR:=diag(1,1,1,1,1):

> L:=stackmatrix(UL,LL):R:=stackmatrix(UR,LR):

> T5:=augment(L,R):

Player (1) begins the game. The state of the system at time x is given by the function f5(x) .

> ini5:=matrix(1,10,[1,0,0,0,0,0,0,0,0,0]);

ini5 := matrix([[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]])

> f5:=x->evalm(ini5&*T5&^x);

f5 := proc (x) options operator, arrow; evalm(`&*`(...

We see that the probability that player (k) win at time x is the k th entry in the value of the last five columns of f5(x)-f5(x-1) . For example, we examine x=5 and x=6 below.

> delcols(evalm(f5(5)-f5(4)),1..5);

matrix([[1/243, 4/243, 2/81, 4/243, 1/243]])

> delcols(evalm(f5(6)-f5(5)),1..5);

matrix([[2/729, 5/729, 10/729, 10/729, 5/729]])

>