where the \( \alpha_j \)'s are independent standard normal (aka Gaussian) random
variables and the functions \( f_j(z) \) are arbitrary analytic functions on
the complex plane.

The left panel shows the theoretical expected density. The random coefficients are
assumed to be iid standard Gaussian random variables.
The functions \( f_j(z) \) can be selected using the pull-down menu above.
The number of terms, \(n\), can also be changed.

To check empirically that the theoretical distribution is correct, you can
generate a large number of random polynomials and plot their roots by clicking
on the Compute Empirical button. If the \(\alpha_i\)'s are standard
Gaussians, then the empirical density should closely match the theoretical
density (as long as the sample size is fairly large).

By default, 3000 random sums are generated. For large values,
the empirical distribution looks very much like the theoretical density.
Also, by default the functions are random polynomials. But, you can select
various choices for the \( f_j \)'s including sines and cosines to make
random Fourier series. You can also select a few different distributions for
the \( \alpha_j \)'s but this selection only affects the empirical distribution.
The theoretical distribution always assumes a Gaussian distribution for the
coefficients.

With default settings, the code takes about 15 seconds to solve (on my laptop
computer).
Using Matlab, one can compute the empirical distributions much more quickly.
Here's the code for that:
findroots.m