6 ms·
This isn't the central limit theorem. This is a binomial distribution. Nice animation though.
by Jabbles 13y ago
This isn't the central limit theorem. This is a binomial distribution. Nice animation though.
- wtvanhest 13y agoWhy isn't it the central limit theorem? It is taking random results and building a distribution which looks normal.
- SiVal 13y agoImagine you have a population that is NOT normally distributed. Take a large sample of it, and calculate the mean of your sample. Then take another large sample of that population and calculate its mean. Keep doing this. Think of each sample mean as a data point that gives you an estimate of the mean of the whole population. The Central Limit Theorem says (approximately, and there are conditions) that those sample-mean data points of yours will be normally distributed, even though they were obtained by sampling a non-normal distribution. This also works when the population IS normally distributed, but that's not a surprise. The surprise is that the sample means are normally distributed even when the population isn't. (And again, there are some qualifications I'm not mentioning.) So, sample means (estimates of the population mean) tend to be normally distributed even when the population they are sampling is not. The D3 demo here doesn't show multiple sample means, it shows that as you take more and more items from a normal population, the distribution of your sample of items gradually comes to resemble the distribution of the population as a whole.
- deleted 13y ago[deleted]
- pseut 13y agoNo, it does show multiple sample means. Each landing spot is the sum (scaled average) of the n - 1 bernoulli rvs, where n is the number of bins. The issue is that n is small.
- mturmon 13y agoYou are correct in pointing out this error of the parent comment (by SiVal). Each ball is indeed the sum of "n-1" bernoulli RVs, and the CLT does apply to these sums. As btilly points out elsewhere, to actually obtain the correct limit, you have to normalize the sum correctly. Because of the way the scaling is done in this graphic, as you increase the number of levels, it's in effect normalizing the sum by dividing by "n". To get the right limit, you need to divide by sqrt(n). In this sense, the CLT is a high-resolution version of the SLLN ("law of averages"). If you normalize the sums by 1/n, the resulting average converges to a number, the mean. But if instead you subtract this mean, and normalize by 1/sqrt(n) rather than 1/n, the result converges in distribution, and looks like a normal random variable. By less aggressive normalization, you get information about the fluctuations rather than just pounding it down to a number, as the SLLN does. I used to TA a probability class for undergrads, and I found the demo to be perfectly reasonable.
- pseut 13y agoIf we're going to pick nits, it would illustrate the "Weak" LLN, not the Strong LLN. The Strong LLN still holds here, but you'd need to plot the sample paths to illustrate it.
- mturmon 13y agoI was actually trying my best to not pick nits, because HN has somewhat too much of that. The reason I posted is to defend the OP against some assertions that I felt were picking at details of what started out to be a simple and fun visualization. I wrote what I did about the LLN to supply some intuition to the person who created the visualization, in case they wanted to put these two results in perspective.
- sshrin 13y agoThanks for this explanation. I understood most of it but could you explain why you should normalize using 1/sqrt(n) and why doing so makes the result converge in distribution?
- nphrk 13y agoIt is the distribution of the average of n binomial distributions (taking on values x±1)†, which according to the CLT converges to a Gaussian as n→∞. [†] x is where it is centered.
- pseut 13y agon = 4.
- btilly 13y agoYou only get the Gaussian if you take the limit correctly. In the visualization as you increase the number of bins, the Gaussian approximation becomes more and more squeezed, and by the weak law of large numbers the limit is a Dirac delta. In order to get the Gaussian you'd need to be looking at a window whose width is proportional to the square root of the number of bins.
- deleted 13y ago[deleted]
- Jabbles 13y agoWell, not really. The fact that CLT applies to a wide variety of distributions is a much stronger, mysterious and astonishing fact than what is demonstrated here. It would be like demonstrating that you've cracked RSA with p = 7, q = 11.
- calinet6 13y agoAgreed, learned more, was wrong, deleted comment. Curious though—doesn't the CLT apply to this distribution too, technically? Isn't the binomial distribution being sampled and converging on a normal distribution, as per the CLT? Maybe some more explanation would enlighten us.
- Jabbles 13y agoYes, this is definitely a special case of CLT. For instance, see: https://en.wikipedia.org/wiki/De_Moivre%E2%80%93Laplace_theorem https://en.wikipedia.org/wiki/De_Moivre%E2%80%93Laplace_theo...
- mturmon 13y agoSure, but the CLT holds in very great generality -- to variables that are not independent, and to stochastic processes. Any demonstration is bound to be a special case.
- bcgraham 13y agoWell, to be accurate, it's four binomial distributions, not just one. You need the sum of ~30 random variables before you're getting into the CLT, but it demonstrates the gist.
- deleted 13y ago[deleted]
- teraflop 13y agoIt does illustrate a special case of the CLT, in the sense that as the number of bins increases, the distribution (the mean of a bunch of +1/-1 Bernoulli random variables) converges to a normal distribution.
- dnautics 13y agoyes but the number of bins isn't increasing. EDIT: nm, I saw where you can increase the bins.
- deleted 13y ago[deleted]