Find variance for counter which gives value of 100i

24 Views Asked by At

I am working on 5-1(b) problem in clrs book. The problem can be found in this link. The problem is that we have a special counter, which increments with probability $$ p = \frac{1}{n_{i+1} - n_i} $$ and does not increment with probability 1-p. Also, it gives the value $n_i$ which is a function of i. In the problem, $n_i=100i$.
The goal is to find variance of the counter after n increments. In the problem 5-1(a) we found that the expected value of counter after n increments is n. So using that information my approach to find variance is as shown below:

$$ \sum_{i=1}^n \frac{1}{100}*[100 -1]^2 + \frac{99}{100}*[0-1]^2 $$

Here $p=\frac{1}{100}$ and the expected value for single increment is taken as 1[as expected value of n increments is n]. After solving above I get the variance as 99n. But as per the link the answer is 0.99n. So, what am I doing wrong here?