This question is about finding the number of samples in a sequence required for the convergence of a series as a function of an error tolerance $\epsilon$. I want to show what I have tried so far.


The function is


$$ \sum\_{q=1}^{N-1} \exp(-q^2 \sigma^2/2)(1 - q/N) $$ for $\sigma > 0$ and $N \geq 1$


It is confirmed that this function converges with a large N. I want to find a function for $N$ at which the error is $\epsilon$.


So, the sum of this expression from $N$ to $\infty$ is less than $\epsilon$. The sum of this from $N$ to $\infty$ can be represented as,


$$ \sum\_{q=1}^{\infty} \exp(-q^2\sigma^2/2) - \sum\_{q=1}^{N-1} \exp(-q^2\sigma^2/2) (1-q/N) < \epsilon $$


For the first term, I tried something like this. If $q \geq 1$, $q(q-1) \geq 0$.


So,


$$ \sum\_{q=1}^{\infty} \exp(-q(q-1)\sigma^2/2) \exp(-q \sigma^2/2) \leq \sum\_{q=1}^{\infty} \exp(-q \sigma^2/2) = \frac{\exp(-\sigma^2/2)}{(1 - \exp(-\sigma^2/2))} $$


For the second term,


$$ \sum\_{q=1}^{N-1} \exp(-q^2\sigma^2/2) (1-q/N) $$


I used the same trick as above, but now I say that as $q \leq N-1, \quad q(q-1) \leq (N-1)(N-2) $


For the second term, as there is a negative in equation (2), we will test for greater than equal to conditional properties of that function.


$$ \sum\_{q=1}^{N-1} \exp(-q^2\sigma^2/2) (1-q/N) =\sum\_{q=1}^{N-1} \exp(-q(q-1)\sigma^2/2) \exp(-q \sigma^2/2) (1-q/N) $$


$$ \sum\_{q=1}^{N-1} \exp(-q^2\sigma^2/2) (1-q/N) \geq \exp(-(N-1)(N-2)\sigma^2/2) \sum\_{q=1}^{N-1} (1-q/N) \exp(-q \sigma^2/2) $$


I typed this sum on wolfram, and the final expression I have is this,


$$ \sum\_{q=1}^{N-1} \exp(-q^2\sigma^2/2) (1-q/N) \geq \exp(-(N-1)(N-2)\sigma^2/2) \frac{\exp(-\sigma^2/2) (N-1 + \exp(-N \sigma^2/2) - N \exp(-\sigma^2/2))}{((1 - \exp(-\sigma^2/2))^2 N}$$


Rearranging a bit,


$$ \sum\_{q=1}^{N-1} \exp(-q^2\sigma^2/2) (1-q/N) \geq \exp(-(N^2-3N+3)\sigma^2/2) \frac{(N-1 + \exp(-N \sigma^2/2) - N \exp(-\sigma^2/2))}{((1 - \exp(-\sigma^2/2))^2 N}$$


If I plug this into the original inequality, things become complicated.


$$ \sum\_{q=1}^{\infty} \exp(-q^2\sigma^2/2) - \sum\_{q=1}^{N-1} \exp(-q^2\sigma^2/2) (1-q/N) \leq \frac{\exp(-\sigma^2/2)}{(1 - \exp(-\sigma^2/2))} - \exp(-(N^2-3N+3)\sigma^2/2) \frac{(N-1 + \exp(-N \sigma^2/2) - N \exp(-\sigma^2/2))}{((1 - \exp(-\sigma^2/2))^2 N} < \epsilon $$


I don't know how to proceed from here.



Convergence as a function of error for the following function
$\newcommand\ep\epsilon\newcommand{\si}{\sigma} $"I want to find a function for $N$ at which the error is $\epsilon$."


This question is stated very poorly.


Indeed, let $n:=N$ (there is no reason to use $N$ where $n$ will do.) The $n$th error is
\begin{equation\*}
 \ep\_n:=s-s\_n=\ep\_{1n}+\ep\_{2n}, 
\end{equation\*}
where
\begin{equation\*}
 s:=\sum\_{q=1}^\infty a\_q,\quad s\_n:=\sum\_{q=1}^{n-1} a\_q(1-q/n),
 \quad a\_q:=e^{-q^2\si^2/2},
\end{equation\*}
\begin{equation\*}
 \ep\_{1n}:=\sum\_{q=n}^\infty a\_q,\quad \ep\_{2n}:=\frac1n\,\sum\_{q=1}^{n-1} a\_q q. 
\end{equation\*}


Clearly, $\ep\_n$ takes only countably many values; so, the equality $\ep\_n=\ep$ can hold only for countably many values of $\ep$. Also, a closed-form expression for $\ep\_n$ is not available. So, solutions of the equation $\ep\_n=\ep$ for $n$ are not available in closed form, even when such solutions exist.



> 
> However, for any real $\ep>0$, we can provide an explicit lower bound $n\_{\si,\ep}$ on $n$ such that $\ep\_n\le\ep$ for $n\ge n\_{\si,\ep}$ -- and this is what appears to have actually been tried to do in most of the OP.
> 
> 
> 


Indeed, note that
\begin{equation\*}
 r\_q:=\frac{a\_{q+1}}{a\_q}=e^{-(q+1/2)\si^2} 
\end{equation\*}
is decreasing in $q$. So,
\begin{equation\*}
 \ep\_{1n}\le\sum\_{q=n}^\infty a\_n r\_n^{q-n}=\frac{a\_n}{1-r\_n}=\frac{e^{-n^2\si^2/2}}{1-e^{-(n+1/2)\si^2}}
 \le2e^{-n^2\si^2/2}
\end{equation\*}
if
\begin{equation\*}
 n\ge\frac{\ln2}{\si^2}-\frac12. 
\end{equation\*}
Next,
\begin{equation\*}
 \ep\_{2n}\le\frac1n\,\sum\_{q=1}^\infty a\_q q
 \le\frac{h(\si)}n, 
\end{equation\*}
where
\begin{equation}
 h(\si):=\sum\_{q=1}^\infty a\_1 r\_1^{q-1} q
 =\frac{e^{5 \si ^2/2}}{(e^{3 \si^2/2}-1)^2}. 
\end{equation}
Thus, if
\begin{equation}
 n\ge n\_{\si,\ep}:=\max\Big(\frac{\ln2}{\si^2}-\frac12,\sqrt{\frac2{\si^2}\,
 \max\Big(0,\ln\frac3\ep\Big)},
 \frac{h(\si)}{\ep/3}\Big),
\end{equation}
then $\ep\_n\le\ep$. $\quad\Box$


