A Lesson in Statistics Using Random Sequences
Statistics may come naturally to some people, but it is a difficult subject for many of us. Using simulations helps to remove some of the mystery of statistics. Luckily, it is trivial to produce a pseudo-random Gaussian or uniform sequence: a single command in Matlab (or Python) does it. In this article, I try to explain a few concepts using Gaussian and uniform random sequences generated in Matlab. First, we’ll generate a Gaussian sequence, calculate its variance, and plot a histogram and probability density function (PDF). Next, we’ll simulate the roll of a single die to illustrate a uniform distribution. Then we’ll simulate rolling two dice and finally, as an illustration of the Central Limit Theorem, we’ll sum the total when rolling several dice to obtain an approximately Gaussian distribution.






