You are viewing a single comment's thread. Return to all comments →
this is really just math so sit down with pen and pencil
and figure it out.
In case you need some hints, consider this relation:
expectedTime cntPoped cntUnpoped =
(cntPoped / (cntPoped + cntUnpoped)) * (1 + expectedTime cntPoped cntUnpoped)
+ (cntUnpoped / (cntPoped + cntUnpoped)) * (1 + expectedTime (cntPoped + 1) (cntUnpoped - 1))
now of course this will not work as the recursion never stops - here comes the math (solve x = a*(1+x) + y for x and compare)
x = a*(1+x) + y
the rest should be really easy
What is x, y and a in your case ?