recurro_v.html
laplace on even_odd.mws
Mémoire sur les suites
récurro-récurrentes
et sur leur usages dans la théorie des hasards
PROBLEM V
. —
If in a pile of
x
pieces one takes a number at random, it is
necessary to determine the probability that this number be even or odd
.
Let
y
denote the sum of the even cases,
z
the sum of the odd. Laplace observes the two
equations relating the quantities.
>
eqn1:=y(x+1)=y(x)+z(x);
![eqn1 := y(x+1) = y(x)+z(x)](recurro_v/recurro_v1.gif)
>
eqn2:=z(x+1)=z(x)+y(x)+1;
![eqn2 := z(x+1) = z(x)+y(x)+1](recurro_v/recurro_v2.gif)
If there is but 1
piece (
), then the sum of the
odd must be 1. Therefore, the particular solution is given by
>
sol:=rsolve({eqn1,eqn2,y(1)=0,z(1)=1},{y,z});
![sol := {y(x) = 1/2*2^x-1, z(x) = 1/2*2^x}](recurro_v/recurro_v4.gif)
Clearly, odds are
favored over evens. Now, if we compute the total number of cases:
t(x)=y(x)+z(x), we can compute the probabilities of each. Namely,
>
t:=rhs(sol[1]+sol[2]);
![t := 2^x-1](recurro_v/recurro_v5.gif)
>
prob_even:=unapply(rhs(sol[1])/t,x);
![prob_even := proc (x) options operator, arrow; (1/2...](recurro_v/recurro_v6.gif)
>
prob_odd:=unapply(rhs(sol[2])/t,x);
![prob_odd := proc (x) options operator, arrow; 1/2*2...](recurro_v/recurro_v7.gif)
For example, if we
let
we obtain the odds
>
prob_even(5)/prob_odd(5);
![15/16](recurro_v/recurro_v9.gif)
>