recherch_xvi.mws


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

P.S. Laplace

PROBLEM XVI.

I suppose the tickets A1, A2, B1 and B2 , contained in an urn, and that two players A and B play on this condition that A choosing the tickets A1 and A2 , and B the two others, if one draws each time one alone of these tickets at random, the one of the two players will win, who first will have attained the number i, the tickets A1 and B1 counting for 1, and the tickets A2 and B2 counting for 2. This put, if there lacks n units to the player A and x-n units to player B, one asks the respective probabilities of the two players A and B to win.

Laplace expresses the solution as a recurrence relation which is a function of n and x . Unfortunately he merely sketches the path towards a solution. Laplace does not completely solve the problem nor does he offer a numerical example. We'll construct a recurrence relation based on n and x-n instead.

Let's let m = x-n be the number of points lacking to player B. Let B(n,m) be the probability that player B wins. Since the player may reach this state from the previous by drawing any one of the four tickets with equal probability, we must have

B(n,m) = (B(n,m-1)+B(n,m-2)+B(n-1,m)+B(n-2,m))/4

However, Laplace notes that if player A lacks but 1 point, then the tickets A2 and B2 should be removed from play so that B(1,m) = (B(1,m-1)+B(0,m))/2 . Laplace does not say so, but this condition must be symmetric. Therefore, B(n,1) = (B(n-1,1)+B(n,0))/2 as well. Of course, the boundary conditions require that B(0,m) = 0 for 0 < m and B(n,0) = 1 for 0 < n .


We may therefore implement this recurrence relation as

> B:=proc(n,m)

> if n=0 then 0 elif m=0 then 1 elif (n=1 or m=1) then (B(n-1,m)+B(n,m-1))/2 else (B(n,m-1)+B(n,m-2)+B(n-1,m)+B(n-2,m))/4 fi; end:

In the same manner, let A(n,m) be the probability of player A winning. The recurrence relation is analogous with only the boundary conditions being altered and we may implement it easily as

> A:=proc(n,m)

> if n=0 then 1 elif m=0 then 0 elif (n=1 or m=1) then (A(n,m-1)+A(n-1,m))/2 else (A(n,m-1)+A(n,m-2)+A(n-1,m)+A(n-2,m))/4 fi; end:

Clearly, A(n,m)+B(n,m) = 1 for all values of n and m .

Moreover, by symmetry, we must have A(n,n) = B(n,n) for all 0 < n .

> B(3,3);

1/2

> B(3,2);

21/32

> A(3,2);

11/32

>

The solution in TAP . This problem is repeated in TAP where Laplace changes the rules slightly in that he allows a player who lacks one point to win by drawing either the ball labeled with 1 or with 2. He solves this problem in terms of the number of points each player is lacking using generating functions. As before, let players A and B lack m and n points respectively.

The generating function of A winning is g(s,t) = (t*(1-t/4-t^2/4)+s*t/4)/(1-t)/(1-s/4-t/4-s... and that of B winning is the same with s and t interchanged, namely h(s,t) = s*(1-s/4-s^2/4+s*t/4)/(1-s)/(1-s/4-t/4-s^2...

> g:=(t*(1-t/4-t^2/4)+s*t/4)/(1-t)/(1-s/4-t/4-s^2/4-t^2/4):

> h:=(s*(1-s/4-s^2/4)+s*t/4)/(1-s)/(1-s/4-t/4-s^2/4-t^2/4):

Now, the probability that player A wins given that he lacks m and his opponent lacks n is the coefficient of the term s^m*t^n in the expansion of the generating function g(s,t) . For example, if player A lacks 3 and player B lacks 2, player A will win with probability 43/128 .

> mtaylor(g,{s=0,t=0},6);

t+1/2*s*t+t^2+3/8*t*s^2+5/8*s*t^2+t^3+7/32*s^3*t+1/...

In the same manner, the probability that player B wins given that player A lacks m and his opponent lacks n is the coefficient of the term s^m*t^n in the expansion of the generating function h(s,t) . Thus, if again player A lacks 3 and player B lacks 2, player B will win with probability 1-43/128 = 85/128 .

> mtaylor(h,{s=0,t=0},6);

s+s^2+1/2*s*t+s^3+5/8*t*s^2+3/8*s*t^2+s^4+25/32*s^3...

>

We note that the solutions do differ but only slightly from one another.