I was reading a paper by Odereich and Kahan regarding constant round zero-knowledge proof and had a doubt regarding how they calculated an expected value.
There are two probabilistic black boxes $A$ and $B$. On input $x$ to $A$, it outputs a key $K$ with probability denoted $a(x)$ and halts without output otherwise (i.e.,$a(x) := Prob(A(x) = K)$). On input $x$ and key $K$, the second black-box, $B$,it produces an output with probability denoted $b(x)$ and otherwise halts with no output (or outputs the empty string ). On input $x$, first $A(x)$ is invoked. If the output is not $K$ then we halt indicating failure, otherwise we repeatedly invoke $B(x; K)$ until a non-empty output is obtained. The paper then goes on to say that ``clearly, the expected number of times that $B$ is invoked is $a(x)/b(x)$." I am not clear as to how it can be a quotient of these two values.
Simply estimate the expected value: $$\mathbb{E}(\#_B)=1\cdot ab+2\cdot ab(1-b)+3\cdot ab(1-b)^2+...$$ or $$\mathbb{E}(\#_B)=\lim\limits_{n\rightarrow\infty}\frac{ab}{1-b}\sum_{i=1}^n i(1-b)^i.$$ This sum is so called low-order polylogarithm and we know that $$\lim\limits_{n\rightarrow\infty}\sum_{i=1}^n i(1-b)^i=Li_{-1}(1-b)=\frac{1-b}{b^2}.$$ Hence the result.