I have a sequences of random iid non-correlated positive integers sampled from some (unknown) distribution $\boldsymbol X=[n_1,n_2,...,n_N]$.
From it, I built another sequence in the following way:
$$ [1,2,3,...,n_1, 1,2,3,...,n_2, ...,1,2,3,...,n_N]$$
That is, I replaced each $n_i$ with a list $1,2,3,..,n_i$ (note: the lowest allowed value for $n_i$ is 1).
Q: How to get the variance of the mean of the last list? If it be possible, I would prefer a solution in terms of the $n_i$s.
For the first list I just used $\operatorname{Var}(\bar X)=\frac{\operatorname{Var}(X_i)}{N}$. I tried to solve the problem following this approach. But I do not get good results (sometimes I get a negative result).
$$\nu = \sum_{i=1}^N n_i.$$
Their sum is
$$S = \sum_{i=1}^N \frac{(n_i+1)n_i}{2}.$$
By definition, the mean is
$$m = \frac{S}{\nu} = \frac{\sum_{i=1}^N (n_i+1)n_i}{2\sum_{i=1}^N n_i} = \frac{1}{2} + \frac{1}{2}\frac{\sum_{i=1}^N n_i^2}{\sum_{i=1}^N n_i}.$$
This does not simplify. That's as far as you can go in this general setting. If you would like to specify the distribution of the $n_i,$ we could give more specific results.
– whuber Sep 14 '22 at 21:54