Let $\lambda_1,\cdots,\lambda_n$ be real numbers. Let us consider $f : t \mapsto \frac{1}{n}\sum^n_{j=1} e^{i\lambda_j t}$. We have that $f(0) = 1$; in general, $f$ is not periodic.
Soon after $0$, one might expect that the $e^{i\lambda_j t}$ spread around the unit circle enough so that the sum has a lot of compensations, so that $f(t)$ is small, in modulus. However, for exceptional $t$, the $e^{i\lambda_j t}$ may realign and the modulus of $f(t)$ would be close to $1$ again.
If, for example, $\vert f(t) \vert$ is thought as a magnitude of risk of something, at time $t$, one is interested in estimating the first time $t$ at which $\vert f(t) \vert$ is close to $1$ again.
So, one could try to study $g_{\epsilon} : t \mapsto \{\vert f(t) \vert \ \mbox{if} \ \vert f(t) \vert > 1 - \epsilon, \ 0\ \mbox{if not}\}$, and maybe try to estimate $\int^T_0 g_\epsilon(t) dt$ and figure out how it grows, but this seems to be a hard problem.
My question is: how can one formulate this problem in a rigorous mathematical way, such that the answer is both reachable and relevant to the informal problem? Are there efficient, analytical tools to study such problems?
Let WLOG $\;\lambda_1\le\lambda_2\le\dots\le \lambda_n.\;$
The given function is periodic, if $\lambda_j=m^\,_j\lambda_0,\quad m_j\in\mathbb N,\quad\lambda_0\in\mathbb R.\tag1$ In this case, $\;f(t) = P_{m_n}(e^{\lambda_0\,t}),\;$ where $\;P\;$ is a polynomial.
Looks convenient to approximate the given function by the periodic one.
The possible algorithm is the next.