Question: I am running an algorithm which is based on random selection of some variables and it produces some results. The time consumption of this algorithm is depend on those random initialization. Each running time is different and it is not depend on previous running. 

I want to repeat ( N times) this process and get the average response time of this algorithm. Statically, how to get N to be sure that the average is acceptable and not far from the reality? any test should I do such as t-test or Z-test? Can anyone in this area help me, what should i do? And how can I say that the average is accurate enough?
Thanks

Answer: 
if $a=-1$ then we have that $s\_n(-1+1) =1^0+2^0+\cdots +n^0=n$.

yet $s\_n(-1) = \frac{1}{1}+\frac{1}{2} +\cdots+\frac{1}{n} = \ln n +\gamma$ 

the famous Harmonic number where $\gamma \approx 0.577$.

So $\lim \limits\_{ n \to \infty} \frac{n}{n (\ln n+ \gamma)} = 0$.

the sum $1^a+2^a+3^a+\cdots+n^a$ is either always decreasing or always increasing, in both cases we can bound it be integrals.

so $s\_n(a+1) = \sum \limits\_{k=1}^{n} k^{a+1}$ and $\frac{(n-1)^{a+2}-2^{a+2}}{a+2} =\int \limits\_{2}^{n-1} k^{a+1} dk \leq \sum \limits\_{k=1}^{n} k^{a+1}\leq \int \limits\_{0}^{n+1} k^{a+1} dk =\frac{(n+1)^{a+2}}{a+2}$

and $s\_n(a) = \sum \limits\_{k=1}^{n} k^a$ and $\frac{(n-1)^{a+1}-2^{a+1}}{a+1}=\int \limits\_{2}^{n-1} k^a dk \leq \sum \limits\_{k=1}^{n} k^a\leq \int \limits\_{0}^{n+1} k^a dk =\frac{(n+1)^{a+1}}{a+1}$

so taking limits of lower bound from first sum with upper bound from second sum and vice-versa ,they must be equal to this to work,

by the above the limit is $0$ when $a+2<1$ meaning $a<-1$.

and when $a>-1$ the limit is $\frac{a+1}{a+2}$.
Hint: try with [Stolz-Cesàro](https://en.wikipedia.org/wiki/Stolz%E2%80%93Ces%C3%A0ro_theorem)
$$
\lim\_{n\to\infty}\frac{s\_n(a+1)}{ns\_n(a)} =
\lim\_{n\to\infty}\frac{1^{a+1}+2^{a+1}+\cdots+n^{a+1}}{n(1^a+2^a+\cdots+n^a)} =
\lim\_{n\to\infty}\frac{(n+1)^{a+1}}{(n+1)^{a+1} + (1^a+2^a+\cdots+n^a)}
= \lim\_{n\to\infty}\frac{1}{1 + \frac{1^a+2^a+\cdots+n^a}{(n+1)^{a+1}}}
= \frac{1}{1 + \lim\_{n\to\infty}\frac{1^a+2^a+\cdots+n^a}{(n+1)^{a+1}}}
= \cdots
$$
 and apply Stolz-Cesàro again.