I am thinking a math problem on finding the average number of free games. Assuming for a slot game, N free games will be awarded to player, free game could be triggered again in free game at probability of P and no limit of retriggering time.
Here is my math to find out the average number of free game.
average # = N + N*P + (N*P)^2 + (N*P)^3 + ... = N + N*P [1 + N*P + (N*P)^2 + ...] = N + N*P/(1 - N*P)
the last expression is given for N*P<1 for slot game, so summation formula for geometric series could be applied.
Let's assume N=50, and P=0.001, I got the average # is about 50.0526
However, from simulation, code as follows
A = 0 // total number of free game
loop 1 to 100000000
NF = 50 // initial number of free games for this round
A = A + 50
while (NF>0)
NF = NF - 1
if (random number which leads to win of additional free game) // random number has 0.001 chance to give free game
NF = NF + 50
A = A + 50
end if
end while
end loop
the average number of free games is A/100000000 about 50.505050
The simulation is quite straightforward and I don't see problem myself. So could any one help to point out any problem in my math. Thanks.
My calculation is N*(1+1*Np+1*(Np)^2+.....) = N*1/(1-Np) = 50/0.95 = 52.6315.
And the code for simulation is correct, but there is something wrong on you random number generator, it must be UniformDistributed.
My result is 52.6324 with 1000000 times simulation, it's quite close the theoretical result.
I hope it helps you.
Quote: bolverkHi, konglify
My calculation is N*(1+1*Np+1*(Np)^2+.....) = N*1/(1-Np) = 50/0.95 = 52.6315.
And the code for simulation is correct, but there is something wrong on you random number generator, it must be UniformDistributed.
My result is 52.6324 with 1000000 times simulation, it's quite close the theoretical result.
I hope it helps you.
Thanks a lot for your explanation. I double check my code and make the distribution uniform, I get similar result as yours. However, I don't understand why the series becomes
N*(1+1*Np+1*(Np)^2+.....)
instead of
N + Np + (Np)^2 + (Np)^3 + ...
I get that by thinking that I will get N free games assigned to me at the beginning, and then I may have p chance to win another N so the second term to be Np .... I know your series is correct since the simulation match up with that. But I don't understand how that's come out. Could you give me more hint. Thanks.
Quote: bolverkHi, konglify
My calculation is N*(1+1*Np+1*(Np)^2+.....) = N*1/(1-Np) = 50/0.95 = 52.6315.
And the code for simulation is correct, but there is something wrong on you random number generator, it must be UniformDistributed.
My result is 52.6324 with 1000000 times simulation, it's quite close the theoretical result.
I hope it helps you.
By the way, what happen if the game rule limit that the free game can only be triggered once not infinite. I follow your series and cut all the power of 2 and higher term. I get N*(1 + 1*Np) = 52.50. But when I work out the math in my mind, I have different thought, I am thinking the player could win the additional free game at any time during the first 50 spin. So should we consider the case when he/she wins the first spin or second spin or third spin ... so the math looks like
N + N*p + N*qp + N*q^2p + N*q^3p + ... + N*q^50p
where q=1-p is the probability of not winning additional free games. If I work out the math in this way, I get the average number of spins to be 52.4389 instead of 52.50. I run the simulation and it gives me something close to 52.43 also. So is my math correct when limit one retrigger only? If so, why we have to consider the order of winning additional free spin in that case but not in infinite case?
Quote: konglifyThanks a lot for your explanation. I double check my code and make the distribution uniform, I get similar result as yours. However, I don't understand why the series becomes
N*(1+1*Np+1*(Np)^2+.....)
instead of
N + Np + (Np)^2 + (Np)^3 + ...
I get that by thinking that I will get N free games assigned to me at the beginning, and then I may have p chance to win another N so the second term to be Np .... I know your series is correct since the simulation match up with that. But I don't understand how that's come out. Could you give me more hint. Thanks.
The reason why the second term is not Np is that every spin has the chance to retrigger the free game, so the second term should be N* Np where Np is the expected number of retrigger only once per spin. And so on.
Quote: konglifyBy the way, what happen if the game rule limit that the free game can only be triggered once not infinite. I follow your series and cut all the power of 2 and higher term. I get N*(1 + 1*Np) = 52.50. But when I work out the math in my mind, I have different thought, I am thinking the player could win the additional free game at any time during the first 50 spin. So should we consider the case when he/she wins the first spin or second spin or third spin ... so the math looks like
N + N*p + N*qp + N*q^2p + N*q^3p + ... + N*q^50p
where q=1-p is the probability of not winning additional free games. If I work out the math in this way, I get the average number of spins to be 52.4389 instead of 52.50. I run the simulation and it gives me something close to 52.43 also. So is my math correct when limit one retrigger only? If so, why we have to consider the order of winning additional free spin in that case but not in infinite case?
You only have 50 spin at the start., so the correct eqution should be N + N*p + N*qp + N*q^2p + N*q^3p + ... + N*q^49p .
beacuse (1+q+q^2+q^3+q^4.....+q^49)(1-q) = 1-q^50 where 1-q = p,
you'll have N+N(1-q^50) = 52.43971859.
In infinite case, N(1+1*Np) means only first N spins can retrigger the free game.
You may retrigger the free game more than once.
Quote: bolverkYou only have 50 spin at the start., so the correct eqution should be N + N*p + N*qp + N*q^2p + N*q^3p + ... + N*q^49p .
beacuse (1+q+q^2+q^3+q^4.....+q^49)(1-q) = 1-q^50 where 1-q = p,
you'll have N+N(1-q^50) = 52.43971859.
In infinite case, N(1+1*Np) means only first N spins can retrigger the free game.
You may retrigger the free game more than once.
Thanks bolverk. It helps and I did learn something.
I have question about limitted number of free spin.
For example p=0,02 and N= 10 and I want to limit number of free spins up to 50.
If I have no limit the result would be 12,5.
I'm not sure how would be if maximum number of free spins must be 50.