Let $X_1,\dots, X_n$ be i.i.d symmetric $\pm 1$ random variables, i.e. $X_j$ takes values in $\{-1,1\}$ with $$\mathbb{P}(X_j=1)=\mathbb{P}(X_j=-1)=\frac{1}{2}.$$ Let $a_1,\dots,a_n\in\mathbb{Z}$, define $$X=\sum_{j=1}^n a_jX_j.$$ How can we prove that $$\mathbb{P}(X=0)=\frac{1}{2\pi}\int_0^{2\pi}\prod_{j=1}^n\cos(a_jt)dt.\quad(*)$$
I noticed that the integrant in the right hand side of $(*)$ is the characteristic function of the random variable $X$, so I am thinking about using the inverse formula: $$\frac{\mathbb{P}(X=a)+\mathbb{P}(X=b)}{2}+\mathbb{P}(a<X<b)=\lim_{T\to\infty}\frac{1}{2\pi}\int_{-T}^T\frac{e^{-ita}-e^{-itb}}{it}\varphi_X(t)dt$$ where $\varphi_X(t)$ is the characteristic function of $X$. However I didn't see the connection between the inverse formula and the result we want to prove. Any suggestions?
Write $\cos(a_j t) = (\exp(i a_j t) + \exp(-i a_j t))/2$, and expand the product. We get
$$ 2^{-n} \sum_{x \in \{-1,1\}^n} \exp \left( i \sum_{j=1}^n x_j a_j t\right) $$ Now note that $$\dfrac{1}{2\pi} \int_0^{2\pi} \exp(ikt)\; dt = \cases{0 & if $k$ is a nonzero integer\cr 1 & if $k = 0$\cr}$$ Thus, assuming the $a_j$ are all integers, your right side becomes $ 2^{-n}$ times the number of $x \in \{-1,1\}^n$ such that $\sum_j x_j a_j = 0$, and this is $\mathbb P(X=0)$.
Well, you don't quite need the $a_j$ to all be integers: what you need is $\sum_j x_j a_j$ to always be an integer. You could have an even number of half-odd-integers and the rest integers.