Summation of cosine of uniform random variable I read that the PDF of the sum of cosines of a random variable, which is uniformly distributed, is a non uniform distribution; something like inverse square root of the random variable.  My doubt is, not going into pdf, but just if we calculate sum of cosine of random variable varying between $-\pi$ to $\pi$, i.e., SUM $(\cos (t_j))$, should it not be 0 for large number of values for the $t_j$ intuitively? I am confused. If this is a valid question can anyone help? Thanks a lot.
Also, if we have SUM $(\cos(t_j))$, $t_j$ is uniform random variable between $-\pi$ to $\pi$, then will introducing frequency $w$ (omega) affect the answer to above question? i.e., SUM $(\cos (w \cdot t_j))$?
 A: Consider a series of independent uniform random variables $U_1,U_2,U_3,... \sim \text{IID U}(0,1)$ and form the corresponding series $X_1,X_2,X_3,...$ as:
$$X_i = \cos(\pi U_i).$$
For all $|x| \leqslant 1$ the latter random variables have the distribution function:
$$\begin{equation} \begin{aligned}
F_X(x) = \mathbb{P}(X \leqslant x) 
&= \mathbb{P}(\cos(\pi U) \leqslant x) \\[6pt]
&= \mathbb{P} \Big( U \geqslant \frac{1}{\pi} \cdot \arccos(x) \Big) \\[6pt]
&= 1 - \frac{1}{\pi} \cdot \arccos(x), \\[6pt]
\end{aligned} \end{equation}$$
and the corresponding density function:
$$\begin{equation} \begin{aligned}
f_X(x) = \frac{dF_X}{dx}(x) 
&= -\frac{1}{\pi} \cdot \frac{d}{dx} \arccos(x) \\[6pt]
&= \frac{1}{\pi} \cdot \frac{1}{\sqrt{1-x^2}}. \\[6pt]
\end{aligned} \end{equation}$$
This random variable has mean $\mathbb{E}(X) = 0$ and variance $\mathbb{V}(X) = \tfrac{1}{2}$.  Now, let $S_n = \sum_{i=1}^n X_i$ be a partial sum of these variables, and note that it has mean $\mathbb{E}(S_n) = 0$ and variance $\mathbb{V}(S_n) = \tfrac{n}{2}$.  By the central limit theorem the limiting distribution of the standardised sum is the standard normal distribution.  For large $n$ we have the approximate distribution:
$$S_n \overset{\text{Approx}}{\sim} \text{N} \Big( 0, \frac{n}{2} \Big).$$
The variance of the sum increases with $n$, so there is no convergence to zero --- the sum will be distributed around zero, buts its variance gets bigger and bigger. However, if you instead look at the sample mean $\bar{X}_n = S_n/n$, the variance of this latter quantity decreases to zero, so you will have convergence to the mean of zero.  This latter result is a manifestation of the law of large numbers.

Simulation: We can simulate this problem in R as follows.  In this code we plot the kernel density of $m = 10^5$ simulations for $n=100$ and we superimpose the normal density as a red dashed line.  You can see that this is a very close approximation to the kernel density of the simulations.
#Simulate matrix of cosine values
set.seed(1);
m <- 10^5;
n <- 100;
U <- matrix(runif(n*m,0,1), nrow = m);
X <- cos(pi*U);

#Calculate sample total of cosine values
S <- rowSums(X);

#Create data-frame for plotting
DD <- density(S);
NN <- dnorm(DD$x, mean = 0, sd = sqrt(n/2));
GRAPH <- data.frame(S = DD$x, Density = DD$y, Approx = NN);

#Plot density of sample totals
library(ggplot2);
FIGURE <- ggplot(data = GRAPH, aes(x = S, y = Density)) +
              geom_line(size = 1) +
              geom_line(aes(y = Approx), colour = 'red', linetype = 'dashed') +
              ggtitle('Density of Sample Means of Cosine Simulations') +
              xlab('Sample Mean') + ylab('Density');
FIGURE;


