It's hollyday so i'm not gonna do maths
But info is not a problem !
> roll := rand(0 .. 1);
proc() ... end;
>
1
> A := matrix(1, 1000, [seq(roll(), i = 1 .. 1000)]);
> MULTI := matrix(1, 1000);
> MULTI[1, 1] := 1;
for i to 999 do
if A[1, i] = 0 then MULTI[1, i+1] := 1 end if;
if `and`(A[1, i] = 1, MULTI[1, i] < 5) then MULTI[1, i+1] := MULTI[1, i]+1 end if;
if `and`(A[1, i] = 1, MULTI[1, i] = 5) then MULTI[1, i+1] := 5 end if end
do;
1
> print(MULTI);
MULTI
> Somme := 0; for i to 1000 do Somme := Somme+A[1, i] end do;
0
> Somme1 := 0; for i to 1000 do Somme1 := Somme1+MULTI[1, i] end do;
0
> print(Somme);
513
> print(Somme1);
1991
>
I'm getting a win average of 0.513 (close to 0.5) and a multiplier average of 1.991 which is close to 2
So correct formula seems to be
y= sum(x^n with n from 1 to +inf)
and don't bother calculating it there is a forumula which is
(1-x^n)/(1-x)
so (1-0)/(1-0.5)= 1/0.5=2
Damn i said i will not do maths....
For people interested here are the matrix
[[1,1,1,0,1,1,0,1,0,1,1,1,1,0,0,1,0,1,1,1,0,0,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,0,1,1,1,0,0,1,1,0,0,0,1,0,0,0,0,1,0,0,1,1,1,1,1,0,0,0,1,0,0,0,
1,0,1,1,1,0,0,1,0,1,1,0,1,0,0,0,0,1,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,1,1,0,1,0,1
,1,1,0,1,0,0,0,1,1,1,1,1,0,0,1,0,1,0,0,0,1,1,1,1,1,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,0,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,0,0,0,1,0,1,0,0,0,0,1,1,0,1,0,1,0,0,0,
1,1,0,1,0,1,0,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